Hi all,
I have an existing manual process for creating an AMI from an EBS volume snapshot (note this is not creating an ami from an existing ec2 instance), which ultimately involves ec2-register (or ec2reg) from the AWS cli. For example:
$ ec2reg -a x86_64 -b '/dev/sda1=snap-xxxxx,28:true:gp2' -n amiName -d 'Description' --root-device=/dev/sda1 --virtualization-type hvm --region us-west-2
I’ve now automated most of this in an Ansible playbook, including creating and writing the volume with the raw disk image created locally. While the ‘ec2_ami’ module in 2.0 now supports the device_mapping property I don’t see the ability to specify the architecture or virtualization type. It looks like the boto API would support this with the ec2.register_image() method. Would this be a worthwhile extension to the ec2_ami module (or has anyone already done this?)
Failing that, I suppose the alternative would be running ‘ec2reg’ locally in the context of the command module:
-name: AMI |Register AMI command:/opt/aws/bin/ec2reg-O <AWS key> -W <AWS secretkey> -n amiName -d 'Description' --root-device=/dev/sda1 --virtualization-type hvm --region us-west-2
Anything else I might be missing?
Thanks in advance!
Chris