enableAutomaticOSUpgrade on existing VMSS

Cathleen Kong (SHE/HER) 0 Reputation points
2023-06-12T16:12:32.4633333+00:00

I am following the steps on this page to apply automatic OS upgrades to my virtual machine scale set: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-upgrade

We are doing this for our test environment Service Fabric cluster, and our durability level is Bronze. We deployed with this upgrade policy in our ARM template:

"upgradePolicy": {
          "mode": "Automatic",
          "rollingUpgradePolicy": {
            "maxBatchInstancePercent": 20,
            "maxUnhealthyInstancePercent": 20,
            "maxUnhealthyUpgradedInstancePercent": 20,
            "pauseTimeBetweenBatches": "PT0S"
          },
          "automaticOSUpgradePolicy": {
            "enableAutomaticOSUpgrade": true,
            "disableAutomaticRollback": false
          }
        }

But while deploying, we saw this error:

New-AzResourceGroupDeployment : 3:59:40 PM - The deployment 'serviceFabricArmTemplate' failed with error(s). Showing 1
out of 1 error(s).
Status Message: Automatic OS Upgrade is not supported for this Virtual Machine Scale Set because a health probe is not
applied to all instances. Apply the health probe to all instances in the Virtual Machine Scale Set while property
'upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade' is false and then update property
'upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade' to true. (Code:BadRequest)
CorrelationId: 67ac9434-dcc9-46ab-b074-6ed1bc6410b3

So, I applied a health probe, set enableAutomaticOSUpgrade to false, and re-deployed. That deployment succeeded. Following the directions from the error message above, I changed enableAutomaticOSUpgrade back to true. However, when deploying again I saw this error:

New-AzResourceGroupDeployment : 4:07:57 PM - The deployment 'serviceFabricArmTemplate' failed with error(s). Showing 1
out of 1 error(s).
Status Message: Service Fabric and Virtual Machine Scale Set have mismatch in value of
'upgradePolicy.automaticOSUpgradePolicy'.  Virtual Machine Scale Sets should have 'False' set as the value of
'upgradePolicy.automaticOSUpgradePolicy'.  (Code:OperationNotAllowed)
CorrelationId: 8d904f91-91b6-4589-a028-8510d0542352

Do I need to stop the VMSS first, then re-deploy for this change to go into effect?

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.
448 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 38,021 Reputation points Microsoft Employee Moderator
    2023-06-13T16:59:55.9366667+00:00

    @Cathleen Kong (SHE/HER)

    I believe the issue is due to Service Fabric being Bronze tier. You can see the requirements for Service Fabric here.

    • Service Fabric durability level is Silver or Gold. If Service Fabric durability is Bronze, only Stateless-only node types support automatic OS image upgrades).
    • The Service Fabric extension on the scale set model definition must have TypeHandlerVersion 1.1 or above.
    • Durability level should be the same at the Service Fabric cluster and Service Fabric extension on the scale set model definition.
    • An additional health probe or use of application health extension is not required for Silver or Gold durability. Bronze durability with Stateless-only node types requires an additional health probe.
    • The property virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates property must set to false in the scale set model definition. The enableAutomaticUpdates property enables in-VM patching using "Windows Update" and is not supported on Service Fabric scale sets.

    Ensure that durability settings are not mismatched on the Service Fabric cluster and Service Fabric extension, as a mismatch will result in upgrade errors. Durability levels can be modified per the guidelines outlined on this page.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments

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.