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

ARM Snapshot overwrite fails when using '-force' #459

Open
pelegor opened this issue Dec 31, 2024 · 0 comments
Open

ARM Snapshot overwrite fails when using '-force' #459

pelegor opened this issue Dec 31, 2024 · 0 comments
Labels

Comments

@pelegor
Copy link

pelegor commented Dec 31, 2024

Overview of the Issue

As described here:
https://developer.hashicorp.com/packer/docs/commands/build#force

The '-force' flag should remove/overwrite the artifacts created by previous builds. When applying it for azure-arm packer build, it is indeed able to overwrite an existing image name, but if ‘managed_image_os_disk_snapshot_name’ & ‘managed_image_data_disk_snapshot_prefix’ are applied, they are not being overwritten and the build fails:

2024-12-30T17:00:29Z: Build 'azure-arm.linux-component' errored after 4 minutes 33 seconds: performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with error: BadRequest: Changing property 'sourceResourceId' is not allowed for existing disk 'testimagename'.

Reproduction Steps

Execute packer build with azure-arm provisioner, while applying 'managed_image_os_disk_snapshot_name' / ‘managed_image_data_disk_snapshot_prefix’, then rerun it using the same values with the '-force' flag.

Plugin and Packer version

Packer v1.10.0
github.com/hashicorp/azure v2.2.0

Simplified Packer Buildfile

https://gist.github.com/pelegor/4461ea8125f98ba0e122fc5cc805d8d7

Operating system and Environment details

Image specs:
["RedHat", "RHEL", "92-gen2", "latest"]

Log Fragments and crash.log files

https://gist.github.com/pelegor/3cf659e27d277c9211aa5120b1a9449f

@pelegor pelegor added the bug label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant