Home / Azure

AzureHow-toAdvanced

Stripe several Azure data disks into one volume for more IOPS: Storage Spaces on Windows, LVM on Linux

Combine several managed data disks into one striped volume with Storage Spaces or LVM to add up their IOPS and throughput, and avoid the column and extend traps.

Deepak Bhardwaj7 min read

Applies toAzure VMs (Windows Server 2016 and later, Linux with LVM2), Premium SSD and Standard SSD managed disks, Azure CLI 2.x

The goal

One data disk is throttling at its provisioned IOPS or MB/s, the VM size still has headroom, and you want one drive letter or mount point that is faster than any single disk. Striping four P30 disks, for example, gives roughly four times the IOPS and throughput of one disk, up to the VM's own disk limits.

Striping is RAID 0. It adds performance, not redundancy. Azure managed disks are already replicated inside the storage service, so the risk is not a "failed disk" in the usual sense; the risk is operational: detaching or deleting one member destroys the whole volume.

Tip

Before striping, check whether Premium SSD v2 or Ultra Disk fits. Both let you set IOPS and throughput independently of size, which often removes the need to stripe. Striping is still the usual answer for Premium SSD v1 and Standard SSD.

1. Check the ceilings first

The striped volume can never be faster than the VM. Compare the sum of the disks with the VM size's limits:

RG=rg-sql
VM=vm-sql01

az vm show -g $RG -n $VM --query hardwareProfile.vmSize -o tsv
az vm list-skus -l westeurope --size Standard_E8s_v5 \
  --query "[0].capabilities[?contains(name,'IOPS') || contains(name,'BytesPerSecond') || name=='MaxDataDiskCount']" -o table

Capability names vary by SKU and API version; check the output and the VM size page in the docs for the uncached and cached disk IOPS and MB/s. If four disks add up to 20,000 IOPS but the VM allows 12,800 uncached, you are paying for disks you can't use.

2. Attach identical disks

Use the same SKU, size and caching setting for every member. Mixed sizes waste capacity, and mixed performance makes the stripe run at the slowest member's pace.

for LUN in 0 1 2 3; do
  az vm disk attach -g $RG --vm-name $VM \
    --name ${VM}-data-lun$LUN --new --size-gb 1024 \
    --sku Premium_LRS --lun $LUN --caching ReadOnly
done

az vm show -g $RG -n $VM \
  --query "storageProfile.dataDisks[].{lun:lun,name:name,sizeGb:diskSizeGb,caching:caching}" -o table

Caching guidance:

Data on the volume Host caching
Read-heavy data files ReadOnly
Write-heavy logs (database transaction logs) None
Mixed, unsure None first, then test ReadOnly

Keep data and logs on separate striped volumes if they need different caching.

3. Windows: build a Storage Spaces simple volume

Run in an elevated PowerShell session on the VM (RDP, or az vm run-command invoke --command-id RunPowerShellScript).

# Only the new, empty, poolable disks
$disks = Get-PhysicalDisk -CanPool $true
$disks | Format-Table FriendlyName, SerialNumber, Size, CanPool

New-StoragePool -FriendlyName DataPool `
  -StorageSubSystemFriendlyName "Windows Storage*" `
  -PhysicalDisks $disks

New-VirtualDisk -StoragePoolFriendlyName DataPool -FriendlyName DataVDisk `
  -ResiliencySettingName Simple `
  -NumberOfColumns $disks.Count `
  -Interleave 65536 `
  -ProvisioningType Fixed `
  -UseMaximumSize

Get-VirtualDisk -FriendlyName DataVDisk | Get-Disk |
  Initialize-Disk -PartitionStyle GPT -PassThru |
  New-Partition -DriveLetter F -UseMaximumSize |
  Format-Volume -FileSystem NTFS -AllocationUnitSize 65536 -NewFileSystemLabel Data -Confirm:$false

What the key parameters do:

  • -ResiliencySettingName Simple: striping with no mirror or parity. Mirror on top of Azure disks halves capacity and write speed for little gain.
  • -NumberOfColumns: how many disks each write is spread across. Set it to the number of disks. You can't change it later.
  • -Interleave 65536: 64 KB stripe size, the usual choice for SQL Server and general workloads. Match it with a 64 KB NTFS allocation unit.

Check the result:

Get-VirtualDisk DataVDisk | Format-List FriendlyName, ResiliencySettingName, NumberOfColumns, Interleave, Size
Get-Volume -DriveLetter F

4. Linux: build a striped LVM logical volume

Identify the disks by LUN, not by /dev/sdX, which can change between boots:

ls -l /dev/disk/azure/scsi1/
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT

The /dev/disk/azure/... links come from the Azure udev rules on most marketplace images. On NVMe-based VM sizes the device names and link paths differ; check your image's output.

DISKS="/dev/disk/azure/scsi1/lun0 /dev/disk/azure/scsi1/lun1 /dev/disk/azure/scsi1/lun2 /dev/disk/azure/scsi1/lun3"

sudo pvcreate $DISKS
sudo vgcreate vg_data $DISKS
sudo lvcreate -n lv_data -i 4 -I 64k -l 100%FREE vg_data   # -i = stripes, -I = stripe size

sudo mkfs.xfs /dev/vg_data/lv_data
sudo mkdir -p /data

Mount it by UUID with nofail, so a missing disk doesn't drop the VM into emergency mode at boot:

UUID=$(sudo blkid -s UUID -o value /dev/vg_data/lv_data)
echo "UUID=$UUID /data xfs defaults,nofail 0 2" | sudo tee -a /etc/fstab
sudo mount -a
df -h /data
sudo lvs -o lv_name,stripes,stripe_size,lv_size vg_data

Warning

Use the whole disk as the physical volume and don't mix partitioned and unpartitioned members. Consistency matters more than which style you pick; mixing them makes later extends and recovery confusing.

5. Test that you got the performance

Measure before you hand the volume over. On Windows use DiskSpd; on Linux use fio:

sudo fio --name=randread --filename=/data/fio.test --size=10G \
  --rw=randread --bs=8k --iodepth=64 --numjobs=4 --direct=1 \
  --ioengine=libaio --runtime=60 --time_based --group_reporting
sudo rm /data/fio.test

Compare the result with your disk-sum and the VM limit. Then check Azure's view of throttling:

VMID=$(az vm show -g $RG -n $VM --query id -o tsv)
az monitor metrics list --resource $VMID \
  --metric "Data Disk IOPS Consumed Percentage" "VM Uncached IOPS Consumed Percentage" \
  --interval PT1M --aggregation Maximum -o table
Result Meaning Action
Per-disk consumed % near 100 Disks are the limit Add disks (see section 6) or move to a higher tier
VM uncached consumed % near 100 VM size is the limit Resize the VM; more disks won't help
Neither near 100, low IOPS Queue depth too low, or stripe not across all disks Raise test iodepth; check NumberOfColumns or stripes

6. Extending a striped volume

This is where most striped setups go wrong.

  • Storage Spaces: a simple space with 4 columns can only grow in steps of 4 disks. Add 4 more identical disks, Add-PhysicalDisk them to the pool, then Resize-VirtualDisk and Resize-Partition. Adding a single disk does nothing useful.
  • LVM: extending a 4-stripe LV needs free extents on 4 PVs. Add 4 disks, vgextend, then lvextend -i 4 -l +100%FREE and xfs_growfs /data.
  • Alternative: expand every existing member disk to a larger size with az disk update --size-gb, then grow the pool or PVs (pvresize). This keeps the same column count and is often simpler.

Caution

Never detach or delete one member disk of a striped volume, and never "clean up" a disk because it looks unused in the portal. Losing any member destroys all data on the volume. Tag every member, for example stripeSet=vm-sql01-data, and lock the disks with CanNotDelete.

Backup and restore

Each member disk on its own is useless. Back up the VM with Azure Backup or VM restore points, which snapshot all disks together. Individual disk snapshots taken one by one are not consistent with each other and won't give you a usable stripe set.

Prevent it next time

  • Decide the column count from the final size you expect, not today's need, because it can't change later.
  • Keep a runbook entry per VM: disks, LUNs, column count, stripe size and mount point.
  • Alert on Data Disk IOPS Consumed Percentage and VM Uncached IOPS Consumed Percentage above 90% so you see throttling before users do.
  • For new builds, compare the cost of Premium SSD v2 against a stripe set before you commit.