Why do AWS ec2 instances get degraded? - amazon-web-services

I've been trying to get details on this but no luck. I've observed that if an ec2 instance has been running for many days (say 30-40 days), it gets degraded. Terminating that instance works.
But,
Why do ec2 instances get degraded? Is it because of the hardware or the software that we are running on it?
Is there anyway to avoid it?

This is quite a rare occurrence.
It means that there is an issue with the hardware on which the instance is running.
You can change the hardware by Stopping the instance, and then Starting it again. This will provision the instance on a different host computer.
If you have experienced this multiple times, then there is probably an issue with the operating system or application running on the instance. You should contact AWS Support for assistance.

Related

How can I debug an AWS EC2 instance randomly becoming unreachable

We have an EC2 instance which becomes unreachable randomly. It has only started recently, and seems to only happen outside of business hours.
We are finding that the instance websites, WHM, SSH, even a terminal ping is all unreachable. However, the instance is running and health checks are fine in AWS console.
We used to have this with another instance but that just randomly stopped doing it at some point.
I have checked the CPU usage and the last 2 weeks, it has hit 100% 4 times but the times when that happened, are not when the instance goes down and I'm not sure they're even related.
The instance has WHM/cPanel installed, has not reached disk usage limit, nor bandwidth usage limit. We have cPHulk Brute Force Protection installed and running so surely can't be brute force attack?
It is resolved by stopping, then starting the instance, but we have clients viewing links and with the server going down outside of business hours and clients in different timezones.
I recommend you try installing a CloudWatch Agent to the EC2 instance in order to get the metrics and be able to analyze them further.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html

AWS 'The instance is running on degraded hardware.' And about my software

I'm using AWS EC2 instance now.
I got the message "The instance is running on degraded hardware".
I found what I should do.
https://forums.aws.amazon.com/thread.jspa?threadID=105610
I read a reason
"This means that your instance that is virtually running on a physical host which is having hardware problems so it is not running optimally and this could cause your instance to become inaccessible."
"all you have to do is just start it again and it will then spawn on a new healthy host."
My EC2 instance hardware has a NVME and my mongodb data in it.
I wonder if I stop and start my EC2 instance, and my EC2's hardware will be changed, And my mongodb data will be disappeared? or still in it?
Thanks for your answer.
You could test this easily: spin up a small instance, write a file. Restart the instance, log in again. File still there with the contents? There’s your answer.
If you have data you wish to keep a good test beats relying on the internet for answers, even if it is stack overflow;)

AWS EC2 instance becomes inaccessible via SSH after

Issue : after a given period of time (usually the time it takes for the initial status checks to complete) I can no longer access my EC2 instance via SSH. More specifically during the initial period, I have normal access to my instance via SSH, then it drops, and the machine becomes completely unreachable, even when trying to ping it.
I have double checked Security Group, VPC settings etc. but don't think that can be the issue as at one point in time I can access the machine.
The issue occurs on "vanilla" instances from very basic standard AMIs as well as with AMIs I run on other AWS accounts. I have tried various instance types / sizes, but the issue occurs again and again.
Any ideas welcome! Thanks in advance
Dan
There are many things that can cause this. Specifically, if you're supplying user data during startup it could encounter an issue and eliminate your ability to SSH if it is modifying the file system and mounts or changing permissions.
If you can save the underlying system volume you can remount it and check /var/log/boot.log and /var/log/cloud-init-output.log

Do EC2 instances randomly start/stop?

I am trying to wrap my head around EC2 instances, and I am having a bit of an issue. I heard from a friend of mine that Amazon will kill EC2 instances, and then they restart the image (thus losing all state). Unless it uses EBS as a backing store, you get no persistence.
But I have been looking into Xen and it seems like instances should easily migrate instead of being killed/restarted.
So, do Amazon EC2 instances randomly stop/start an image with all state being managed by something external like EBS?
Amazon EC2 instances will not be stopped/started/restarted unless you issue a command to do so.
In some situations (eg hardware maintenance), you might receive a request from Amazon asking you to stop & start your instance (which moves it to a different host). Such requests are typically issued with two weeks notice.
One AWS customer told me that their instance had been running continuously for over three years.
Yes it is quite possible that an EC2 instance dies and is replaced. Depending upon your data, you may need to use EBS, EFS or S3 to prevent data loss in such cases.

Which amazon web service instance must I use for standalone?

I am running an ns3 network simulator experiment (https://www.nsnam.org/) on c4.4xlarge compute-optimized instance.
My goal is just to borrow a good ubuntu computer to run simulation which takes a long time to run (~ 2days). It is standalone and doesn't have to be a server.
However I noticed with only one instance it is quite slow. What should I do to make the most of the service in this case?
If the job you wish to run is too slow, then you have three choices:
Have patience, or
Use a more powerful EC2 instance, or
Use more EC2 instances
If the simulator is able to run across multiple VMs in parallel, take a look at Amazon EC2 Spot Instances. They are low-priced instances that are made available when there is spare capacity on EC2. They can be as little as 90% of the standard price. The downside is that a rise in the Spot Price could cause the instances to be terminated with only two minutes notice.