I have found these methods so far:
- soft path: increase blob page size and fix VHD data structure (last 512 bytes). Theoretically, this creates unallocated disk space after the current partition. But if the partition table also expects metadata at the end of the disk (GPT? Or dynamic disks), which also need to be fixed. I know only one tool that can perform this modification in place. Unfortunately, this tool is not much more than a one-way hack (at the time of this writing) and, therefore, it is fragile. (See Disclaimer from the author.) But quickly.
Please let me know (or edit this post) if this tool improves significantly. - create a large disk and copy everything as you suggested. This may be enough if you do not need to save NTFS features such as transitions, soft / hard links, etc.
- plan for a potential expansion and start with a huge dynamic VHD (say 1 TB) consisting of a small partition and a lot of unplanned (reserved) space. Windows Disk Manager will see unallocated space in VHD and can expand the partition onto it whenever you want - an in-place operation. The thin point is that an unallocated area, until it is evaluated, will not be billed because it is not written. (Note that formatting or defragmentation allocates areas and causes billing.) However, it will reckon with your Azure subscription quota (100TB).
- "Hard way": download the VHD file, use the VHD-resizer program to insert unallocated disk space, install VHD locally, expand the partition to unallocated space, unmount, load. This saves everything, even works for the OS partition, but is very slow due to the download / download and software installation.
- Same as above, but running on a secondary virtual machine in Azure. It speeds up loading / loading a lot. Step-by-step instructions are available here .
Unfortunately, all these methods require unmounting the drive for a rather long time, i.e. cannot be performed with high availability.
source share