AWS 'The instance is running on degraded hardware.' And about my software - amazon-web-services

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;)

Related

Why do AWS ec2 instances get degraded?

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.

What is Amazon EC2 Bundle Tasks

What is AWS EC2 Bundle Tasks?
Could any one please help me to understand what it is?
And any one help in showing a sample demo of it by steps or screenshot?
In the old days, before Amazon Elastic Block Store (Amazon EBS), Amazon EC2 instances were booted from Instance Store.
Instance Store is a disk that is directly connected to the host computer, which means that when an instance is turned off, the contents of the disk is lost (because the disk will be assigned to the next user who uses a Virtual Machine on that host).
This also meant that instances could not be stopped and started again, because the boot disk is lost.
These days, Amazon EBS provides network-attached storage, which persists even when an instance is stopped (and, if desired, even after an instance is terminated).
According to this article, Bundle Tasks is/was a process designed to get a Windows instance ready for booting from Instance Store:
See: Bundle Tasks in Amazon | Zeeshan Ali Shah's Blog
There is little reason to use this process these days.

Will my web app be deleted if I stop my EC2 instance?

According to the AWS documentation "any data stored in the RAM of the host computer or the instance store volumes of the host computer is gone." Does this mean that the web application I installed on my EC2 instance will be deleted if I stop running my instance?
I apologize for the naive question. I am new to this and worried I might make a mistake.
An Amazon EC2 instance is just like a normal computer. If you turn it off, anything in RAM is lost. Also, if you reboot either computer, the contents of RAM is lost (well, more like 'forgotten', but effectively the same).
Just like your home computer, if you reboot or stop/start an EC2 instance, it boots up again. Whatever software you have installed on the computer is still there. However, applications you were running will only start if you have configured a startup script to run the app again.
Typically, when software such as a web server is installed on a computer, it is configured to automatically start again when the computer is turned on/rebooted in future.
Elastic Block Store (EBS) disk volumes act just like a disk in a normal computer. If an EC2 instance is stopped and later started again, the contents of the disk is still there, unchanged.
Bottom line: It's just like a home computer. Don't panic.
Adding to John's answer, as long as you do not use an Instance Store volume, to store your web application, you are good to go.
The data in an instance store persists only during the lifetime of its
associated instance. If an instance reboots (intentionally or
unintentionally), data in the instance store persists. However, data
in the instance store is lost under the following circumstances:
The underlying disk drive fails
The instance stops
The instance terminates
If however you are using an EBS volume, these conditions do not apply and you are free to start and stop your instance any number of times you want.
Yes unless you have EBS volume attached to EC2. If you are using an EBS-backed instance, you can stop and restart that instance without affecting the data stored in the attached volume

AWS/EC2 - Initially working instances, become inaccessible, although still running.

Issue in a nutshell:
Simple-singular-practice ec2 instances are unexpectedly just falling off the grid even though they are still running, and I have to keep recreating them ,and if not, ssh accessing or online public DNS accessing will result in a "Timeout".
Little More Details Outside the Nutshell :)
I've followed the setting up a LAMP server instructions to the "T" and successfully have served up basic HTML pages.
Everything initially works fine:
I can ssh into the instance no problem
When accessing the public DNS online - the expected html pages render just fine.
Problem:
But then, quiet randomly, I can no longer access the instance through ssh and even online, the public DNS is inaccessible.
In both cases they just "Timeout"
Config:
Basic Free Tier
Amazon Linux AMI 2015.09.1 (HVM), SSD Volume Type
t2.micro
Number of Instances - 1
Auto-assign Public IP(Enabled)
Ports - 22(My IP),80(0.0.0.0),443(0.0.0.0)
Using a key pair
Question:
What typically causes instances freezing up like this?
LAMP stacks on EC2 are extremely common, and the guide you're following is extremely popular and has been used for years so it's likely you've gone wrong somewhere or the problem is something more sinister.
If you can't access the instance by any means, it would sound like it has become overloaded. Unless you've accidentally changed a firewall rule on the AWS side (eg. Security Groups, NACLS) or something on the instance level (eg. IP Tables).
Open up ICMP on your security group and try pinging the instance and see if you get a response.
After you've verified all your firewalls and you've tried to connect to it through every means, check out the logs, they're your friend.
To check the logs, start at the AWS level. CloudWatch records lots of data about your instance - CPU Utilization, Network In & Out and more. Check all of these through the AWS Console ensuring you select the "Maximum" statistic and not "Average". Also, take a look at the "StatusCheckFailed_System" (Hardware problem) and "StatusCheckFailed_Instance" (Instance not responding to health check probes) metrics to see if they have any story to tell. See the docs here and here for more info.
Next, reboot the instance and try stop starting and reconnect via SSH. Check you application logs (if any) and check your Apache Logs and Linux Logs to see what happened.
But to answer your question, what typically causes a instance to freeze up like this:
Bad Application code that sucks up all the CPU overloading the instance
Too much traffic overloading the instance
Running too many services on the instance that it's unable to handle
AWS Hardware problem - Uncommon

Set up basic environment of AWS without freetier

i am newbie to use AWS system.
well, my freetier is just expired recently.
so far, i run an instance all day and use ssh to make code there.
but now, i realized it could charge me more than i expected. so i decided to terminate the instance.
then, how can i connect to instance easily? do i need to turn it on everytime i want to code?
And which is better? whether using DynamicDB(in AWS) or make a separated instance and install linux and mongodb(or something else).
Thanks =)
Best practices to save on cost is to stop (not terminate) your instance when you are not using it.
You will not pay for your instance in STOPped mode. You will just pay for the storage of your EBS volumes (boot drive).
When you Terminate your instance, you cannot restart it. If you Terminate you instance, be sure your data are saved on a secondary EBS volume or a snapshot or stored on S3.
Regarding your second question, it really depends on your application needs : at what scale do you expect to run ? How large will be your data store ? What type of query are you going to perform ?
For most cases, DynamoDB will be more cost effective than running a couple of EC2 instances with a Mongo DB cluster. And you will not need to maintain and to operate the infrastructure, AWS will do it for you.
You might have other point of view from this question : DynamoDB vs MongoDB NoSQL
Might be easier to just use MongoHQ: https://bridge.mongohq.com/signup
If you're interested in learning how to set up the servers, digitalocean is a good bet as they don't charge you for the IOPS and give you SSDs on the instance:
http://www.digitalocean.com
Enjoy!