-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Issues with az vm repair create: Underscore in VM name breaks Bastion access + no option to define VM size #31238
Description
Related command
az vm repair create -g MyResourceGroup -n myVM --repair-username username --repair-password 'password!234' --enable-nested --verbose
Is your feature request related to a problem? Please describe.
We've encountered a couple of issues when using the az vm repair create command, particularly when recovering Windows 11 VMs.
Problem 1: Repair VM Name Ends with Underscore
When we create a repair VM using the command: az vm repair create
The generated VM name follows the pattern: repair-<name_of_affected_VM>_
This trailing underscore (_) seems to cause issues when trying to connect to the repair VM via Azure Bastion. We receive the following error:
BAD_REQUEST: Target Compute ResourceId not valid
Problem 2: VM Size Compatibility with Windows 11
The VM we were attempting to recover was running Windows 11. Some VM sizes are not supported for Windows 11, which led to additional errors. We had to manually resize the repair VM to a supported size.
To resolve both issues, we:
- Created a copy of the repair VM's OS disk.
- Deployed a new VM manually using the copy of the repair VM's OS disk:
2.1 Removed the underscore from the VM name.
2.2 Selected a supported size for Windows 11.
Attach an existing OS disk to a VM - Azure Virtual Machines | Microsoft Learn
Describe the solution you'd like
We’d like to suggest the following enhancements to the az vm repair create command:
- Remove or allow customization of the trailing underscore in the repair VM name to avoid compatibility issues with Azure Bastion.
- Add an option to specify the VM size during the creation of the repair VM, to support OS-specific requirements (like Windows 11).
Describe alternatives you've considered
Additional context
