Change Azure ARM VM OS disk

Sometimes you would want to create an Azure ARM based Virtual Machine using an existing VHD disk. It used to be much easier in ASM (Classic). However you can easily swap out the OS disk for a VM using PowerShell.

Simply create a new (non-managed disk) based VM in Azure with new disks. Then you use PowerShell to swap out the OS disk with an existing disk. Good news is that the OS disk doesn’t have to be sysprepped, simply swap the VHD disk URI path using PowerShell, then fire back up the VM to get back into your existing VHD.

My example uses non-managed disks, remember with non-managed disks you have to manage a storage account, however with standard (non-premium(SSD)) non-managed disks, you are not charged for the white space on the disk. You could provision a 1TB disk with only 6KB of data and you are only charged for the data you consume. Plus it makes this process below work. Managed disks works slightly differently.

Azure PowerShell

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: