This blog is a continuation of this blog: http://scn.sap.com/community/developer-center/hana/blog/2013/11/11/using-aws-spot-instances-with-sap-cal
Step VI: Spot Instance Termination:
Sport Instance Termination could occur for the following reasons:
i) User-initiated: You are done with your current session and you want to terminate the instance. Go to Step VII.
ii) AWS-initiated: For reasons of price, capacity, or other reasons. Go to Step VIII
Step VII: User-initiated Spot Instance Termination:
Before you terminate the instance, create an image as described in Step II from the Spot Instance. I would name theImage Image after Week X where X is 1-6.
Terminate the AWS Spot Instance.
Go to Step IX.
Step VIII: AWS-initiated Spot Instance Termination:
In this case, we could not save our work in AMI/Snapshots (as in Step VII). EBS volumes associated with the spot instance (that were terminated by AWS) will still be available because we unchecked the Delete on Termination flags as shown in Step II.
AWS-initiated terminations do not occur that often. You may choose to skip this step in the event it does occur, if you don’t care about losing your work.
Create Snapshots one after the other for the four EBS volumes as shown below:
I obtained the /dev/sdxx info from the screenshots we saved in Step IV. Repeat for the other three volumes.
Now the snapshots look as below:
Let us see if we can create an Image using these snapshots.
Now we need 4 characters for the device (sdc1, sdb1, sda1). AWS Console allows only 3 characters. An alternative solution is to use the AWI CLI (Command Line Interface) as described in this blog to create an AMI:http://scn.sap.com/community/developer-center/hana/blog/2013/06/23/preventing-the-deletion-of-ebs-volumes-during-the-termination-of-aws-spot-instances
Step IX: Delete EBS volumes that are no longer needed:
Delete the EBS Volumes that are associated with the spot instance that was just terminated. Otherwise AWS will charge for the EBS volumes.You may also delete the Elastic IPs.
You may keep the previous AMIs (Example: Base Image) and the associated snapshots or you may delete them. The AWS charges will be very minimal for AMIs and snapshots.
When you begin your next session, create a Spot Instance as described in Step IV from the AMI you created in Step VII or Step VIII (Example: Image after Week X). Create and associate an Elastic IP as described in Step V.
You are done 🙂 !!!