How to modify the same image version at the same time without affecting each other?

little 0 Reputation points
2025-01-22T07:18:43.2366667+00:00

There is a scenario where different requests make changes to the target region of the same image version at the same time to achieve their own image replication, how can this be achieved and the replication does not affect each other? Does this Rest API support etag?https://learn.microsoft.com/en-us/rest/api/compute/gallery-image-versions/update?view=rest-compute-2024-11-04&tabs=HTTP#additionalreplicaset

For example, if request A and B both read the same image version information, and then request A wants to update the target region to westus while request B wants to update the target region to eastus, how can their changes not be overwritten by each other?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,283 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Markapuram Sudheer Reddy 345 Reputation points Microsoft Vendor
    2025-01-22T17:51:04.0333333+00:00

    Hi little ,

    Thank You for reaching out to Microsoft Q&A forum.

    Once Image is created, it is immutable which means you cannot modify the actual content of an image. However you can update certain properties of image version. Certain properties of image version you can modify are:Image Version;

    • Regional replica count
    • Target regions
    • Exclude from latest
    • End of life date

    However, these updates/modifications cannot change actual content of the image; they only modify metadata or replication settings.

    One of the feature of Azure Compute Gallery is Global replication which means replicating image across multiple target regions.

    For an existing image, to replicate your image across multiple target regions, use a same source image and add a parameter called "--add publishingProfile.targetRegions name=<region>" for below Azure CLI command.

    az sig image-version update \
    --resource-group <your resource Group> \
    --gallery-name <name of the gallery> \
    --gallery-image-definition <ImageDefinition> \
    --gallery-image-version <image version> \
    --add publishingProfile.targetRegions name=<region>
    
    
    
    

    Note: Use the flag -expand ReplicationStatus to check if the replication process to all the specified target regions has finished.

    Please follow below documentation for more detailed information;

    https://learn.microsoft.com/en-us/azure/virtual-machines/update-image-resources?tabs=cli%2Ccli2%2Ccli4

    https://learn.microsoft.com/en-us/azure/virtual-machines/shared-image-galleries?tabs=vmsource%2Cazure-cli

    https://learn.microsoft.com/en-us/azure/virtual-machines/shared-image-galleries?tabs=vmsource%2Cazure-cli#can-i-replicate-my-image-versions-across-subscriptions

    https://learn.microsoft.com/en-us/azure/virtual-machines/troubleshooting-shared-images#replication-speed

    If the information is helpful, please click on "Accept the Answer" & "Upvote"

    If you have any queries, please let us know, we will help you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.