-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Compute] az vm/vmss create: Support creating VM/VMSS from community gallery image and add community gallery legal agreement acceptance
#21843
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
Conversation
|
Compute |
@kangsun-ctrl I don't find any code related to
|
|
@kangsun-ctrl By the way, since the community gallery image related commands are still in |
e439df8 to
340bd61
Compare
az vm create: Add community gallery legal agreement acceptanceaz vm/vmss create: Support creating VM/VMSS from community gallery image and add community gallery legal agreement acceptance
53451c6 to
263c9cb
Compare
…m/zhoxing-ms/azure-cli into community_gallery_legal_agreement
| image_info = re.search(r'^/CommunityGalleries/([^/]*)/Images/([^/]*)/Versions/.*$', image_reference, re.IGNORECASE) | ||
| if not image_info or len(image_info.groups()) < 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not check image version ?
| image_info = re.search(r'^/CommunityGalleries/([^/]*)/Images/([^/]*)/Versions/.*$', image_reference, re.IGNORECASE) | |
| if not image_info or len(image_info.groups()) < 2: | |
| image_info = re.search(r'^/CommunityGalleries/([^/]*)/Images/([^/]*)/Versions/(.*)$', image_reference, re.IGNORECASE) | |
| if not image_info or len(image_info.groups()) < 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At present, we need to parse the public_gallery_name and gallery_image_name from community gallery image id to query the community gallery image info, but version is not used for the time being, so we do not further match version.
azure-cli/src/azure-cli/azure/cli/command_modules/vm/_validators.py
Lines 565 to 570 in ddb1665
| from ._vm_utils import parse_community_gallery_image_id | |
| image_info = parse_community_gallery_image_id(namespace.image) | |
| from ._client_factory import cf_community_gallery_image | |
| community_gallery_image_info = cf_community_gallery_image(cmd.cli_ctx).get( | |
| location=namespace.location, public_gallery_name=image_info[0], gallery_image_name=image_info[1]) |
I think we can add version matching when we need to parse the version. What do you think?
Co-authored-by: ZelinWang <[email protected]>
Feature request: #21815
Description
--os-typeis correct when creating VM from community gallery image or shared gallery imageTesting Guide
History Notes
[Compute]
az vm/vmss create: Support creating VM/VMSS from community gallery image[Compute]
az vm/vmss create: Add community gallery legal agreement acceptance[Compute]
az vm/vmss create: Add the verification of whether--os-typeis correct when creating VM from community gallery image or shared gallery imageThis 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.
I adhere to the Error Handling Guidelines.