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

GalleryImageVersion CLI commands to support BlockDeletionBeforeEndOfLife parameter. #30820

Open
1 task done
anuraganand202 opened this issue Feb 13, 2025 · 5 comments · May be fixed by #31013
Open
1 task done

GalleryImageVersion CLI commands to support BlockDeletionBeforeEndOfLife parameter. #30820

anuraganand202 opened this issue Feb 13, 2025 · 5 comments · May be fixed by #31013
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 feature-request Possible-Solution Similar-Issue

Comments

@anuraganand202
Copy link

Preconditions

  • No need to upgrade Python SDK or the Python SDK is ready.

Related command

CREATE:
az sig image-version create --resource-group MyResourceGroup --gallery-name MyGallery --gallery-image-definition MyImage --gallery-image-version 1.0.0 --virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM --end-of-life-date $endOfLifeDate --block-deletion-before-end-life true

UPDATE:
az sig image-version update --resource-group MyResourceGroup --gallery-name MyGallery --gallery-image-definition MyImage --gallery-image-version 1.0.0 --target-regions westcentralus=2 eastus2 --end-of-life-date $endOfLifeDate --block-deletion-before-end-of-life true

Resource Provider

Microsoft.Compute

Description of Feature or Work Requested

Customers should be able to opt for "BlockDeletionBeforeEndOfLife" feature while creating/updating Azure Compute Gallery images. Once the customer opts for this feature, it prevents their images from any accidental deletions before the EndOfLife of the image expires.

This feature is supported from the API Version - "2024-03-03"

Update required in following CLI cmdlets:

  1. az sig image-version create
  2. az sig image-version update

We need a new boolean in these cmdlets called block-deletion-before-end-of-life. It can be null or set to true/false.

Minimum API Version Required

2024-03-03

Swagger PR link / SDK link

Swagger PR: Azure/azure-rest-api-specs#30505

Request Example

Please find SDK changes here: https://learn.microsoft.com/en-us/rest/api/compute/gallery-image-versions/create-or-update?view=rest-compute-2024-11-04&tabs=HTTP

Sample Request body:
{
"location": "West US",
"properties": {
"publishingProfile": {
"targetRegions": [
{
"name": "West US",
"regionalReplicaCount": 1,
"encryption": {
"osDiskImage": {
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"
},
"dataDiskImages": [
{
"lun": 0,
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"
},
{
"lun": 1,
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"
}
]
},
"excludeFromLatest": false
},
{
"name": "East US",
"regionalReplicaCount": 2,
"storageAccountType": "Standard_ZRS",
"encryption": {
"osDiskImage": {
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"
},
"dataDiskImages": [
{
"lun": 0,
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"
},
{
"lun": 1,
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"
}
]
},
"excludeFromLatest": false
}
]
},
"storageProfile": {
"source": {
"communityGalleryImageId": "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}"
}
},
"safetyProfile": {
"allowDeletionOfReplicatedLocations": false,
"blockDeletionBeforeEndOfLife": false
}
}
}

Sample response:
{
"id": "/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0",
"properties": {
"publishingProfile": {
"targetRegions": [
{
"name": "West US",
"regionalReplicaCount": 1,
"storageAccountType": "Standard_LRS",
"encryption": {
"osDiskImage": {
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"
},
"dataDiskImages": [
{
"lun": 0,
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"
},
{
"lun": 1,
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"
}
]
},
"excludeFromLatest": false
},
{
"name": "East US",
"regionalReplicaCount": 2,
"storageAccountType": "Standard_ZRS",
"encryption": {
"osDiskImage": {
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"
},
"dataDiskImages": [
{
"lun": 0,
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"
},
{
"lun": 1,
"diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"
}
]
},
"excludeFromLatest": false
}
],
"replicaCount": 1,
"publishedDate": "2018-01-01T00:00:00Z",
"storageAccountType": "Standard_LRS"
},
"storageProfile": {
"source": {
"communityGalleryImageId": "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}"
},
"osDiskImage": {
"sizeInGB": 10,
"hostCaching": "ReadOnly"
},
"dataDiskImages": [
{
"lun": 1,
"sizeInGB": 10,
"hostCaching": "None"
}
]
},
"safetyProfile": {
"allowDeletionOfReplicatedLocations": false,
"reportedForPolicyViolation": true,
"policyViolations": [
{
"category": "ImageFlaggedUnsafe",
"details": "This is the policy violation details."
}
],
"blockDeletionBeforeEndOfLife": false
},
"provisioningState": "Updating"
},
"location": "West US",
"name": "1.0.0"
}

Target Date

2025-02-30

PM Contact

saraic

Engineer Contact

anuraganand

Additional context

No response

@microsoft-github-policy-service microsoft-github-policy-service bot added the Compute az vm/vmss/image/disk/snapshot label Feb 13, 2025
@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 Feb 13, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 13, 2025

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

Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Ensure that the feature request includes all necessary information for development by using the feature request template provided by the Azure CLI team. This will help in completing the necessary information for the development of the feature.

Reference:

Powered by issue-sentinel

@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Feb 13, 2025
@yonzhan yonzhan added this to the Backlog milestone Feb 13, 2025
@zhoxing-ms
Copy link
Contributor

@anuraganand202 Since this sprint is already fully scheduled, we plan develop and release it to the next sprint (the release date is 04-01), do you think this release time meets your expectations?

@anuraganand202
Copy link
Author

anuraganand202 commented Feb 13, 2025

@anuraganand202 Since this sprint is already fully scheduled, we plan develop and release it to the next sprint (the release date is 04-01), do you think this release time meets your expectations?

Hi @zhoxing-ms , I raised the first issue in October'23, but it was not reviewed. Can you please prioritize this? We want to onboard customers to this feature ASAP.
Is there a release happening before 04/01?

@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Feb 19, 2025

Is there a release happening before 04/01?

@anuraganand202 Sorry, 04/01 is already the fastest release time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment