From Fedora Project Wiki

Revision as of 01:38, 30 October 2012 by Crobinso (talk | contribs) (Create page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Limit disk IO of a guest and prove it's working. For more details, see:

http://wiki.qemu.org/Features/DiskIOLimits

Setup

Nothing beyond the initial test day setup (basically a function F18 VM).

How to test

  1. Start a VM
  2. On the host, make sure that no IO limits are already in place:
     # virsh blkdeviotune f18 vda
     total_bytes_sec: 0
     read_bytes_sec : 0
     write_bytes_sec: 0
     total_iops_sec : 0
     read_iops_sec  : 0
     write_iops_sec : 0
  1. connect to the VM's graphical console with virt-manager, log in and open a terminal
  2. In the guest, write out a large file and see the IO rate (this example requires about a GB of free space):
     $ dd if=/dev/zero of=./test.out count=2M
     2097152+0 records in
     2097152+0 records out
     1073741824 bytes (1.1 GB) copied, 8.30271 s, 129 MB/s
  1. Back on the host, let's set an IO limit of 10MB/sec:
     # virsh blkdeviotune f18 vda --write_bytes_sec $(expr 1024 \* 1024 \* 10)
     # virsh blkdeviotune f18 vda
     total_bytes_sec: 0
     read_bytes_sec : 0
     write_bytes_sec: 10485760
     total_iops_sec : 0
     read_iops_sec  : 0
     write_iops_sec : 0
  1. Back to the guest, let's redo what we just did:
     $ dd if=/dev/zero of=./test.out count=2M
     2097152+0 records in
     2097152+0 records out
     1073741824 bytes (1.1 GB) copied, 92.4704 s, 11.6 MB/s
  1. Verify that the IO rate was limited such as in the above example output
  2. Stop guest. Verify that runtime tuning has been dropped
     # virsh blkdeviotune f18 vda
     total_bytes_sec: 0
     read_bytes_sec : 0
     write_bytes_sec: 0
     total_iops_sec : 0
     read_iops_sec  : 0
     write_iops_sec : 0

Expected Results

No obvious errors occur, IO rate was limited as expected.