-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Uploaded an unmanaged VHD file in a storage account. Tried creating a gen2 managed disk using CLI as described below which leads to null value for disk's hyperVGeneration.
Similar steps work fine when creating managed disk through portal to create a gen2 managed disk and deploying a gen2 VM.
Repro steps
- Create disk
az disk create --resource-group myrg -n "mydisk" --source "https://sorageaccount.blob.core.windows.net/container/someblob.vhd" --os-type Windows --hyper-v-generation V2
- Get disk status
az disk show --resource-group myrg -n "mydisk"
{
...
"hyperVGeneration": null,
...
}
- Use disk for Gen2 vm deployment
az vm create --name "myvm" --resource-group "myrg" --attach-os-disk "mydisk" --os-type windows --size "" --location "someloc" --nsg-rule "RDP" --availability-set "myavset"
ERROR:
Deployment failed. Correlation ID: 9efe1fb0-b739-40f9-9556-92c636d5281d. {
"error": {
"code": "BadRequest",
"message": "The selected VM size '' cannot boot Hypervisor Generation '1'. If this was a Create operation please check that the Hypervisor Generation of the Image matches the Hypervisor Generation of the selected VM Size. If this was an Update operation please select a Hypervisor Generation '1' VM Size."
}
}