You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: