Watch out, extended OS disk in Azure IaaS VM makes it not bootable
After a week of Azure Ninja course at Microsoft Sweden I wanted to dig a bit deeper into Azure IaaS.
I found that the Update-AzureDisk had a new parameter that looked interesting -ResizedSizeInGB and I wanted to test that one in real action on the OS disk which resulted in a VM that could no longer be started :-(. As described in an earlier post it was a bit more difficult to extend a vhd for a VM in Azure before this powershell way and in those days you had to tear down the VM and throw it away and also the pointer to the blog and after that you could with a tool extend the blob.
So far it looked good but when I then tried to start the VM I got the error
This VM was provisioned from the gallery and after reading the blog about the changes in Azure and that the OS disk now could support 1 TB in size i also found this little text saying that it only applied to disks that was migrated to Azure and not the gallery items or already provisioned VM´s…
So I wanted to test the same thing as above for a migrated vhd, first of all I created a vhd on-premise with 140GB vhd and then used powershell Add-AzureVhd to upload it.
after that I created a VM and started it with no problems 🙂
And then I ran the above resize parameter on this uploaded vhd to extend it to 150GB. With the PowerShell cmdlet I can apply this to a VM that is not running and do not need to remove any relations to the blob or VM´s.
Started it and as you can see it worked nicely
Here you can see when looking inside the VM and checking the Disk manager it shows the extra 10 GB
So watch out if you test to extend your Production VM´s VHD´s depending on where they have come from, although an OS volume does not need to be too large..
I have tested the Update-AzureDisk -ResizedSizeInGB on VM Data disks without any issues no matter if they were created or uploaded so this warning just points at the OS disk!