Upload VHD to Azure problems

Steele, Mark 1 Reputation point
2021-01-28T19:53:21.2+00:00

Starting with an OVA.

  1. Extract .vmdk using tar
  2. Convert .vmdk with 'qemu-img convert -O vpc <vmdk_name> <vhd_name>
  3. Check size of vhd image with 'qemu-img info --output json <vhd_name>
  4. Create disk on azure with 'az disk create -name <some_name> -g <resource_group> -l <region> --for-upload --upload-size-bytes <size in bytes from step #3> --sku standard_lrs
  5. Get error message telling me that the upload size minus 512 vhd header is not an even multiple of 1M
  6. Add 512 to upload-size-bytes in step 4. Success
  7. Grant write access with 'az disk grant-access <args...>'
  8. Upload vhd with 'azcopy copy <vhd_name> <sas_uri from step 7> --blob-type PageBlob'
  9. Get error message telling me that the vhd size does not exactly match the requested upload-size-bytes which is 512 bytes larger
  10. Adjust size of vhd image with 'qemu-img resize <vhd> +512, retry upload. Success
  11. revoce write access with 'az disk revoke-access <args...>'
  12. Error message telling me that value in VHD footer indicates that disk 'abcd' with blob <blob> is not supported VHD. Disk is expected to have cookie value 'conectix'

When I convert the image from .vmdk to .vhd what args should I put in so that I get the supported vhd footer added?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,018 questions
{count} votes

1 answer

Sort by: Most helpful
  1. prmanhas-MSFT 17,946 Reputation points Microsoft Employee Moderator
    2021-01-29T10:34:31.5+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.