QA:Testcase Virtualization IO Throttling

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Create page)
 
(Use an unordered list, since making numbers work with multiline pre sucks)
Line 11: Line 11:
 
|actions=
 
|actions=
  
# Start a VM
+
* Start a VM
# On the host, make sure that no IO limits are already in place:
+
* On the host, make sure that no IO limits are already in place:
 
       # virsh blkdeviotune f18 vda
 
       # virsh blkdeviotune f18 vda
 
       total_bytes_sec: 0
 
       total_bytes_sec: 0
Line 21: Line 21:
 
       write_iops_sec : 0
 
       write_iops_sec : 0
  
# connect to the VM's graphical console with virt-manager, log in and open a terminal
+
* Connect to the VM's graphical console with virt-manager, log in and open a terminal
# In the guest, write out a large file and see the IO rate (this example requires about a GB of free space):
+
* 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
 
       $ dd if=/dev/zero of=./test.out count=2M
 
       2097152+0 records in
 
       2097152+0 records in
Line 28: Line 28:
 
       1073741824 bytes (1.1 GB) copied, 8.30271 s, 129 MB/s
 
       1073741824 bytes (1.1 GB) copied, 8.30271 s, 129 MB/s
  
# Back on the host, let's set an IO limit of 10MB/sec:
+
* 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 --write_bytes_sec $(expr 1024 \* 1024 \* 10)
 
       # virsh blkdeviotune f18 vda
 
       # virsh blkdeviotune f18 vda
Line 38: Line 38:
 
       write_iops_sec : 0
 
       write_iops_sec : 0
  
# Back to the guest, let's redo what we just did:
+
* Back to the guest, let's redo what we just did:
 
       $ dd if=/dev/zero of=./test.out count=2M
 
       $ dd if=/dev/zero of=./test.out count=2M
 
       2097152+0 records in
 
       2097152+0 records in
Line 44: Line 44:
 
       1073741824 bytes (1.1 GB) copied, 92.4704 s, 11.6 MB/s
 
       1073741824 bytes (1.1 GB) copied, 92.4704 s, 11.6 MB/s
  
# Verify that the IO rate was limited such as in the above example output
+
* Verify that the IO rate was limited such as in the above example output
# Stop guest. Verify that runtime tuning has been dropped
+
* Stop guest. Verify that runtime tuning has been dropped
 
       # virsh blkdeviotune f18 vda
 
       # virsh blkdeviotune f18 vda
 
       total_bytes_sec: 0
 
       total_bytes_sec: 0

Revision as of 02:01, 30 October 2012

Contents

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

  • Start a VM
  • 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
  • Connect to the VM's graphical console with virt-manager, log in and open a terminal
  • 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
  • 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
  • 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
  • Verify that the IO rate was limited such as in the above example output
  • 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.