Q. I want to move/replicate a VM to Azure that has a boot disk larger than 127 GB, what can I do?
A. At time of this writing the boot/OS disk of an Azure VM must be 127 GB maximum and there is no way to use a larger disk. Therefore if you want to move or replicate an on-premises VM that has a boot volume larger than 127GB you will need to take steps to shrink it to 127 GB or less. There are a number of options to get boot volumes down to 127 GB.
- If the boot volume is larger than 127 GB, but has a lot of empty space, then perform a defragmentation of the OS. Shrink the boot partition within the guest OS and then resize the source. If the source is a VHDX on a generation 2 VM you can resize while the VM is running, otherwise if its VHDX on generation 1 (which means would be connected to IDE controller) or if its a VHD you would need to resize the virtual hard disk offline which means the VM is stopped.
- If the content is over 127 GB then move the pagefile to a different disk. Perform a disk defragementation, shrink the boot disk in the guest, and then resize the virtual hard disk.
- If the content is over 127 GB, after moving the pagefile add additional data disks and move data from the boot disk to the data disks. Do this until the boot disk is below 127 GB in size. Run a defragmentation, shrink the partition, and then resize the virtual hard disk so it is 127 GB or less.
Note that this limit will eventually be removed and it is only certain services that still impose the 127 GB limit. However the same logic above would apply to making the volume 1023GB or smaller which is the Azure single disk size limit.