AWS EC2 Spot Instances cancelled before fulfillment - amazon-web-services

I am trying to bring up multiple AWS EC2 Spot instances, machine type "m3.medium" or ""m4.2xlarge" in REGION="eu-west-1".
I am able to bring up On-Demand instances but my spots keep failing. Below is the error. Has anyone seen this before or worked around it?

Related

Timing of route execution/database changes in AWS

I currently have an ec2 instance and an rds instance running in AWS. I wish to know of the times that certain functions/routes/db changes were initiated/activated over the past couple of days. Is there any way to do this?

AWS EC2 instance Network in is occasionally very high

I am running more than 10 EC2 instances on AWS
lately, i noticed that my EC2 instances network in and cpu utilizations are occasionally very high.
I don't run any snapshots, cron jobs or scripts that might effect this. even it happens for instances i created and left them as init status
Anyone knows why it happens ?
this is maximum network in for the last two weeks

Schedule AWS EC2 Spot instance Creation/Termination

Ive been finding my self creating(maintain)/terminating ec2 spot fleet every 12 hours due the application not needing to run full time. I would like the fleet to be created at 8am for example and terminated 8pm. Is this possible?
I can do this with ec2 instances +lambda + cloudwatch: https://aws.amazon.com/premiumsupport/knowledge-center/start-stop-lambda-cloudwatch/
However I cannot seem to figure this out with spot fleet.
You can create an Autoscaling Group with a spot price, then use Scheduled Actions to launch and terminate them at specific times.

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.

AWS: cancel spot instance request within a spot instace

I want to run data analysis using AWS that'll probably take a few days. I've setup a system where spot instances will reload the same EBS volume so it can resume the analysis after a termination. So far I've got it working where I can just generate a persistent spot request and have the analysis keep running and continue after spot instance terminations until it is done.
But I also want the spot instance to cancel the persistent spot instance request when the analysis is finished. Is there anyway to get the request ID from within the spot instance?
The spot instance information is not available from the EC2 metadata. However, the instance ID is.
Get the Instance ID from the EC2 metadata.
Use DescribeInstances (or ec2-describe-instances, or aws ec2 describe-instances to get the instance information for the instance.
Within the instance information is spotInstanceRequestId which is the spot instance request ID you're looking for.