{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"root_device_name": "/dev/sda1",
"root_volume_size": "10",
"root_volume_type": "gp2",
"root_delete_on_termination": "true",
"data_device_name": "/dev/sdb",
"data_volume_size": "10",
"data_volume_type": "standard",
"data_delete_on_termination": "true"
},
"provisioners": [
],
"builders": [
{
"type": "amazon-instance",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-02eac2c0129f6376b",
"vpc_id": "<vpc_id>",
"ssh_username": "centos",
"instance_type": "t2.micro",
"ami_name": "{timestamp}}",
"account_id": "<account>",
"s3_bucket": "<my_bucket>",
"x509_cert_path": "<cert>",
"x509_key_path": "<key>",
"launch_block_device_mappings": [
{
"device_name": "{{user `root_device_name`}}",
"volume_size": "{{user `root_volume_size`}}",
"volume_type": "{{user `root_volume_type`}}",
"delete_on_termination": "{{user `root_delete_on_termination`}}"
}
],
"ami_block_device_mappings": [
{
"device_name": "{{user `data_device_name`}}",
"volume_size": "{{user `data_volume_size`}}",
"volume_type": "{{user `data_volume_type`}}",
"delete_on_termination": "{{user `data_delete_on_termination`}}"
}
]
}
]
}
And here is the full traceback -
amazon-instance: /mnt/img-mnt
==> amazon-instance: /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/platform/linux/image.rb:793:in `execute': Failed to execute: 'mount -t xfs /dev/mapper/hda1 /mnt/img-mnt' (FatalError)
==> amazon-instance: from /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/platform/linux/image.rb:670:in `mount_image'
==> amazon-instance: from /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/platform/linux/image.rb:174:in `make'
==> amazon-instance: from /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/amitools/bundlevol.rb:184:in `bundle_vol'
==> amazon-instance: from /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/amitools/bundlevol.rb:231:in `main'
==> amazon-instance: from /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/amitools/tool_base.rb:201:in `run'
==> amazon-instance: from /usr/local/ec2/ec2-ami-tools-1.5.7/lib/ec2/amitools/bundlevol.rb:239:in `<main>'
==> amazon-instance: Volume bundling failed. Please see the output above for more
==> amazon-instance: details on what went wrong.
==> amazon-instance:
==> amazon-instance: One common cause for this error is ec2-bundle-vol not being
==> amazon-instance: available on the target instance.