Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-25-2013, 10:32 AM   #1
LQ Newbie
Registered: Jun 2013
Posts: 10
Blog Entries: 2

Rep: Reputation: 0
how can assign hba port directly to kvm virtual guest by pci passtrough

OS - RHEL 6.2
Virtual technology - KVM
Old 06-26-2013, 06:16 AM   #2
LQ Newbie
Registered: Jun 2013
Posts: 10
Blog Entries: 2

Original Poster
Rep: Reputation: 0
I had tried with the below procedure but was not success ....

1. Enable the Intel VT-d extensions
The Intel VT-d extensions provide hardware support for directly assigning a physical devices to guest.
The VT-d extensions are required for PCI passthrough with Red Hat Enterprise Linux. The
extensions must be enabled in the BIOS. Some system manufacturers disable these extensions by default.
These extensions are often called various terms in BIOS which differ from manufacturer to
manufacturer. Consult your system manufacturer's documentation.
2. Activate Intel VT-d in the kernel
Activate Intel VT-d in the kernel by appending the intel_iommu=on parameter to the kernel line
of the kernel line in the /boot/grub/grub.conf file.
The example below is a modified grub.conf file with Intel VT-d activated.

title Red Hat Enterprise Linux Server (2.6.32-36.x86-645)
root (hd0,0)
kernel /vmlinuz-2.6.32-36.x86-64 ro root=/dev/VolGroup00/LogVol00 rhgb
quiet intel_iommu=on
initrd /initrd-2.6.32-36.x86-64.img

3. Ready to use
Reboot the system to enable the changes. Your system is now PCI pass-through capable.

Preparing an AMD system for PCI pass-through
Enable AMD IOMMU extensions
The AMD IOMMU extensions are required for PCI pass-through with Red Hat Enterprise Linux.
The extensions must be enabled in the BIOS. Some system manufacturers disable these
extensions by default.
AMD systems only require that the IOMMU is enabled in the BIOS. The system is ready for PCI
passthrough once the IOMMU is enabled.

Adding a PCI device with virsh

Need to follow the below steps
1. Identify the device
Identify the PCI device designated for passthrough to the guest. The virsh nodedev-list
command lists all devices attached to the system. The --tree option is useful for identifying
devices attached to the PCI device (for example, disk controllers and USB controllers).
# virsh nodedev-list --tree
For a list of only PCI devices, run the following command:
# virsh nodedev-list | grep pci
In the output from this command, each PCI device is identified by a string, as shown in the
[root@speedRHEV ~]# virsh nodedev-list | grep pci

We can identify the pci device with the command output “lspci –vv”

2. Information on the domain, bus and function are available from output of the virsh nodedevdumpxml command:
[root@speedRHEV ~]# virsh nodedev-dumpxml pci_0000_0a_00_0
<capability type='pci'>
<product id='0x0072'>SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon]</product>
<vendor id='0x1000'>LSI Logic / Symbios Logic</vendor>

Above is the HBA card which we need to assign to the virtual host directly .
3. Detach the device from the system. Attached devices cannot be used and may cause various errors if connected to a guest without detaching first.

# virsh nodedev-dettach pci_0000_0a_00_0
Device pci_0000_0a_00_0detached
4. Convert slot and function values to hexadecimal values (from decimal) to get the PCI bus
addresses. Append "0x" to the beginning of the output to tell the computer that the value is ahexadecimal number. And use the value

5.Run virsh edit (or virsh attach device) and added a device entry in the <devices> section to attach the PCI device to the guest.
And add the below line

# virsh edit speedbkp
<hostdev mode='subsystem' type='pci' managed='yes'>
<address domain='0x0000' bus='0x00' slot='0x1a' function='0x7'/>

6. Once the guest system is configured to use the PCI address, the host system must be configured
to stop using the device. The ehci driver is loaded by default for the HBA PCI controller.

7.Detach the device:
$ virsh nodedev-dettach pci_0000_0a_00_0

9. Set a sebool to allow the management of the PCI device from the guest:
$ setsebool -P virt_manage_sysfs 1

10. Start the guest system :
# virsh start speedbkp
The PCI device should now be successfully attached to the guest and accessible to the guest
Operating system.

After start the use of HBA card on backup server we can not use the same device on virtual host server.

We can add the hardware by virtual console manager also with the same procedure as we have discussed above
Old 06-26-2013, 06:19 AM   #3
LQ Newbie
Registered: Jun 2013
Posts: 10
Blog Entries: 2

Original Poster
Rep: Reputation: 0
Seems procedure is fine .May be some issues with thw hardware (DEL) .As DEL also tested in LAB but it was not working .
Old 06-26-2013, 08:36 PM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
If you get any more issues, I'd recommend using the Report button to ask the Modes to move this to the Virtualisation forum.
Ditto for new qns about Virt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get snapshot backup the KVM Virtual Guest ? splinux Linux - Virtualization and Cloud 0 06-30-2012 02:06 AM
[SOLVED] KVM/libvirt - all traffic from eth0 to virtual guest ericson007 Linux - Virtualization and Cloud 3 04-02-2012 10:43 PM
Can KVM access a Hyper-V virtual machine directly Nick_C Linux - Virtualization and Cloud 4 03-05-2012 11:12 AM
Read guest virtual memory in KVM raghu2383 Linux - Virtualization and Cloud 0 11-29-2010 05:08 AM
Assign IP to Guest VM in KVM vzxen Linux - Virtualization and Cloud 9 09-28-2010 05:14 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration