Skip to content

az vm create cli's --hyper-v-generation option does not allow creation of Gen2 managed disk #21264

@pushkarcMS

Description

@pushkarcMS

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

  1. 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

  1. Get disk status

az disk show --resource-group myrg -n "mydisk"
{
...
"hyperVGeneration": null,
...
}

  1. 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."
}
}

Metadata

Metadata

Labels

Computeaz vm/vmss/image/disk/snapshotService AttentionThis issue is responsible by Azure service team.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions