Open FlorinAndrei opened 10 years ago
I've got the same issue.
Did you ever find a work-around for this?
The default configuration points to an AMI that will spawn an instance using instance-store, and you're correct that an EBS backed instance can be halted.
The root device type is controlled by the AMI you're using. I use vagrant to provision instances which are then turned into custom AMIs for use in production autoscaling groups. For that I use the default Amazon Ubuntu 12.04 AMI (ami-59a4a230) as a base, which is paravirtual and EBS backed, but really you can use any AMI that meets your needs.
Thank you @markrebec.
I figured out that I can do vagrant destroy
with this instance-store AMI, I just can't do a vagrant halt
. Amazon apparently destroys the entire instance when it powers down. Since vagrant halt
is designed to be non-destructive, I now think it is a good thing that vagrant halt
raises an error in this case.
This configuration works for me:
aws.block_device_mapping = [ { :DeviceName => "/dev/sda1", 'Ebs.VolumeSize' => DISK_SIZE } ]
I've launched an instance using the example on the front page and did some tests. 'vagrant halt' failed with:
~/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/expects.rb:6:in `response_call': UnsupportedOperation => The instance 'i-b2acfb92' does not have an 'ebs' root device type and cannot be stopped. (Fog::Compute::AWS::Error)
Looking at the instance, indeed, the root device type is instance-store. I assume if the root device type was ebs, then halt would work?