<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>Hi again :-)</div>
<div> </div>
<div>Upgraded my env - Centos 7.1 host, ovirt 3.6, libvirt-1.2.8-16.el7_1.5.x86_64.</div>
<div> </div>
<div>With "sgio='filtered'" in my scsi host-device-assignment xml I'm getting:</div>
<div><font face="Courier New" size="2" color="#0070C0"><span style="font-size:10pt;">"internal error: 'sgio' is not supported for SCSI generic device yet"</span></font></div>
<div> </div>
<div>Without it I'm getting:</div>
<div><font face="Courier New" size="2" color="#0070C0"><span style="font-size:10pt;">"internal error: Failed to open /sys/bus/scsi/devices/12:0:0:0/scsi_generic"</span></font></div>
<div> </div>
<div>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:</div>
<div><font face="Courier New" size="2" color="#0070C0"><span style="font-size:10pt;"># for i in `ls -1 /sys/bus/scsi/devices` ; do cat $i/scsi_generic ; done 2> /dev/null</span></font></div>
<div><font face="Courier New" size="2" color="#0070C0"><span style="font-size:10pt;">#</span></font></div>
<div> </div>
<div>My scenario includes multiple VMs which use the same host HBA, each VM access its own mapped volumes on a storage server (over FC).</div>
<div>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.</div>
<div>Assigning PCI to the guest is also impossible because the PCI should be used by multiple VMs.</div>
<div> </div>
<div>Is there a way to fulfil my requirements using libvirt+qemu?</div>
<div> </div>
<div>-----Original Message-----<br>

From: sendmail [<a href="mailto:justsendmailnothingelse@gmail.com">mailto:justsendmailnothingelse@gmail.com</a>] On Behalf Of Laine Stump<br>

Sent: Tuesday, February 09, 2016 2:13 AM<br>

To: libvirt-users@redhat.com<br>

Cc: Vaknin, Rami; Michal Privoznik<br>

Subject: Re: [libvirt-users] Getting "unknown device type" when attaching NPIV (vHBA) to vm</div>
<div> </div>
<div>On 02/08/2016 06:01 PM, Vaknin, Rami wrote:</div>
<div>> Thank you for your reply,</div>
<div>> I'm still getting hard time to attach the hostdev, I couldn't make it work out of the doc.</div>
<div>></div>
<div>> I took the address details from:</div>
<div>></div>
<div>> # ll /sys/bus/scsi/devices/7:*</div>
<div>> lrwxrwxrwx 1 root root 0 Feb  8 12:58 /sys/bus/scsi/devices/7:0:0:0 -> </div>
<div>> ../../../devices/pci0000:00/0000:00:03.0/0000:08:00.1/host7/rport-7:0-</div>
<div>> 0/target7:0:0/7:0:0:0 lrwxrwxrwx 1 root root 0 Feb  8 12:58 </div>
<div>> /sys/bus/scsi/devices/7:0:1:0 -> </div>
<div>> ../../../devices/pci0000:00/0000:00:03.0/0000:08:00.1/host7/rport-7:0-</div>
<div>> 1/target7:0:1/7:0:1:0 lrwxrwxrwx 1 root root 0 Feb  8 12:58 </div>
<div>> /sys/bus/scsi/devices/7:0:2:0 -> </div>
<div>> ../../../devices/pci0000:00/0000:00:03.0/0000:08:00.1/host7/rport-7:0-</div>
<div>> 2/target7:0:2/7:0:2:0 lrwxrwxrwx 1 root root 0 Feb  8 12:58 </div>
<div>> /sys/bus/scsi/devices/7:0:3:0 -> </div>
<div>> ../../../devices/pci0000:00/0000:00:03.0/0000:08:00.1/host7/rport-7:0-</div>
<div>> 3/target7:0:3/7:0:3:0</div>
<div>></div>
<div>> and added them (7:0:3:0) to this base xml in various formats instead of the default zeros:</div>
<div>></div>
<div>>      <hostdev mode="subsystem" " type="scsi"></div>
<div>>        <source></div>
<div>>          <adapter name="scsi_host7"/></div>
<div>>          <address bus="0" target="0" unit="0"/></div>
<div>>        </source></div>
<div>>        <readonly/></div>
<div>>        <address bus="0" controller="0" target="0" type="drive" unit="0"/></div>
<div>>      </hostdev></div>
<div>></div>
<div>> Libvirt keeps saying:</div>
<div>> " error : virDomainHostdevDefParseXMLSubsys:3091 : XML error: unknown host device source address type 'scsi'"</div>
<div>></div>
<div>> I still can't figure it out, I still have open questions I can't understand from the docs:</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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).</div>
<div> </div>
<div> </div>
<div>></div>
<div>> Am I using the right subsystem type? Or maybe I should attach the host HBA PCI (QLogic) directly?</div>
<div>> Should I use the host scsi_host or should it be the vHBA created uding libvirt?</div>
<div>> How exactly I extract the host address and derives the destination address?</div>
<div>></div>
<div>></div>
<div>></div>
<div>> -----Original Message-----</div>
<div>> From: Michal Privoznik [<a href="mailto:mprivozn@redhat.com">mailto:mprivozn@redhat.com</a>]</div>
<div>> Sent: Wednesday, February 03, 2016 3:49 PM</div>
<div>> To: Vaknin, Rami; <a href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a></div>
<div>> Subject: Re: [libvirt-users] Getting "unknown device type" when </div>
<div>> attaching NPIV (vHBA) to vm</div>
<div>></div>
<div>> On 01.02.2016 22:48, Vaknin, Rami wrote:</div>
<div>>> Hi,</div>
<div>>></div>
<div>>> I'm trying to attach a host FC HBA to VM (NPIV).</div>
<div>>></div>
<div>>> 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.</div>
<div>>> 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.</div>
<div>>></div>
<div>>> Also, when trying to attach the device manually as a live device - I get:</div>
<div>>> 2016-02-01 21:30:24.216+0000: 129764: debug :</div>
<div>>> qemuDomainObjBeginJobInternal:847 : Starting job: modify (async=none)</div>
<div>>> 2016-02-01 21:30:24.216+0000: 129764: error :</div>
<div>>> virDomainDeviceDefParse:8136 : XML error: unknown device type</div>
<div>>></div>
<div>>> Could you please help?</div>
<div>>></div>
<div>>> virsh # nodedev-dumpxml scsi_host6</div>
<div>>> <device></div>
<div>>>    <name>scsi_host6</name></div>
<div>>>    <parent>pci_0000_08_00_0</parent></div>
<div>>>    <capability type='scsi_host'></div>
<div>>>      <host>6</host></div>
<div>>>      <capability type='fc_host'></div>
<div>>>        <wwnn>20000024ff57d848</wwnn></div>
<div>>>        <wwpn>21000024ff57d848</wwpn></div>
<div>>>        <fabric_wwn>20018c604f101321</fabric_wwn></div>
<div>>>      </capability></div>
<div>>>      <capability type='vport_ops' /></div>
<div>>>    </capability></div>
<div>>> </device></div>
<div>>></div>
<div>>></div>
<div>>> virsh # nodedev-dumpxml scsi_host15</div>
<div>>> <device></div>
<div>>>    <name>scsi_host15</name></div>
<div>>>    <parent>scsi_host6</parent></div>
<div>>>    <capability type='scsi_host'></div>
<div>>>      <host>15</host></div>
<div>>>      <capability type='fc_host'></div>
<div>>>        <wwnn>5001a4a84992572a</wwnn></div>
<div>>>        <wwpn>5001a4a76965d7b8</wwpn></div>
<div>>>        <fabric_wwn>20018c604f101321</fabric_wwn></div>
<div>>>      </capability></div>
<div>>>    </capability></div>
<div>>> </device></div>
<div>>></div>
<div>>></div>
<div>>> The xml I appends:</div>
<div>>></div>
<div>>>    <devices></div>
<div>>> ...</div>
<div>>>        <device></div>
<div>>>          <name>scsi_host16</name></div>
<div>>>          <parent>scsi_host7</parent></div>
<div>>>          <capability type="scsi_host"></div>
<div>>>            <host>16</host></div>
<div>>>            <capability type="fc_host"></div>
<div>>>                <wwnn>5001a4a8cd978a73</wwnn></div>
<div>>>                <wwpn>5001a4afa86a7378</wwpn></div>
<div>>>                <fabric_wwn>20018c604f101411</fabric_wwn></div>
<div>>>            </capability></div>
<div>>>        </capability></div>
<div>>>        </device></div>
<div>>>        <device></div>
<div>>>          <name>scsi_host15</name></div>
<div>>>          <parent>scsi_host6</parent></div>
<div>>>          <capability type="scsi_host"></div>
<div>>>            <host>15</host></div>
<div>>>              <capability type="fc_host"></div>
<div>>>                <wwnn>5001a4a84992572a</wwnn></div>
<div>>>                <wwpn>5001a4a76965d7b8</wwpn></div>
<div>>>                <fabric_wwn>20018c604f101321</fabric_wwn></div>
<div>>>              </capability></div>
<div>>>          </capability></div>
<div>>>        </device></div>
<div>>></div>
<div>>>    </devices></div>
<div>>></div>
<div>> This is not how you attach a hostdev to a domain. You need to be looking at <hostdev/>:</div>
<div>></div>
<div>> <a href="http://libvirt.org/formatdomain.html#elementsHostDev">http://libvirt.org/formatdomain.html#elementsHostDev</a></div>
<div>></div>
<div>> Michal</div>
<div>></div>
<div>> _______________________________________________</div>
<div>> libvirt-users mailing list</div>
<div>> <a href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a></div>
<div>> <a href="https://www.redhat.com/mailman/listinfo/libvirt-users">https://www.redhat.com/mailman/listinfo/libvirt-users</a></div>
<div>></div>
<div> </div>
<div> </div>
</span></font>
</body>
</html>