Packer: MissingParameter ebs error when using ami_block_device_mappings with volume_type

Created on 11 Aug 2016  路  3Comments  路  Source: hashicorp/packer

Greetings!

When using ami_block_device_mappings or launch_block_device_mappings and a volume_type of gp2/io1 I get a MissingParameter ... ebs error during packer build. Omitting the volume_type allows the AMI to be built, but we want to use specific volume types.

The error:

$ packer build example_gold.json
amazon-ebs output will be in this color.

==> amazon-ebs: Prevalidating AMI Name...
==> amazon-ebs: Inspecting the source AMI...
==> amazon-ebs: Creating temporary security group for this instance...
==> amazon-ebs: Authorizing access to port 22 the temporary security group...
==> amazon-ebs: Launching a source AWS instance...
==> amazon-ebs: Error launching source instance: MissingParameter: The request must contain the parameter ebs
==> amazon-ebs:     status code: 400, request id:
==> amazon-ebs: No AMIs to cleanup
==> amazon-ebs: Deleting temporary security group...
Build 'amazon-ebs' errored: Error launching source instance: MissingParameter: The request must contain the parameter ebs
    status code: 400, request id:

==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: Error launching source instance: MissingParameter: The request must contain the parameter ebs
    status code: 400, request id:

==> Builds finished but no artifacts were created.

I think the intent with this template is to build an instance with 24gb / on gp storage, but launch then as io2:250iops later on. I don't think ami_block_device_mappings has any effect in this scenario.

There were more block devices defined, but during the course of my troubleshooting I found that I could reproduce the issue with only one block device.

Are ami_block_device_mappings and launch_block_device_mappings sections being used improperly?

Unfortunately I do have to report that packer_0.8.6 and 0.9.0 do not behave the same way; these versions successfully build the ami.

$ ~/Downloads/packer_0.8.6_darwin_amd64/packer build example_gold.json
amazon-ebs output will be in this color.

==> amazon-ebs: Prevalidating AMI Name...
==> amazon-ebs: Inspecting the source AMI...
==> amazon-ebs: Creating temporary security group for this instance...
==> amazon-ebs: Authorizing access to port 22 the temporary security group...
==> amazon-ebs: Launching a source AWS instance...
    amazon-ebs: Instance ID: i-666
==> amazon-ebs: Waiting for instance (i-666) to become ready...

Thanks very much

buildeamazon question

Most helpful comment

removing virtual_name gets rid of my problem. Thanks!

All 3 comments

@PartyImp I think the error comes from using the virtual_name configuration in the launch_block_device_mappings block. As the Virtual Name configuration refer only to epheremal storage in Amazon, setting the virtual_name configuration to something that is not ephemeralN will cause the builder to not pick up the storage configuration as "ephemeral" and also skip the entire EBS Volume configuration.

Hence, you get an error that the ebs configurations are not passed through.

removing virtual_name gets rid of my problem. Thanks!

This was very helpful. Thank you. I took "ephemeral1", "ephemeral2" to be suggestions rather than conventions.

Was this page helpful?
0 / 5 - 0 ratings