The following have been added to the image (in addition to those listed in README.md):
- Cloud-Init is installed
- The user ec2-user will be added with passwordless sudo and authorized_keys based on the AWS keypair configured at launch time
- If a drive is attached to /dev/sdb it will be mounted as /mnt/ephemeral0
- Root password is locked
Steps to build an AMI (see misc/build_ami for an example script):
- Run
packer buildwith--only=vbox4ami - Use
VBoxManage clonehdto convert the vmdk to vhd - Upload the vhd image to S3
- Run
aws ec2 import-imageto convert the vhd image to an AMI - Wait for import to complete (
aws ec2 describe-import-image-tasks) - Launch an EC2 instance with new AMI
- Smoke test
Notes:
- During
packer buildseveral files (grub-related, fstab, etc) are set to use /dev/xvda.aws ec2 import-imagehowever, modifies /boot/menu.lst and /etc/fstab to use the UUIDs of the partitions on the device. - The newly created AMI will be named something like import-image-adf213 and most likely not have the desired configuration. A new AMI can be created by identifying the snapshot used and then creating an AMI based on that snapshot. Some common settings:
- Default kernel and ramdisk
- HVM
- Root device: /dev/xvda, delete on termination set to true
- Adding instance store 0 as /dev/sdb