Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior applying instance protection to scale sets #30708

Open
autumnrequiem opened this issue Jan 23, 2025 · 2 comments
Open

Unexpected behavior applying instance protection to scale sets #30708

autumnrequiem opened this issue Jan 23, 2025 · 2 comments
Assignees
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

Comments

@autumnrequiem
Copy link

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

@autumnrequiem autumnrequiem added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 23, 2025
Copy link

Hi @autumnrequiem,

2.65.0 is not the latest Azure CLI(2.68.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Jan 23, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 23, 2025

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Compute az vm/vmss/image/disk/snapshot labels Jan 23, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 23, 2025
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 23, 2025
@yonzhan yonzhan added this to the Backlog milestone Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants