Skip to content

Instantly share code, notes, and snippets.

@rahmancloud
Last active February 21, 2025 17:46
Show Gist options
  • Save rahmancloud/156eb7c71e010ab740632f97946f341d to your computer and use it in GitHub Desktop.
Save rahmancloud/156eb7c71e010ab740632f97946f341d to your computer and use it in GitHub Desktop.
The upload size in bytes # - 512 bytes for the VHD footer (# in this case) must be a multiple of MiB.
$ wc -c os_disk.vhdx
5272240128 os_disk.vhdx

The vhd file size needs to be a number divisible by 1024.

5272240128 / 1025 / 1024 / 1024 = 4.91015625

4.91015625 is not divisible by 1024. We are going to round the number to 5.

5 * 1024 * 1024 * 1024 = 5368709120

And add 512 bytes for the VHD footer.

5368709120 + 512 = 5368709632

Reference: Reddit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment