Skip to content
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

Add support for excluding data disks from the resulting image #141

Open
Jalle19 opened this issue Dec 3, 2024 · 0 comments · May be fixed by #142
Open

Add support for excluding data disks from the resulting image #141

Jalle19 opened this issue Dec 3, 2024 · 0 comments · May be fixed by #142

Comments

@Jalle19
Copy link

Jalle19 commented Dec 3, 2024

The code contains this:

// TODO: We should allow user to specify which data disk should be
// included into created image.
var dataDiskIds []*string
for _, disk := range instance.DataDisks {
	dataDiskIds = append(dataDiskIds, disk.DiskId)
}
if len(dataDiskIds) > 0 {
	req.DataDiskIds = dataDiskIds
}

Currently if you include a data_disk block, you won't be able to sync the resulting image to other regions:

code:InvalidParameter.InstanceImageNotSupport message:Instance image `img-pf0wpk45` not support action `SyncImages`

As a comparison, the Packer amazon-ebs plugin supports the following option:

no_device (bool) - Suppresses the specified device included in the block device mapping of the AMI.

This excludes the specified launch mapping from the created image.

Jalle19 added a commit to Jalle19/packer-plugin-tencentcloud that referenced this issue Dec 3, 2024
Since there is no way to correlate the disk IDs we get back from the DescribeInstances with the data disk definitions we have in our template, we can't selectively exclude data disks from the image. But at least this is better than nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant