Skip to content

"Does repair vm requires public ip" No opion does not work #8453

Open
@nohato

Description

Describe the bug

I did 「az vm repair create -g rgname -n vmname --repair-username username --repair-password passwordinfo --enable-nested --verbose」with prompt 「"Does repair vm requires public ip" No」.
However public ip has been assigned on repair vm even though I set「"Does repair vm requires public ip" No」

We can repro easily.

Upon checking the az vm repair debug logs internal "az vm create" command set --public-ip-address repair-vm-wins_PublicIP.
I think should be set --public-ip-address "" in the case user set「"Does repair vm requires public ip" No」.

Related command

ea4af4c

az vm repair create -g rgname -n vmname --repair-username username --repair-password passwordinfo --enable-nested --verbose

Errors

No error. "Does repair vm requires public ip" No opion does not work

Issue script & Debug output

Debug log

===
cli.azext_vm_repair.repair_utils: Creating repair VM with command: az vm create -g repair-vm-winsvr-2019-01-20250205004741 -n repair-vm-wins_ --tag repair_source=*** --image MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk:20348.3091.250112 --admin-username *** --admin-password *** --public-ip-address repair-vm-wins_PublicIP --size Standard_D2s_v3
cli.azext_vm_repair.repair_utils: copy_disk_id: ***
cli.azext_vm_repair.repair_utils: fix_uuid: False
cli.azext_vm_repair.repair_utils: Validating VM template before continuing...
cli.azext_vm_repair.repair_utils: Calling: az vm create -g repair-vm-winsvr-2019-01-20250205004741 -n repair-vm-wins_ --tag repair_source=*** --image MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk:20348.3091.250112 --admin-username ******** --admin-password ******** --public-ip-address repair-vm-wins_PublicIP --size Standard_D2s_v3 --attach-data-disks *** --validate
cli.azext_vm_repair.repair_utils: Success.

cli.azext_vm_repair.repair_utils: Creating repair VM...
cli.azext_vm_repair.repair_utils: Calling: az vm create -g repair-vm-winsvr-2019-01-20250205004741 -n repair-vm-wins_ --tag repair_source=*** --image MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk:20348.3091.250112 --admin-username ******** --admin-password ******** --public-ip-address repair-vm-wins_PublicIP --size Standard_D2s_v3 --attach-data-disks ***
cli.azext_vm_repair.repair_utils: Success.

Expected behavior

Public IP should not be set on repair vm when the user set prompt "Does repair vm requires public ip" :NO

Environment Summary

Most recent version in Azure cloudshell

PS /home/nobumasa> az version
{
"azure-cli": "2.68.0",
"azure-cli-core": "2.68.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"ai-examples": "0.2.5",
"ml": "2.33.1",
"ssh": "2.0.6"
}
}

Additional context

Related source code are here.
https://github.com/Azure/azure-cli-extensions/blob/main/src/vm-repair/azext_vm_repair/repair_utils.py#L802
https://github.com/Azure/azure-cli-extensions/blob/main/src/vm-repair/azext_vm_repair/_validators.py#L227
https://github.com/Azure/azure-cli-extensions/blob/main/src/vm-repair/azext_vm_repair/custom.py#L154

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions