Unexpected behavior applying instance protection to scale sets #30708
Labels
Auto-Assign
Auto assign by bot
Auto-Resolve
Auto resolve by bot
Azure CLI Team
The command of the issue is owned by Azure CLI team
Compute
az vm/vmss/image/disk/snapshot
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Describe the bug
When applying instance protection to a scale set instance via the Azure portal, the behavior is as expected.
Upon reviewing the instance changes, it is noted that only the etag and protectionPolicy were modified.
However, when executing the recommended Azure CLI command:
az vmss update --resource-group --name --instance-id --protect-from-scale-in true
Additional changes are observed in the instance view.
Further investigation revealed that, besides the modifications to the etag and protectionPolicy, several other elements were altered:
The latestModelApplied status changed from true to false.
The modelDefinitionApplied switched from “VirtualMachineScaleSet” to “VirtualMachine”.
The healthProbe was removed from the networkProfileConfiguration.
Same behavior was noticed making call from C# code using latest version of sdk.
To resolve this issue and update the instance to the latest model, I executed another CLI command:
az vmss update-instances --resource-group --name --instance-id
or equivalent call from C# code using sdk.
Related command
az vmss update --resource-group --name --instance-id --protect-from-scale-in true
Errors
Besides the modifications to the etag and protectionPolicy, several other elements were altered:
The latestModelApplied status changed from true to false.
The modelDefinitionApplied switched from “VirtualMachineScaleSet” to “VirtualMachine”.
The healthProbe was removed from the networkProfileConfiguration.
Issue script & Debug output
reproduced_withDebug (2).txt
Expected behavior
Modification of etag and protectionPolicy only
Environment Summary
az --version
azure-cli 2.65.0 *
core 2.65.0 *
telemetry 1.1.0
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Additional context
Customer is setting protection status from c# code using Azure.ResourceManager package
The text was updated successfully, but these errors were encountered: