From Fedora Project Wiki

Revision as of 11:09, 4 May 2009 by Clalance (talk | contribs)


This test case verifies that block devices can be successfully attached to and detached from a Fedora Xen DomU.

How to test

  1. Create a number of dummy files on your dom0 by running
    $> for i in `seq 1 70` ; do dd if=/dev/zero of=/var/lib/xen/images/disk$i.dsk bs=1 count=1 seek=10G ; done
    Note that this command will create sparse files, meaning that unless you write data to the disk, no actual disk space on your hard drive will be used.
  2. Create one very large dummy file on your dom0 by running
    $> dd if=/dev/zero of=/var/lib/xen/images/bigdisk.dsk bs=1 count=1 seek=6TB

# From the dom0, attach one of the files to the F-11 domU <pre>$> virsh attach-disk f11 --driver file /var/lib/xen/images/disk1.dsk xvdb

  1. Inside the guest, run
    $> fdisk /dev/xvdb
    You should be able to partition the disk however you want, create a new filesystem on it, etc.
  2. From the dom0, disconnect the disk from the F-11 guest
    $> virsh detach-disk f11 xvdb
  3. Download this script to the dom0, and make it executable with chmod +x This shell script attaches all 70 disks created above to the domU. You will probably have to modify this script to match your environment. Note that your dom0 must explicitly have support for this, so if your dom0 does not, this test will not work. Once you have modified the script appropriately, run it with
    All 70 disks should successfully attach to the F-11 domU.
  4. Download this script to the dom0, and make it executable with chmod +x This shell script attaches a simulated "huge" file (5TB) to the guest. Run the script
    $> create f11
    to attach the huge file to the guest named "f11". Poke around inside the F-11 domU and make sure you can partition and use the 5TB disk. When you are finished, run
    $> remove f11
    to clean up.

Expected Results

  1. The disks should be presented to the domU on attach-disk, and removed from the guest on detach-disk.
  2. The F-11 guest should be able to use the disks like any other piece of storage.