Create an EBS EMI

To create a new EMI that is used to boot EBS-backed instances:
  1. Create a new volume whose size matches the size of the bootable .img file:
    euca-create-volume -z <cluster_name> -s <size_GB>
  2. Attach the volume to a helper instance:
    euca-attach-volume vol-<nnnnnnnn> -i i-<nnnnnnnn> -d <device>
  3. Log in to the instance and copy the bootable image from its source to the helper instance.

  4. While logged in to the helper instance, copy a bootable image to the attached volume:
    dd if=/<path_to_image> of=<device> bs=1M
  5. While logged in to the helper instance, flush the file system buffers after running the dd command:
  6. Detach the volume from the instance:
    euca-detach-volume vol-<nnnnnnnn>
  7. Create a snapshot of the bootable volume:
    euca-create-snapshot vol-<nnnnnnnn>
  8. Register the bootable volume as a new EMI:
    euca-register --name "<descriptive_name>" /
       --snapshot snap-<nnnnnnnn>
  9. Run a new EBS-backed instance:
    euca-run-instances -k <key_name> emi-<nnnnnnnn>
Note: The snapshot cannot be deleted unless the EMI is first deregistered.