Amazon Instance Got Terminated frequently - amazon-web-services

We have basic plan Amazon configuration. Also we have created Windows instance which is terminated frequently and new Ip address is assigned. I don't know how to check and why its terminated frequently.

Under standard conditions, Amazon EC2 instances are never terminated on their own. You may be accidentally using EC2 Spot instances which works on a bidding model. AWS has the power to terminate these instances with a warning time of ~2 minutes if there is a a higher bid for the spot instance.
If your instances get terminated immediately after you launch, refer this page: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html
For more information on EC2 spot instances, refer this page:
http://aws.amazon.com/ec2/purchasing-options/spot-instances/

Related

ec2 error starting instances insufficient capacity

We have created AWS EC2 instance on Asia it Pacific(Mumbai) Zone on Shared Hardware rental type.We are trying to start an instance after shut it down we are getting popup ec2 error starting instances insufficient capacity message on screen.On white papers it is mention like this,Try to launch new ec2 instance but as we have in basic plan it is now allowing to create new instance on another zone.
How to resolve this issue.
According to the documentation, getting an InsufficientInstanceCapacity error when launching or restarting an instance means that Amazon does not have enough capacity to serve your request. There are a few options:
Waiting for a while and trying again
Launching an instance without specifying an availability zone
Changing the instance type
You can read more here.
Below are a few options available
Wait for that instance type to become available.
Launch a different instance type.
Launch an instance in a different availability zone and migrate back at a later time, if necessary. This provides a temporary solution until you can replace it at a later time with one in the desired availability zone. However, you will be charged cross-zone data transfer costs.
Launch an instance in the -Any- availability zone
Purchase a reserved instance (for that instance type) in the desired availability zone. This will also prevent you from receiving this error in the future.
This is usually caused by
AWS not having enough available On-Demand capacity to complete your request.
For troubleshooting steps, see [1].
If the preceding troubleshooting steps don't resolve the problem, then you can move the instance to another VPC or to another subnet and Availability Zone[2].
Tip :
To avoid insufficient capacity errors on critical machines, consider using
On-Demand Capacity Reservations[3].
To use an On-Demand Capacity Reservation, do the following :
1. Create the Capacity Reservation[4] in an Availability Zone.
2. Launch critical instances into your Capacity Reservation[5].
Reference :
[1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshooting-launch.html#troubleshooting-launch-capacity
[2] https://aws.amazon.com/premiumsupport/knowledge-center/move-ec2-instance/
[3] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html
[4] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-create
[5] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-launch
If you are new to AWS, there's usually a limit for how many instances can you launch or start even if you are currently running none. Try to request for a limit increase for the instance you want to launch in the support center and the insufficient capacity error will disappear

EC2 Spot Instance capacity pool

I understand that spot instances are terminated if the bid price is exceeded, and that they can't launch if there is no capacity to do so or the instance limit is reached. I've not seen them terminated due to over-subscription before. Used AWS CLI:
aws ec2 request-spot-instances --spot-price "0.8" --instance-count 1 --type "one-time" --launch-specification c:\path\to\spot-instance-spec.json
The r4.4xlarge linux spot launched successfully in (my) eu-west-1b, then terminated and the status in the spot request is:
instance-terminated-capacity-oversubscribed: Your Spot instance was terminated as there is no more unused capacity available in this pool.
Does anyone know what this means specifically? Is a pool just the AZ? Is it down to more expensive spots? Is it due to on-demands being launched?
The AWS documentation now has a definition of Spot instance pool:
Spot Instance pool – A set of unused EC2 instances with the same instance type, operating system, Availability Zone, and network platform.
Source: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html
Your Spot Instances continue to run as long as your maximum price is
at or above the Spot price, there is available capacity for your
instance type, and you don't terminate the instance. If a change in
the Spot price or available capacity requires Amazon EC2 to terminate
your Spot Instances, the Spot request goes into a terminal state. For
example, if your price equals the Spot price but Spot Instances are
not available, the status code is
instance-terminated-capacity-oversubscribed. A request also goes into
the terminal state if you cancel the Spot request or terminate the
Spot Instances.
Its mentioned here in AWS Doc, and also check for limitation of spot request.For some instance there is a limit beyond that it cant be launched.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html

AWS - EC2 stop instances not working properly

I'm very new on AWS and now I have two EC2 instances. In order to avoid waste the free tier plan I'm trying to stop instances when I'm not working with them.
This is what my EC2 Management console shows. As you can see there are two instances running and two instances terminated. I did not terminate swipe-dev, I have just stop it. But for any reason now is terminated plus new same instance with same source code was started. Why?
What I'm doing wrong? I just want stop instances.
Edit
I have decide keep just one project so I terminate eb-flask-demo-dev and stop swipe-dev instance. After few minutes instace state was stoped and I thought finally everything is fine. But I rejoin to EC2 console and this is what it shows.
Why swipe-dev is running again? and Why there is another terminated instance?
This is possible if your instance is a member of an Autoscaling group with desired capacity = 1 and set minimum size to 0. To maintain the number of healthy instances, Auto Scaling performs a periodic health check on running instances within an Auto Scaling group. When it finds that an instance is unhealthy (in this case because you stopped it), it terminates that instance and launches a new one.

AWS terminated instance refuses to stay terminated

I have 2 EC2 Micro instances. I've stopped one of it several times and terminated it several times as well. But, for some reason it boots itself back up again.
Not sure how or why this happens, but I'm being billed 10$ every month because of this. Is there some hidden AWS setting where it says start every terminated Instance?
All Google/aws results/doc's speaks about -- Terminated instance will automatically get removed after 10-20min's. but, in my case -- it automatically gets started.
Any help, pointers would be great.
You are using some process that will auto launch instances if the previous ones were terminated.
This is often done with an autoscaling group that may have been created with elastic beanstalk.
Found the answer here
It seems like you have been using Elastic Beanstalk. If you open up that section of the AWS Management Console, you can delete the application/environment from there. This will bring down the instance as well. When you terminate the Elastic Beanstalk instance manually through the EC2 section, the system thinks that it has failed and will launch a replacement.

How to delete instance in EC2?

How can I delete instance in Amazon EC2. I have terminated the instance but still it was showing in instance list table. I want to know few things related to this
1: Is there any significant difference b/w Delete and Terminate?
2: what is the use of terminated instance?
3: what are the cases at which instance gets terminated?
Terminating your instance is essentially deleting it, it will take some time to get reflected on your dashboard (meaning it won't appear on your instance list table)
There is no use of terminated instances.
Once you terminated your instances, it means you have completely lost that particular instance.
But if, during the time of creation of your instance, you had enabled the option called Protect against accidental termination, then you will not be able to terminate without disabling this option.
But in your instance table if the Instance State column has the value terminated it means your instance is deleted and you can no longer use it.
The only thing you can do is terminating an instance. It stops everything.
After you terminate an instance, it remains visible in the console for a short while, and then the entry is automatically deleted.
You cannot delete the terminated instance entry yourself.
More info here http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html
Shuts down one or more instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.
Terminated instances remain visible after termination (approximately one hour).
Note
By default, Amazon EC2 deletes the Amazon EBS root device volume at instance termination. Additional volumes that were attached when the instance launched and any volumes that were attached after instance launch persist. For more information, see Preserving Amazon EBS Volumes on Instance Termination in the Amazon EC2 User Guide for Linux Instances.