Skip to content

Simulating slow disks with Libvirt

I once wrote about how to simulate latency on Linux.

The article has been useful for myself recently, as I was at a customer who was having all kind of weird issues, probably caused by unreliable network, and slow performing disks.

I recreated their environment on my Libvirt lab.

You can throttle the I/O of a Libvirt disk, as documented here and here.

# virsh blkdeviotune domain <device> [[--config] [--live] | [--current]] [[total-bytes-sec] | [read-bytes-sec] [write-bytes-sec]] [[total-iops-sec] [read-iops-sec] [write-iops-sec]]

Example:

# virsh blkdeviotune MyVirtualMachine vda --total-iops-sec 1000