Azure / Azure/azure-cli-extensions

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

Open
#8,453 5 comments 0 reactions 1 assignee Assigned to @TravisCragg-MSFT View on GitHub
Auto-Assign Compute customer-reported question Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

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

https://github.com/Azure/azure-cli-extensions/commit/ea4af4cfcc92009c49949259c6c883f9171d7a3d

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.