Skip to content

Unexpected behavior applying instance protection to scale sets #30708

Open
@autumnrequiem

Description

Describe the bug

When applying instance protection to a scale set instance via the Azure portal, the behavior is as expected.

Image

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.

Image

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

Metadata

Labels

Auto-AssignAuto assign by botAuto-ResolveAuto resolve by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions