Installation guide

These steps cover assigning a PCI device to a virtual machine on a KVM hypervisor.
This example uses a PCIe network controller with the PCI identifier code, pci _0 0 0 0 _0 1_0 0 _0 , and
a fully virtualized guest machine named guest1-rhel6-64.
Pro ced u re 12.3. Assig n in g a PC I d evice t o a g u est virt u al mach in e wit h virsh
1. Id en t if y th e d evice
First, identify the PCI device designated for device assignment to the virtual machine. Use the
l spci command to list the available PCI devices. You can refine the output of l spci with
g rep.
This example uses the Ethernet controller highlighted in the following output:
# lspci | grep Ethernet
0 0 : 19 . 0 Ethernet co ntro l l er: Intel C o rpo rati o n 8256 7LM-2 G i g abi t
Netwo rk C onnecti o n
01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit
Network Connection (rev 01)
01:00.1 Ethernet controller: Intel Corporation 82576 Gigabit
Network Connection (rev 01)
This Ethernet controller is shown with the short identifier 0 0 : 19 . 0 . We need to find out the
full identifier used by vi rsh in order to assign this PCI device to a virtual machine.
To do so, combine the vi rsh no d ed ev-l i st command with the g rep command to list all
devices of a particular type (pci ) that are attached to the host machine. Then look at the
output for the string that maps to the short identifier of the device you wish to use.
This example highlights the string that maps to the Ethernet controller with the short identifier
0 0 : 19 . 0 . Note that the : and . characters are replaced with underscores in the full
identifier.
# virsh nodedev-list --cap pci
pci_0000_00_00_0
pci_0000_00_01_0
pci_0000_00_03_0
pci_0000_00_07_0
pci_0000_00_10_0
pci_0000_00_10_1
pci_0000_00_14_0
pci_0000_00_14_1
pci_0000_00_14_2
pci_0000_00_14_3
pci_0000_0 0 _19 _0
pci_0000_00_1a_0
pci_0000_00_1a_1
pci_0000_00_1a_2
pci_0000_00_1a_7
pci_0000_00_1b_0
pci_0000_00_1c_0
pci_0000_00_1c_1
pci_0000_00_1c_4
pci_0000_00_1d_0
pci_0000_00_1d_1
Red Hat Ent erp rise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide
96