Attach existing root volume to ec2 spot instance

Viewed 638

Is it possible to attach an existing volume to an ec2 spot instance during setup so it can boot from it?

I have only manages to attach ebs volumes as a secondary volume, but I would like to set the boot volume so I can persist changes to the boot volume as well without having to create an image.

2 Answers

No you can't attach existing EBS volumes as root to EC2 Instances while setup. After setup you can attach a volume to that instance. BlockDeviceMapping allows you to specify size or snapshotid, both won't work here, because you requirement is want to attach it as root.

The only way to define a root volume is by using an AMI.

It is possible to swap volumes on a normal instance:

  • Stop the instance
  • Detach the volume
  • Attach the other volume
  • Start the instance

Updated: This is now possible on Spot instances too.

Related