-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Compute] az vmss reimage: Fix the bug that all instances will be reimaged after using --instance-id
#25477
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
[Compute] az vmss reimage: Fix the bug that all instances will be reimaged after using --instance-id
#25477
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3703,12 +3703,14 @@ def list_vmss_instance_public_ips(cmd, resource_group_name, vm_scale_set_name): | |||||||||||||||||||||||||||||||||||||
| return [r for r in result if r.ip_address] | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| def reimage_vmss(cmd, resource_group_name, vm_scale_set_name, instance_id=None, no_wait=False): | ||||||||||||||||||||||||||||||||||||||
| def reimage_vmss(cmd, resource_group_name, vm_scale_set_name, instance_ids=None, no_wait=False): | ||||||||||||||||||||||||||||||||||||||
| client = _compute_client_factory(cmd.cli_ctx) | ||||||||||||||||||||||||||||||||||||||
| if instance_id: | ||||||||||||||||||||||||||||||||||||||
| for instance in instance_id: | ||||||||||||||||||||||||||||||||||||||
| sdk_no_wait(no_wait, client.virtual_machine_scale_set_vms.begin_reimage, | ||||||||||||||||||||||||||||||||||||||
| resource_group_name, vm_scale_set_name, instance) | ||||||||||||||||||||||||||||||||||||||
| if instance_ids: | ||||||||||||||||||||||||||||||||||||||
| VirtualMachineScaleSetVMInstanceIDs = cmd.get_models('VirtualMachineScaleSetVMInstanceIDs') | ||||||||||||||||||||||||||||||||||||||
| instance_ids = VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) | ||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to change the name if its type changes, in order to make the code easier to read.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use azure-cli/src/azure-cli/azure/cli/command_modules/vm/custom.py Lines 3541 to 3558 in 917fba1
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ugh, |
||||||||||||||||||||||||||||||||||||||
| return sdk_no_wait(no_wait, client.virtual_machine_scale_sets.begin_reimage_all, resource_group_name, | ||||||||||||||||||||||||||||||||||||||
| vm_scale_set_name, instance_ids) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| return sdk_no_wait(no_wait, client.virtual_machine_scale_sets.begin_reimage, resource_group_name, vm_scale_set_name) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's provide an example for reimaging all instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, done