1

I am following these https://learn.microsoft.com/en-us/azure/virtual-machines/linux/upload-vhd instructions to create a VM in Azure. At this stage though

az disk create --resource-group myResourceGroup --name myManagedDisk \ --source https://mystorageaccount.blob.core.windows.net/mydisks/myDisk.vhd

i get the following error

Only blobs formatted as VHDs can be imported.

I believe the VHD is a Linux OS.

Any ideas to what i have missed or does someone have a link to a better resource that can help me get this VM installed?

Barnsley
  • 117
  • 2
  • 17
  • When you uploaded, did you mark the VHD as a page file and not a blob file? "az storage blob upload" step – CtrlDot May 12 '17 at 16:29
  • I copied that step and just changed the names to match my resource groups and storage accounts. – Barnsley May 12 '17 at 18:55

1 Answers1

3

I follow the guide you mentioned above and I am able to create the disk without any issue.

created

As CtrlDot mentioned above, please make sure that the uploaded vhd is marked as page blob.

To verify this, please run the command below:

verify

If it is page blob and you are still getting error, then please make sure that your source vhd has met the following requirements:

  1. The type of the source file is vhd. (not vhdx) Otherwise, please follow this guide to convert the vhdx to a vhd file.

  2. The vhd file is fixed size and it is aligned to 1 MB. Otherwise, please follow this guide to convert the dynamic vhd to a fixed one.

  • The content i got back indicated it was a page blob "properties": { "appendBlobCommittedBlockCount": null, "blobType": "PageBlob", "contentLength": 1856475136, but unlike your example above i got no metadata info "metadata": {}, – Barnsley May 15 '17 at 12:31
  • As you suggested i converted the VHD from dynamic to fixed using the guide and it was successful. Thank you for the information. – Barnsley May 15 '17 at 17:25