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

Regression in v2.59.0 in az sig image-version create with cross-resource group image version creation #28700

Open
maruel opened this issue Apr 5, 2024 · 7 comments
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team Compute az vm/vmss/image/disk/snapshot customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@maruel
Copy link

maruel commented Apr 5, 2024

Describe the bug

@Jing-song I'm getting a new error and I suspect this is due to #28627. The use case is that I create a temporary VM in a temporary resource group (rsc_tmp). I then create an image version in my permanent resource group (rsc_imgs).

Related command

az sig image-version create --resource-group rsc_imgs --gallery-name base_images --gallery-image-definition win11-23h2-pro-x64 --gallery-image-version 2024.04.05 --replication-mode Full --replica-count 1 --managed-image /subscriptions/<guid>/resourceGroups/rsc_tmp/providers/Microsoft.Compute/virtualMachines/vm-win11-x64 --storage-account-type premium_lrs

Errors

Code: InvalidParameter
Message: The gallery image version source id: '/subscriptions/<guid>/resourceGroups/rsc_tmp/providers/Microsoft.Compute/virtualMachines/vm-win11-x64' must be specified in 'galleryImageVersion.properties.storageProfile.source.virtualMachineId'.
Target: galleryImageVersion.properties.storageProfile.source

Issue script & Debug output

N/A

Expected behavior

Used to work in v2.58.0. I confirmed by downgrading from v2.59.0 to v2.58.0 and the command succeeded again.

Environment Summary

azure 2.59.0
macOS

Additional context

No response

@maruel maruel added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Apr 5, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Compute az vm/vmss/image/disk/snapshot labels Apr 5, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 5, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 5, 2024

Thank you for opening this issue, we will look into it.

@maruel maruel changed the title Regression in v2.58.9 in az sig image-version create with cross-resource group image version creation Regression in v2.59.0 in az sig image-version create with cross-resource group image version creation Apr 5, 2024
@yonzhan yonzhan added this to the Backlog milestone Apr 5, 2024
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Apr 5, 2024
@scottlarnach
Copy link

I have also come across this issue today while trying to create a VM image, it was working until I upgraded my CLI version today.

$vmId = az vm get-instance-view -g resourcegroup -n image --query id

az sig image-version create --resource-group resourcegroup --gallery-name gallery --gallery-image-definition definition --gallery-image-version 1.0.0 --managed-image $vmId

Returns:

(InvalidParameter) The gallery image version source id: removed must be specified in 'galleryImageVersion.properties.storageProfile.source.virtualMachineId'.
Code: InvalidParameter
Message: The gallery image version source id: removed must be specified in 'galleryImageVersion.properties.storageProfile.source.virtualMachineId'.
Target: galleryImageVersion.properties.storageProfile.source

@SimbasPride
Copy link

Recently ran into this problem and had to change the --managed-image $vmid parameter to --virtual-machine $vmid this worked for me on 2.59 version of Cli

@maruel
Copy link
Author

maruel commented Apr 10, 2024

Thanks @SimbasPride ! I confirm that using --virtual-machine instead of --managed-image fixed our issue.

It would be helpful to improve the error message.

@jercle
Copy link

jercle commented Apr 11, 2024

This seems to also be causing issues with building images in Packer across subscriptions - hashicorp/packer-plugin-azure#403

Could be more of an issue with an API change within Azure?

@scottlarnach
Copy link

@SimbasPride that did the trick, thanks!

@GABRIELNGBTUC
Copy link

GABRIELNGBTUC commented Apr 18, 2024

Recently ran into this problem and had to change the --managed-image $vmid parameter to --virtual-machine $vmid this worked for me on 2.59 version of Cli

I tried on my side with a VM on another subscription and it unfortunately did not work. So it is only a partial workaround.

EDIT: I was actually on 2.58.0. Updated and this workaround works perfectly.

GabrielNagy added a commit to ubuntu/adsys that referenced this issue Apr 24, 2024
It appears there's been a regression in version 2.59.0 of the Azure CLI,
where az sig image-version create fails when being passed the
--managed-image flag, see the related failing CI run,[1] and the reported
issue on the azure-cli project.[2]

Because of this we are not able to create new versions for any of our VM
templates.

To fix this we can apply the workaround from the linked issue and pass
the VM ID inside the `--virtual-machine` argument.

[1] https://github.com/ubuntu/adsys/actions/runs/8677801641/job/23793927248
[2] Azure/azure-cli#28700
GabrielNagy added a commit to ubuntu/adsys that referenced this issue Apr 24, 2024
It appears there's been a regression in version 2.59.0 of the Azure CLI,
where az sig image-version create fails when being passed the
--managed-image flag, see the related [failing CI
run](https://github.com/ubuntu/adsys/actions/runs/8677801641/job/23793927248
), and the [reported
issue](Azure/azure-cli#28700) on the azure-cli
project.

Because of this we are not able to create new versions for any of our VM
templates.

To fix this we can apply the workaround from the linked issue and pass
the VM ID inside the `--virtual-machine` argument. I've tested this
locally and successfully created a new image version with the change.

Partly fixes UDENG-2528
BillyONeal added a commit to BillyONeal/vcpkg that referenced this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team Compute az vm/vmss/image/disk/snapshot customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

8 participants