I am using Ansible 2.1.3.0 at the moment and I am trying to figure out how to make an instance-store AMI using the ec2_ami module.
It looks like it is not possible to do this if the instance has instance-store root - I am getting the Instance does not have a volume attached at root (null)"
no matter what I do.
So I am wondering how could I make an intance-store AMI (using the ec2_ami module) from an EBS-backed instance? The documentation does not allow me to map the first volume to be ami
, and second needs to be ephemeral0
. I was going through the ec2_ami module source code and it seems like it has no support for this but I may have overlooked something...
When I do curl http://169.254.169.254/latest/meta-data/block-device-mapping/
on the source EC2 instance, I am getting the following:
ami
ephemeral0
I'm on 2.2 and using
ec2
rather thanec2_ami
, but this would accomplish what you're looking for...Pay special attention to the
instance_initiated_shutdown_behavior
param as the default isstop
, which is incompatible with instance-store based systems, you'll need to set it toterminate
to work.