<div dir="ltr"><div><div>Hello All,<br><br></div>I would like to get some feedback on the update I would like to make to this page. <br> <a href="http://wiki.libvirt.org/page/NPIV_in_libvirt">http://wiki.libvirt.org/page/NPIV_in_libvirt</a><br><br></div>Original Content : <b><br>NOTE:</b> You can also create a scsi pool with source adapter type "fc_host"
for a HBA, and in that case the attribute "parent" is not necessary.
<br><p><br></p><p>Patched Content:<br><b>NOTE:</b> You can also create a scsi pool with source adapter type "fc_host"
for a HBA, and in that case the attribute "parent" is not necessary.Also the attribute "managed" should not be used or set to "no" , ('managed=no' ) for  a scsi pool backed with physical HBA.</p><p></p><p>Here are the details for more clarity on the issue:<br></p><p>#git show 5530f248 (Info on managed attribute)<br></p><p>An optional attribute to instruct the SCSI storage backend to<br>manage destroying the vHBA when the pool is destroyed. For<br>configurations that do not provide an already created vHBA<br>from a 'virsh nodedev-create', libvirt will set this property<br>to "yes". For configurations that have already created a vHBA<br>via 'virsh nodedev-create' and are using the wwnn/wwpn from<br>that vHBA and optionally the scsi_host parent, setting this<br>attribute to "yes" will allow libvirt to destroy the node device<br>when the pool is destroyed. If this attribute is set to "no" or<br>not defined in the XML, then libvirt will not destroy the vHBA.<br><br></p><p>When <b>managed=yes</b> is used in the pool xml for scsi pools  <b>backed with physical HBA ports</b>, the virsh pool-destroy command errors out.<br></p><pre class="" id="comment_text_0">#virsh pool-dumpxml poolhba_phy
<pool type='scsi'>
  <name>poolhba_phy</name>
  <uuid>60d74134-0c18-4d4f-9305-24d96ce1a1b6</uuid>
  <capacity unit='bytes'>268435456000</capacity>
  <allocation unit='bytes'>268435456000</allocation>
  <available unit='bytes'>0</available>
  <source>
    <adapter type='fc_host' <b>managed='yes'</b> <b>wwnn='20000120fa8f1271' wwpn='10000090fa8f1271'</b>/>
  </source>
  <target>
    <path>/dev/disk/by-id</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool></pre><p>The wwnn and wwpn used above is that of the physical HBA shown below.<br></p><p></p><pre class="" id="comment_text_0">#virsh nodedev-dumpxml scsi_host2 <- This is the physical HBA.
<device>
  <name>scsi_host2</name>
  <path>/sys/devices/pci0001:00/0001:00:00.0/0001:01:00.0/0001:02:09.0/0001:09:00.1/host2</path>
  <b><parent>pci_0001_09_00_1</parent></b>
  <capability type='scsi_host'>
    <host>2</host>
    <unique_id>1</unique_id>
    <capability type='fc_host'>
      <b><wwnn>20000120fa8f1271</wwnn>
      <wwpn>10000090fa8f1271</wwpn></b>
      <fabric_wwn>100050eb1a99d430</fabric_wwn>
    </capability>
    <capability type='vport_ops'>
      <max_vports>255</max_vports>
      <vports>0</vports>
    </capability>
  </capability>
</device></pre><pre class="" id="comment_text_4">#virsh pool-destroy poolhba_phy
error: Failed to destroy pool poolhba_phy
error: internal error: Invalid adapter name 'pci_0001_09_00_1' for SCSI pool</pre><p><br></p><p>However, <br></p><p>When managed attribute is removed OR set to no in the xml, <br></p><pre class="" id="comment_text_6"><span style="font-family:arial black,sans-serif"># virsh pool-destroy poolhba_phy
Pool poolhba_phy destroyed<br><br>Although the page <a href="http://wiki.libvirt.org/page/NPIV_in_libvirt">http://wiki.libvirt.org/page/NPIV_in_libvirt</a> does not talk about the managed attribute as of now, it would be helpful for a user who might face the above mentioned use-case. <br></span></pre><pre class="" id="comment_text_6"><span style="font-family:arial black,sans-serif">Looking forward to your views. <br><br>Warm Regards,<br>Nitesh Konkar. </span><br></pre></div>