To get the optimal performance out of your Azure VMs running SQL servers, MS recommends to use Storage Spaces and stripe multiple Azure disks. The nice thing about storage pools in Storage Spaces is that it allows you to add disks behind the scenes without impacting the actual volume.
Now lets say you have a SQL AlwaysOn cluster (2+ nodes), and for performance reasons (IOPS) you realize that you need to add more disks. As Storage Spaces shows all disks (physical, virtual, and storagepools) across the whole cluster, it is possible you won’t be able to simply add them due to naming mismatch. Fear not though, it is still possible if you follow the steps below:
- Add the new disks to the VM
- Log into the VM
- Failover SQL to a secondary if the current VM is the primary
- Stop clustering service on the VM
- Run Get-PhysicalDisks to get the disknames
- Run Add-PhysicalDisk -StoragePoolFriendlyName <storagepool> -PhysicalDisks (Get-PhysicalDisk -FriendlyName <disks>)
- Run Update-HostStorageCache (if we don’t do this sometimes the volume resize doesn’t work)
- Run Resize-VirtualDisk -FriendlyName <diskName> -Size <size>
- Run Update-HostStorageCache (if we don’t do this sometimes the disk resize doesn’t work)
- Run Resize-Partition -Size <size> -DriveLetter <letter>
- Start the clustering service on the machine
- Failback SQL to the VM if required
Hopefully this helps someone as we were beating our heads in for quite a few days (along with MS).