I am trying to customize an existing Debian Jessie HVM AMI(ami-116d857a) and store it as my private AMI. Though the AMI creation process succeeds, I am unable to boot from it. The instance shows started but I am not able to connect via ssh and monitoring also shows ssh connectivity is not available. I see the same issue with any other HVM AMIs. The same procedure works perfectly if it is a PVM AMI.
Here's the procedure I follow
- Boot from an available AMI.
- Install additional packages from package manager.
- Install npm modules.(nodejs and npm have been installed in the previous step)
- Install all available system upgrades.
- Download and unarchive ec2-ami-tools in /opt.
- SCP private key and certificate to the instance.
Create image of the instance using the following command
/opt/ec2-ami-tools-1.5.7/bin/ec2-bundle-vol -c /home/admin/cert.pem -k /home/admin/pk.pem -u $aws_account_id -p $image_prefix -B ami=sda,root=/dev/sda1 --batch --debug
Then upload it to an existing S3 Bucket
/opt/ec2-ami-tools-1.5.7/bin/ec2-upload-bundle -b my-ami-images -m /mnt/$image_prefix.manifest.xml -a $access_key -s $access_secret --retry --de bug
And then finally register the AMI
aws ec2 register-image --name $image_prefix --image-location my-ami-images/$image_prefix.manifest.xml --region us-east-1 --virtualization-type hvm --root-device-name /dev/xvda1
All of these steps go fine without any error and I can see the AMI listed in my account with root device as instance store and virtualization type as HVM.