On Fri, Oct 13, 2017 at 05:49:48AM -0700, Noah Meyerhans wrote:

:$ aws ec2 run-instances --image-id ami-foo \
:      --user-data file://ec2-userdata.yaml
:
:Where the ec2-userdata.yaml contains configuration for cloud-init
:telling it how to set up and run FAI and ami-foo is the current public
:stretch AMI on AWS. The resulting VM is completely disposable. Any
:desired state, from logs to the entire disk image, can be preserved if
:desired.
:
:It should be straightforward to port this to other cloud platforms.

If all your provisioning needs can be expressed in cloud-init userdata
(which you can do a lot with) this is a most elegant solution and
basicly what I use to providion my production work loads on OpenStack
and AWS so I can verify at least those two targets will take the exact
userdata file happily.

Packer (https://www.packer.io/) is a multitarget / multi provisioner
system.  I use this to customize distro cloud images to our local
"base" state using ansible as the provisioning agent can buld multiple
cloud targets from one config.  If as a distro you are looking to
build a very thin config this is probably overkill (and may be over
kill in my case too...).

Only practial advantages I can say for Packer -v- usedata are it fails
if your provisioning errors, it creates teh image artifacte (snapshot,
ami, whatever), and cleans up ephemeral VM at the end.  My previous
image builds never seemed to have enough error checking , I'm not
expressly familiar with Debian build error checks.  It does snapshot
(or what ever the target calls it) to create and image object and tare
down the disposable VM it creates in process. Certainly all of these
could be handled in user-data.

-Jon


Attachment: signature.asc
Description: PGP signature

Reply via email to