QA:Testcase Virtualization KVM PCI Device Assignment

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
m (Minor wiki format changes)
(Mention /dev/vfio/vfio permissions bug)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{QA/Test_Case
 
{{QA/Test_Case
|description=This test case verifies that a PCI device can be assigned to a KVM guest using virt-manager.
+
 
 +
|description=
 +
Assign a physical PCI device to a KVM guest, and verify that it works as expected.
 +
 
 +
|setup=
 +
* Functioning F19+ host and F19+ VM.
 +
* PCI device you can afford to devote entirely to a VM
 +
 
 
|actions=
 
|actions=
* Run virt-manager, open an existing guest and go to the details tab
+
 
* Click ''Add hardware'', choose ''Physical host device'' and click ''Forward''
+
# Run virt-manager, open an existing shutoff guest and go to the details page.
* Choose the appropriate device from the drop down list (e.g. <code>00:19.0 Interface eth0 (82566DM-2 Gigabit Network Connection)</code>)
+
# Add Hardware->PCI Host Device
* Click ''Forward'' and ''Finish''
+
# Choose the device you want to assign from the list, like: <code>00:19.0 Interface eth0 (82566DM-2 Gigabit Network Connection)</code>
* Start the guest and check the device is functional within the guest
+
# Click ''Finish''
* Shut down the guest and check the device is functional within the host
+
# Start the guest and check the device is functional within the guest
 +
# Shut down the guest and check the device is functional within the host
 +
# Select the device in virt-manager and ''Remove'' it
 +
 
 +
== Device assignment with VFIO ==
 +
 
 +
[http://www.linux-kvm.org/wiki/images/d/d1/2011-forum-VFIO.pdf VFIO] is the new and improved PCI assignment method for kvm. It will likely become the default through libvirt in the future.
 +
 
 +
# Verify your host as necessary hardware support for VFIO
 +
#* If on an Intel CPU, this command should show at least 2 matches: <code>dmesg <nowiki>|</nowiki> grep -e DMAR -e IOMMU</code>
 +
#* If on an AMD CPU, this command should show some output: <code>dmesg <nowiki>|</nowiki> grep AMD-Vi</code>
 +
# On the host, do <code>sudo chmod 666 /dev/vfio/vfio</code>  ([https://bugzilla.redhat.com/show_bug.cgi?id=967230 this is an F19 bug])
 +
# Follow the regular PCI assignment steps up to step 4.
 +
# Change the host device to use the VFIO method:
 +
#* <code>sudo virsh edit test-day-vm</code>
 +
#* Add <code><driver name="vfio"/></code> to the PCI <code><hostdev></code> block
 +
#* Save and exit
 +
# Continue on at step 4 in the above steps.
 +
 
 
|results=
 
|results=
* The device which is to be assigned should be available in the dropdown list
+
No obvious errors occur. PCI device assignment can be quirky and does not always work with every PCI device or host PCI layout. If you get an error, ask in #fedora-test-day IRC first and we can likely provide some direction.
* The device should be successfully assigned to the guest
+
* The guest should start without any errors
+
* The device should be functional within the guest
+
* Once the guest is shutdown, the device should be functional within the host
+
 
}}
 
}}
[[Category:Virtualization KVM PCI Device Assignment Test Cases|virt-manager]]
+
 
 +
[[Category:Virtualization Test Cases]]

Latest revision as of 20:02, 25 May 2013

Contents

Description

Assign a physical PCI device to a KVM guest, and verify that it works as expected.

Setup

  • Functioning F19+ host and F19+ VM.
  • PCI device you can afford to devote entirely to a VM

How to test

  1. Run virt-manager, open an existing shutoff guest and go to the details page.
  2. Add Hardware->PCI Host Device
  3. Choose the device you want to assign from the list, like: 00:19.0 Interface eth0 (82566DM-2 Gigabit Network Connection)
  4. Click Finish
  5. Start the guest and check the device is functional within the guest
  6. Shut down the guest and check the device is functional within the host
  7. Select the device in virt-manager and Remove it

Device assignment with VFIO

VFIO is the new and improved PCI assignment method for kvm. It will likely become the default through libvirt in the future.

  1. Verify your host as necessary hardware support for VFIO
    • If on an Intel CPU, this command should show at least 2 matches: dmesg | grep -e DMAR -e IOMMU
    • If on an AMD CPU, this command should show some output: dmesg | grep AMD-Vi
  2. On the host, do sudo chmod 666 /dev/vfio/vfio (this is an F19 bug)
  3. Follow the regular PCI assignment steps up to step 4.
  4. Change the host device to use the VFIO method:
    • sudo virsh edit test-day-vm
    • Add <driver name="vfio"/> to the PCI <hostdev> block
    • Save and exit
  5. Continue on at step 4 in the above steps.

Expected Results

No obvious errors occur. PCI device assignment can be quirky and does not always work with every PCI device or host PCI layout. If you get an error, ask in #fedora-test-day IRC first and we can likely provide some direction.