I am trying to bake an AWS AMI using amazon-ebs builder. In the template, I have below inside the builders to have a root volume of 20GB, when an EC2 is launched using the AMI.
"ami_block_device_mappings": [
{
"device_name": "/dev/sda1",
"delete_on_termination": "true",
"volume_size": 20,
"volume_type": "standard"
}
]
The packer build goes fine and ami gets created. However when I launch an EC2 using that AMI, I notice that the root volume attached to the instance is of type gp2, even though the type is mentioned as standard in the template.
I have tried to do the packer build in debug mode, but it does not display much information about the volume.
Any pointers is much appreciated.
Please supply the information requested in the issue template:
@prithulagta The problem is that you get similar to below snapshot mapping in AMI metadata when you use /dev/sda1 as device name:
Block Devices:
/dev/xvda=snap-097cab9b0d08a9575:8:true:gp2, /dev/sda1=:20:true:standard
Try to use /dev/xvda as device name and it should work fine:
Block Devices:
/dev/xvda=snap-0f559c7607c2b5e9f:20:true:standard
This doc http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html
can be useful.
PS: This is not a packer problem but rather the way how Amazon handles your request.
I think @Constantin007 has the solution. If this doesn't help, please open a new issue with the required debugging information.
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
@prithulagta The problem is that you get similar to below snapshot mapping in AMI metadata when you use /dev/sda1 as device name:
Try to use /dev/xvda as device name and it should work fine:
This doc http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html
can be useful.
PS: This is not a packer problem but rather the way how Amazon handles your request.