Hi again :-)
Upgraded my env - Centos 7.1 host, ovirt 3.6, libvirt-1.2.8-16.el7_1.5.x86_64.
With "sgio='filtered'" in my scsi host-device-assignment xml I'm getting:
"internal error: 'sgio' is not supported for SCSI generic device yet"
Without it I'm getting:
"internal error: Failed to open /sys/bus/scsi/devices/12:0:0:0/scsi_generic"
None of the devices under /sys/bus/scsi/devices have "scsi_generic" file anyway so I'm not yet even in a wrong address situation:
# for i in `ls -1 /sys/bus/scsi/devices` ; do cat $i/scsi_generic ; done 2> /dev/null
#
My scenario includes multiple VMs which use the same host HBA, each VM access its own mapped volumes on a storage server (over FC).
I'd like to create vHBA per VM - the guests OS should handle luns directly without the host OS to intermediate, hence "Direct LUN" or assigning disk to the vm isn't good for me.
Assigning PCI to the guest is also impossible because the PCI should be used by multiple VMs.
Is there a way to fulfil my requirements using libvirt+qemu?
-----Original Message-----
From: sendmail [
mailto:justsendmailnothingelse@gmail.com] On Behalf Of Laine Stump
Sent: Tuesday, February 09, 2016 2:13 AM
To: libvirt-users@redhat.com
Cc: Vaknin, Rami; Michal Privoznik
Subject: Re: [libvirt-users] Getting "unknown device type" when attaching NPIV (vHBA) to vm
On 02/08/2016 06:01 PM, Vaknin, Rami wrote:
> Thank you for your reply,
> I'm still getting hard time to attach the hostdev, I couldn't make it work out of the doc.
>
> I took the address details from:
>
> # ll /sys/bus/scsi/devices/7:*
> lrwxrwxrwx 1 root root 0 Feb 8 12:58 /sys/bus/scsi/devices/7:0:0:0 ->
> ../../../devices/pci0000:00/0000:00:03.0/0000:08:00.1/host7/rport-7:0-
> 0/target7:0:0/7:0:0:0 lrwxrwxrwx 1 root root 0 Feb 8 12:58
> /sys/bus/scsi/devices/7:0:1:0 ->
> ../../../devices/pci0000:00/0000:00:03.0/0000:08:00.1/host7/rport-7:0-
> 1/target7:0:1/7:0:1:0 lrwxrwxrwx 1 root root 0 Feb 8 12:58
> /sys/bus/scsi/devices/7:0:2:0 ->
> ../../../devices/pci0000:00/0000:00:03.0/0000:08:00.1/host7/rport-7:0-
> 2/target7:0:2/7:0:2:0 lrwxrwxrwx 1 root root 0 Feb 8 12:58
> /sys/bus/scsi/devices/7:0:3:0 ->
> ../../../devices/pci0000:00/0000:00:03.0/0000:08:00.1/host7/rport-7:0-
> 3/target7:0:3/7:0:3:0
>
> and added them (7:0:3:0) to this base xml in various formats instead of the default zeros:
>
> <hostdev mode="subsystem" " type="scsi">
> <source>
> <adapter name="scsi_host7"/>
> <address bus="0" target="0" unit="0"/>
> </source>
> <readonly/>
> <address bus="0" controller="0" target="0" type="drive" unit="0"/>
> </hostdev>
>
> Libvirt keeps saying:
> " error : virDomainHostdevDefParseXMLSubsys:3091 : XML error: unknown host device source address type 'scsi'"
>
> I still can't figure it out, I still have open questions I can't understand from the docs:
You said in your original message that you are using libvirt 0.10.2 on CentOS 6. The documentation that Michal pointed you at says that hostdev type='scsi' works only since libvirt 1.0.6 - you are trying to do scsi hostdev which isn't supported in the
version of libvirt you're using.
Depending on your requirements, you may be able to assign the scsi controller (a PCI device) to the guest (but that would require that no other disk on that same controller be in use by the host or another guest). Otherwise you should either assign the
disk with <disk> (which will present an emulated device to the guest, using the contents of /dev/whatever as the content), or build your own libvirt of a later version (not recommended unless you really know what you're doing).
>
> Am I using the right subsystem type? Or maybe I should attach the host HBA PCI (QLogic) directly?
> Should I use the host scsi_host or should it be the vHBA created uding libvirt?
> How exactly I extract the host address and derives the destination address?
>
>
>
> -----Original Message-----
> Sent: Wednesday, February 03, 2016 3:49 PM
> Subject: Re: [libvirt-users] Getting "unknown device type" when
> attaching NPIV (vHBA) to vm
>
> On 01.02.2016 22:48, Vaknin, Rami wrote:
>> Hi,
>>
>> I'm trying to attach a host FC HBA to VM (NPIV).
>>
>> Running ovirt 3.5 on CentOS 6.7, libvirt-0.10.2-46.el6_6.6.x86_64, I created vHBA using nodedev-create command - see below HBA and vHBA.
>> I wrote a vdsm hook which appends the vHBA xml stanza to the devices xml element but the vm start starts without the vHBA device.
>>
>> Also, when trying to attach the device manually as a live device - I get:
>> 2016-02-01 21:30:24.216+0000: 129764: debug :
>> qemuDomainObjBeginJobInternal:847 : Starting job: modify (async=none)
>> 2016-02-01 21:30:24.216+0000: 129764: error :
>> virDomainDeviceDefParse:8136 : XML error: unknown device type
>>
>> Could you please help?
>>
>> virsh # nodedev-dumpxml scsi_host6
>> <device>
>> <name>scsi_host6</name>
>> <parent>pci_0000_08_00_0</parent>
>> <capability type='scsi_host'>
>> <host>6</host>
>> <capability type='fc_host'>
>> <wwnn>20000024ff57d848</wwnn>
>> <wwpn>21000024ff57d848</wwpn>
>> <fabric_wwn>20018c604f101321</fabric_wwn>
>> </capability>
>> <capability type='vport_ops' />
>> </capability>
>> </device>
>>
>>
>> virsh # nodedev-dumpxml scsi_host15
>> <device>
>> <name>scsi_host15</name>
>> <parent>scsi_host6</parent>
>> <capability type='scsi_host'>
>> <host>15</host>
>> <capability type='fc_host'>
>> <wwnn>5001a4a84992572a</wwnn>
>> <wwpn>5001a4a76965d7b8</wwpn>
>> <fabric_wwn>20018c604f101321</fabric_wwn>
>> </capability>
>> </capability>
>> </device>
>>
>>
>> The xml I appends:
>>
>> <devices>
>> ...
>> <device>
>> <name>scsi_host16</name>
>> <parent>scsi_host7</parent>
>> <capability type="scsi_host">
>> <host>16</host>
>> <capability type="fc_host">
>> <wwnn>5001a4a8cd978a73</wwnn>
>> <wwpn>5001a4afa86a7378</wwpn>
>> <fabric_wwn>20018c604f101411</fabric_wwn>
>> </capability>
>> </capability>
>> </device>
>> <device>
>> <name>scsi_host15</name>
>> <parent>scsi_host6</parent>
>> <capability type="scsi_host">
>> <host>15</host>
>> <capability type="fc_host">
>> <wwnn>5001a4a84992572a</wwnn>
>> <wwpn>5001a4a76965d7b8</wwpn>
>> <fabric_wwn>20018c604f101321</fabric_wwn>
>> </capability>
>> </capability>
>> </device>
>>
>> </devices>
>>
> This is not how you attach a hostdev to a domain. You need to be looking at <hostdev/>:
>
>
> Michal
>
> _______________________________________________
> libvirt-users mailing list
>