Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.46 KB

File metadata and controls

28 lines (22 loc) · 1.46 KB

AWS Specific

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):

  1. Run packer build with --only=vbox4ami
  2. Use VBoxManage clonehd to convert the vmdk to vhd
  3. Upload the vhd image to S3
  4. Run aws ec2 import-image to convert the vhd image to an AMI
  5. Wait for import to complete (aws ec2 describe-import-image-tasks)
  6. Launch an EC2 instance with new AMI
  7. Smoke test

Notes:

  • During packer build several files (grub-related, fstab, etc) are set to use /dev/xvda. aws ec2 import-image however, 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