Swap OS disk to storage account

Quick post to remember what actions have to be made to swap your OS disk to a VHD disk in a storage account (yes swapping from MD to UMD, I know probably I’m crazy, but for golden images it is great).

But imagine that you have a VM running a MD disk and you need to swap that OS Disk with and UMD… how can you that?

# Get the VM 
$vm = Get-AzVM -ResourceGroupName myResourceGroup -Name myVM 

# Make sure the VM is stopped\deallocated
Stop-AzVM -ResourceGroupName myResourceGroup -Name $vm.Name -Force

# Set the VM configuration to point to the new disk
Set-AzVMOSDisk -VM $VirtualMachine -Name "osDisk.vhd" -VhdUri "https://mystorageaccount.blob.core.windows.net/disks/osdisk.vhd"

# Update the VM with the new OS disk
Update-AzVM -ResourceGroupName myResourceGroup -VM $vm 

# Start the VM
Start-AzVM -Name $vm.Name -ResourceGroupName myResourceGroup

That’s all! Your VM is running with vhd disk 🙂


Azure disk: Managed VS Unmanaged

This question always pursues me, so I want to drop these lines in order to make it clear in my mind and for my customers:

With unmanaged disks, you are responsible for the storage accounts that are used to hold the VHDs that correspond to your VM disks. You pay the storage account rates for the amount of space you use, which is great, you pay for what you use.

A single storage account is capable of supporting 40 standard virtual hard disks at full throttle (20.000 IOPS). In case that you you need to scale out, you will need more than one storage account, which can get complicated.

Managed disks are the newer and recommended disk storage model. You only have to specify the disk type (Premium or Standard) and the size of the disk and automatically, Azure creates and manages both the disk and the storage it uses. You don’t have to worry about storage account limits, which makes them easier to scale out. They also offer several other benefits:

  • Increased reliability: Azure ensures that VHDs associated with high-reliability VMs will be placed in different parts of Azure storage to provide similar levels of resilience.
  • Better security: Managed disks are truly managed resources in the resource group. This means they can use role-based access control to restrict who can work with the VHD data.
  • Snapshot support: Snapshots can be used to create a read-only copy of a VHD. You have to shut down the owning VM but creating the snapshot only takes a few seconds. Once it’s done, you can power on the VM and use the snapshot to create a duplicate VM to troubleshoot a production issue or rollback the VM to the point in time that the snapshot was taken.
  • Backup support: Managed disks can be automatically backed up to different regions for disaster recovery with Azure Backup all without affecting the service of the VM.

Azure: Standard SSD Disks

Recently Microsoft announced that they are launching Standard SSD Disks for Azure MV. The main purpose of this is to replace standard HDD disks for those VM that are executing low level workloads.

We will continue having Standard HDD disks, since Standard SSD disks are in preview, so is probably that will be only available for some particular regions. The main point of this announcement is that Standard SSD disks are here to replace HDD disks, if we compare Standard SSD disks against HDD, we can get:

  • Smoother levels of performance
  • Lower latency

So, nowadays we have the following classification for SSD disks:

  • Standard SSD: For workloads where you do not need high IOPS.
  • Premium SSD: Higher IOPS and throughput than Standard disks, and offer a 99.5 percent SLA for single virtual machine services

Also we have to take into account that Standard SSD disks are a bit cheaper than HDD: Price