LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-25-2013, 09:32 AM   #1
nsingh63
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, 05:16 AM   #2
nsingh63
LQ Newbie
 
Registered: Jun 2013
Posts: 10

Original Poster
Blog Entries: 2

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.

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
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
pci_0000_00_00_0
pci_0000_00_01_0
pci_0000_00_03_0
pci_0000_00_04_0
pci_0000_00_05_0
pci_0000_00_06_0
pci_0000_00_07_0
pci_0000_00_09_0
pci_0000_00_14_0
pci_0000_00_14_1
pci_0000_00_14_2
pci_0000_00_1a_0
pci_0000_00_1a_1
pci_0000_00_1a_7
pci_0000_00_1d_0
pci_0000_00_1d_1
pci_0000_00_1d_7
pci_0000_00_1e_0
pci_0000_00_1f_0
pci_0000_00_1f_2
pci_0000_01_00_0
pci_0000_01_00_1
pci_0000_02_00_0
pci_0000_02_00_1
pci_0000_03_00_0
pci_0000_04_00_0
pci_0000_05_00_0
pci_0000_06_02_0
pci_0000_06_04_0
pci_0000_07_00_0
pci_0000_07_00_1
pci_0000_08_00_0
pci_0000_08_00_1
pci_0000_09_00_0
pci_0000_0a_00_0
pci_0000_0b_03_0

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
<device>
<name>pci_0000_0a_00_0</name>
<parent>pci_0000_00_09_0</parent>
<driver>
<name>mpt2sas</name>
</driver>
<capability type='pci'>
<domain>0</domain>
<bus>10</bus>
<slot>0</slot>
<function>0</function>
<product id='0x0072'>SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon]</product>
<vendor id='0x1000'>LSI Logic / Symbios Logic</vendor>
</capability>
</device>

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'>
<source>
<address domain='0x0000' bus='0x00' slot='0x1a' function='0x7'/>
</source>
</hostdev>


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, 05:19 AM   #3
nsingh63
LQ Newbie
 
Registered: Jun 2013
Posts: 10

Original Poster
Blog Entries: 2

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, 07:36 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
 
  


Reply



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 01:06 AM
[SOLVED] KVM/libvirt - all traffic from eth0 to virtual guest ericson007 Linux - Virtualization and Cloud 3 04-02-2012 09:43 PM
Can KVM access a Hyper-V virtual machine directly Nick_C Linux - Virtualization and Cloud 4 03-05-2012 10:12 AM
Read guest virtual memory in KVM raghu2383 Linux - Virtualization and Cloud 0 11-29-2010 04:08 AM
Assign IP to Guest VM in KVM vzxen Linux - Virtualization and Cloud 9 09-28-2010 04:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:05 AM.

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