[Compute] az vm update / az sig image-version update: Support update vm/image-version even it uses a cross tenant image#15575
Conversation
…vm/image-version even it use a cross tenant image
Collaborator
|
Compute |
qwordy
approved these changes
Oct 20, 2020
qwordy
reviewed
Oct 20, 2020
| else get_vm(cmd, resource_group_name, vm_name) | ||
|
|
||
|
|
||
| def get_vm_for_generic_update(cmd, resource_group_name, vm_name): |
Member
There was a problem hiding this comment.
Maybe you can add some comments like PR description here.
Member
|
line too long error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR is to fix #15536
Previously, the user can't update a vm/image-version if the vm/image-version uses a cross tenant image which he/she has no permission to access.
The root cause is that CLI use the create_or_update API to in
updatecommand to support generic update. The service will check all the properties in the request body even the property value is not changed.To fix this, we need to set the
storage_profile.image_reference/storage_profile.sourceto None in the request body if the user is not updating the image property itself.There is a similar PR #14992 which created by @qwordy .
Testing Guide
Prepare a image, assume its id is <IMGAGE_ID>, and in <subscription_1>
update vm
az account set -s <subscription_2>az vm create -g <rg> -n <vm_name> --image <IMAGE_ID>az vm update -g <rg> -n <vm_name> hardwareProfile.vmSize=Standard_B2History Notes
[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.