This feature allows you to use persistent data on Spot Instances across multiple availability zones.
Elastic Block Storage (EBS) provides persistent (and redundant) block level stores for EC2 instances within the same availability zone. As Spot and On-Demand instances come and go, your EBS volumes will allow you to have the flexibility to scale your instances without losing your data.
HOT EBS MIGRATION – How It Works
Every EC2 Spot Instance has a root volume which attached as
/dev/xvda , Other data volumes (that contains application files and data) are attached to the EC2 Instance as
This diagram shows a root volume(blue) as
/dev/xvdaand other volumes(purple) attached as other devices
1. Create or have your EBS Volume ready in the relevant Availability Zone.
Make sure that the volumes are available as shown below
Your EBS Volume should contain a filesystem. If it’s not done already, please create a filesystem and then continue to the next step.
2. Create an Elastigroup Cluster and specify the Volume IDs under the compute tab in the “Hot EBS Migration Section” (press enter to confirm the volumes).
If needed, add the relevant statement to the
/etc/fstabin order to mount the volume automatically at the instance launch.
See It In Action
Now, let’s connect to the instance and look for the relevant device, e.g
That’s great, my instance is up and running, the EBS is attached as
/dev/xvdb and already mounted at
/mnt. I can also see that my previous files are available in that EBS.
Now – In the case of any Spot replacement or a failure, Elastigroup will seamlessly re-attach the EBS volume to a new instance.
This diagram shows what happens when a Spot is being replaced.
1. A new instance is being launched
2. The EBS Volume is being automatically de-registered from the old EC2 Instance
3. The EBS Volume is being automatically attached to the new EC2 Instance and mapped to the previous device name and mount point.
Instance Replacement Process
The Spotinst platform will automatically detect when a Spot interruption is about to occur. A new instance will be launched prior to the interruption allowing time to cleanly detach the EBS volume(s) and re-attach them to the new instance. This process ensures that your EBS volumes are persistent across your entire Elastigroup.
As we mentioned earlier, EBS volumes are only available to be attached to instances within the same availability zone. By using Spotinst, you can now get around this limitation by using our Hot EBS migration feature. If you are already using the Hot EBS Migration feature today, simply modify your Elastigroup by selecting more than one AZ from the Compute tab of your Elastigroup configuration.
The diagram below depicts how the Hot EBS migration works in four steps.
- An Elastigroup in two AZs with two instances in AZ-A is shown with EBS volumes attached.
- A Spot Interruption is detected and a new spot instance is provisioned in AZ-B. The attached EBS volume is cloned into AZ-B prior to Interruption.
- The cloned volume is attached to the new instance in AZ-B.
- The new spot instance automatically attaches to the cloned EBS volume in AZ-B. The instance marked for Spot Interruption in AZ-A is terminated by the Spotinst platform upon verifying that the new volume has been successfully attached.