-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow AMI block device mapping to be created without snapshot #5290
Comments
Maybe I'm misunderstanding your use case -- does |
No, it doesn't. It sets the flag on the attachment, but doesn't change the snapshot ID associated with it. As a hack, I tried to create a temporary attachment to "launch_block_device_mappings": [{
"device_name": "/dev/sda1",
"delete_on_termination": true,
"encrypted": false,
"volume_size": "100",
"volume_type": "gp2"
},
{
"device_name": "/dev/sdf",
"delete_on_termination": true,
"encrypted": false,
"volume_size": "100",
"volume_type": "gp2"
}],
"ami_block_device_mappings": [{
"device_name": "/dev/sda1",
"delete_on_termination": true,
"encrypted": false,
"volume_size": "100",
"volume_type": "gp2"
},
{
"device_name": "/dev/sdb",
"delete_on_termination": false,
"encrypted": true,
"volume_size": "1000",
"volume_type": "gp2"
}]
}] This created the |
This confused me as well because the docs state (emphasis mine):
I'm not sure I understand what that emphasised comment means if the launch volumes are associated with the snapshot? In my case I want to create an AMI that has some application data stored on a separate EBS volume and is bootstrapped when the application is installed. I want to discard this application data and then I will use Terraform to attach the persistent volume to a new instance in its place. Either a user data script or a Terraform remote provisioner would then execute a |
I have got a wired issue recently, a ghost ephemeral device is getting attached, even though it was not created with launch_block_device_mappings and launch_block_device_mappings when launching via terraform. "ebs_block_device.4241468425.device_name": "xvdco", My block device mapping is below - "launch_block_device_mappings": [ |
What is the status of this? I'm trying to build a custom AMI built off a source AMI that has a 2nd EBS volume that does not use/require a snapshot but when Packer builds my custom AMI following the template the 2nd EBS volume now has a snapshot that I can't seem to get rid of. |
This issue has been automatically migrated to hashicorp/packer-plugin-amazon#19 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-amazon#19. |
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. |
I have a use case where I have two
launch_block_device_mappings
,/dev/sda1
(root device) and/dev/sdb
(data device). The data device exists during the build phase to satisfy some build-time prerequisites, but the actual volume content can be discarded at the the end of the build. The device can also be quite small.Meanwhile, there are two
ami_block_device_mappings
of the same device names,/dev/sda1
and/dev/sdb
. I'd like/dev/sdb
NOT to be associated with a snapshot, since at launch time the instance should have a fresh volume. But Packer seems to always associate it with a snapshot because the device was mapped at launch time. Settingsnapshot_id
to""
seems to have no effect.The text was updated successfully, but these errors were encountered: