Unable to upgrade vmss flex os image

Michał Smereczyński 10 Reputation points MVP
2024-09-22T12:29:30.8466667+00:00

I'm creating VMSS with Flexible orchestration using custom image from Azure Compute Gallery. It is WindowsServer-2022-based image. It is a Generalized image. I'm creating VMSS with a specific version of the image (/subscriptions/{sub_id}/resourceGroups/rg-vmss-dev/providers/Microsoft.Compute/galleries/{gallery_name}/images/vmss-dev/versions/1.0.1). Next, I'm changing imageReference.id property in VMSS model to another version (/subscriptions/{sub_id}/resourceGroups/rg-vmss-dev/providers/Microsoft.Compute/galleries/{gallery_name}/images/vmss-dev/versions/1.0.2). When trying to upgrade the VMSS instance (no matter which one) I'm receiving an error:

'Failed to upgrade virtual machine instance vmss-dev_0256ca57. Error: Changing property 'imageReference.id' is not allowed.'

The same situation is with a platform image (Windows Server from Microsoft publisher). Does it mean that it is not possible to upgrade OS changing imageReference or imageReference.id in Flexible VMSS model, even if documentation is not informing about that?

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
392 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Michał Smereczyński 10 Reputation points MVP
    2024-09-23T09:50:21.73+00:00

    Microsoft Support clarified the situation. I will leave it here for others, searching for it.

    Thank you for reaching out with your question regarding the upgrade of OS by changing the imageReference.id in the VMSS model.   We do support imageReference.id updates; however, we currently do not have the ability to upgrade existing instances to the new image. There is no ETA for this feature at the moment. For now, only new VMSS instances will use the new image, and the existing instances will need to be manually removed or scaled in/out.

    There is no single word about this situation in Azure docs. Not nice...

    2 people found this answer helpful.
    0 comments No comments

  2. Akshay kumar Mandha 390 Reputation points Microsoft Vendor
    2024-09-23T15:20:41.5+00:00

    Hi Michał Smereczyński,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    As I understand your concern like you want update or change the version but unfortunately, you cannot update or change the image reference for existing instances is due to a limitation in Azure’s design for VMSS. Once a VMSS is created with a specific image version, it locks that image reference for the instances. This ensures consistency and stability across all instances in the scale set, but it does mean you can’t upgrade the OS by simply changing the image reference.

    To manage your workloads, you’ll need to create a new VMSS that references the updated image. After that, you can migrate your workloads from the old VMSS to the new one.

    If you found helpful, Could you please click an accepting the answer and "Upvote" on my post to help increase visibility of this question for other members will get to know about this information in the Microsoft Q&A community. User's image


  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

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.