There isn't an easy way unfortunately. When swapping the OS disk, it must be swapped for an OS disk of the same size so you won't be able to swap for a smaller one. There is a possible solution here but not straightforward: https://jrudlin.github.io/2019-08-27-shrink-azure-vm-osdisk/
restore azure vm os disk to smaller disk and swap OS disk
i see in the azure VM under disks i can "swap OS disk". question is, my VM disk is way to big and i would like to reduce costs. when i setup, i saw there was option to re-size but didn't realize it was only larger.
so, i want to create a new smaller disk and restore my VM OS disk on the smaller disk and "swap os disk" to be new. will this work?
otherwise can i create a new disk that is basically a blank os with same users and swap and then re-install apps?
i'm at 1tb (users use onedrive and email and i couldn't get a good estimate of space required before hand) and i really only need 256 assuming i can increase with no problems....
2 answers
Sort by: Most helpful
-
-
SadiqhAhmed-MSFT 48,256 Reputation points Microsoft Employee
2021-10-08T11:48:42.367+00:00 @chad whittington There may be a workaround, but I cannot find one in Microsoft Documentation. There is the Important note in Expand the OS drive of a Windows VM in an Azure - Azure Virtual Machines | Microsoft Learn:
My suggestion would be to make a support request to Azure VM team as the ask here is primarily about decreasing the size of an existing disk. However, the doc above states it isn’t supported, so they will either confirm the same or maybe help with an undocumented workaround. Restoring a disk is done from a snapshot of the original disk, so the restore portion of this ask shouldn’t be considered here.
Hope that helps. Please share any further questions on this.
----------------------------------------------------------------------------------------------------------------------
If the response helped, do "Accept Answer" and up-vote it