[libvirt] [PATCH v4 9/9] docs: Add vhost-scsi

Eric Farman posted 9 patches 9 years, 2 months ago
[libvirt] [PATCH v4 9/9] docs: Add vhost-scsi
Posted by Eric Farman 9 years, 2 months ago
Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
---
 docs/formatdomain.html.in | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 4e40aa1..6bd02cc 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3694,6 +3694,17 @@
 &lt;/devices&gt;
 ...</pre>
 
+    <p>or:</p>
+
+<pre>
+  ...
+  &lt;devices&gt;
+    &lt;hostdev mode='subsystem' type='scsi_host'&gt;
+      &lt;source protocol='vhost' wwpn='naa.50014057667280d8'/&gt;
+    &lt;/hostdev&gt;
+  &lt;/devices&gt;
+  ...</pre>
+
     <dl>
       <dt><code>hostdev</code></dt>
       <dd>The <code>hostdev</code> element is the main container for describing
@@ -3732,6 +3743,12 @@
             If a disk lun in the domain already has the rawio capability,
             then this setting not required.
           </dd>
+          <dt><code>scsi_host</code></dt>
+          <dd><span class="since">since 2.5.0</span>For SCSI devices, user
+            is responsible to make sure the device is not used by host. This
+            <code>type</code> passes all LUNs presented by a single HBA to
+            the guest.
+          </dd>
         </dl>
         <p>
           Note: The <code>managed</code> attribute is only used with PCI devices
@@ -3795,6 +3812,13 @@
             credentials to the iSCSI server.
             </p>
           </dd>
+          <dt><code>scsi_host</code></dt>
+          <dd><span class="since">Since 2.5.0</span>, multiple LUNs behind a
+            single SCSI HBA are described by a <code>protocol</code>
+            attribute set to "vhost" and a <code>wwpn</code> attribute that
+            is the vhost_scsi wwpn (16 hexadecimal digits with a prefix of
+            "naa.") established in the host configfs.
+          </dd>
         </dl>
       </dd>
       <dt><code>vendor</code>, <code>product</code></dt>
-- 
1.9.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 9/9] docs: Add vhost-scsi
Posted by John Ferlan 9 years, 2 months ago

On 11/21/2016 10:58 PM, Eric Farman wrote:
> Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
> ---
>  docs/formatdomain.html.in | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 

This will get squashed in with the conf patch. I'll also generate the
news.html.in entry:

          <li>vhost-scsi: Add support scsi_host hostdev passthrough<br/>
          Add the capability to pass through a scsi_host HBA and the
          associated LUNs to the guest.
          </li>


ACK -

I'll push these in a bit, just seeing what I get on my test system... Of
course I'm also curious what would happen if I try to pass through a
vHBA ;-)...


John
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 4e40aa1..6bd02cc 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -3694,6 +3694,17 @@
>  &lt;/devices&gt;
>  ...</pre>
>  
> +    <p>or:</p>
> +
> +<pre>
> +  ...
> +  &lt;devices&gt;
> +    &lt;hostdev mode='subsystem' type='scsi_host'&gt;
> +      &lt;source protocol='vhost' wwpn='naa.50014057667280d8'/&gt;
> +    &lt;/hostdev&gt;
> +  &lt;/devices&gt;
> +  ...</pre>
> +
>      <dl>
>        <dt><code>hostdev</code></dt>
>        <dd>The <code>hostdev</code> element is the main container for describing
> @@ -3732,6 +3743,12 @@
>              If a disk lun in the domain already has the rawio capability,
>              then this setting not required.
>            </dd>
> +          <dt><code>scsi_host</code></dt>
> +          <dd><span class="since">since 2.5.0</span>For SCSI devices, user
> +            is responsible to make sure the device is not used by host. This
> +            <code>type</code> passes all LUNs presented by a single HBA to
> +            the guest.
> +          </dd>
>          </dl>
>          <p>
>            Note: The <code>managed</code> attribute is only used with PCI devices
> @@ -3795,6 +3812,13 @@
>              credentials to the iSCSI server.
>              </p>
>            </dd>
> +          <dt><code>scsi_host</code></dt>
> +          <dd><span class="since">Since 2.5.0</span>, multiple LUNs behind a
> +            single SCSI HBA are described by a <code>protocol</code>
> +            attribute set to "vhost" and a <code>wwpn</code> attribute that
> +            is the vhost_scsi wwpn (16 hexadecimal digits with a prefix of
> +            "naa.") established in the host configfs.
> +          </dd>
>          </dl>
>        </dd>
>        <dt><code>vendor</code>, <code>product</code></dt>
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 9/9] docs: Add vhost-scsi
Posted by Eric Farman 9 years, 2 months ago

On 11/22/2016 04:16 PM, John Ferlan wrote:
>
> On 11/21/2016 10:58 PM, Eric Farman wrote:
>> Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
>> ---
>>   docs/formatdomain.html.in | 24 ++++++++++++++++++++++++
>>   1 file changed, 24 insertions(+)
>>
> This will get squashed in with the conf patch. I'll also generate the
> news.html.in entry:
>
>            <li>vhost-scsi: Add support scsi_host hostdev passthrough<br/>
>            Add the capability to pass through a scsi_host HBA and the
>            associated LUNs to the guest.
>            </li>
>
>
> ACK -
>
> I'll push these in a bit, just seeing what I get on my test system... Of
> course I'm also curious what would happen if I try to pass through a
> vHBA ;-)...

Many thanks, John!  And let me know if that bubbles up your list; I'm 
curious what would happen too.  :-)

  - Eric

>
>
> John
>> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
>> index 4e40aa1..6bd02cc 100644
>> --- a/docs/formatdomain.html.in
>> +++ b/docs/formatdomain.html.in
>> @@ -3694,6 +3694,17 @@
>>   &lt;/devices&gt;
>>   ...</pre>
>>   
>> +    <p>or:</p>
>> +
>> +<pre>
>> +  ...
>> +  &lt;devices&gt;
>> +    &lt;hostdev mode='subsystem' type='scsi_host'&gt;
>> +      &lt;source protocol='vhost' wwpn='naa.50014057667280d8'/&gt;
>> +    &lt;/hostdev&gt;
>> +  &lt;/devices&gt;
>> +  ...</pre>
>> +
>>       <dl>
>>         <dt><code>hostdev</code></dt>
>>         <dd>The <code>hostdev</code> element is the main container for describing
>> @@ -3732,6 +3743,12 @@
>>               If a disk lun in the domain already has the rawio capability,
>>               then this setting not required.
>>             </dd>
>> +          <dt><code>scsi_host</code></dt>
>> +          <dd><span class="since">since 2.5.0</span>For SCSI devices, user
>> +            is responsible to make sure the device is not used by host. This
>> +            <code>type</code> passes all LUNs presented by a single HBA to
>> +            the guest.
>> +          </dd>
>>           </dl>
>>           <p>
>>             Note: The <code>managed</code> attribute is only used with PCI devices
>> @@ -3795,6 +3812,13 @@
>>               credentials to the iSCSI server.
>>               </p>
>>             </dd>
>> +          <dt><code>scsi_host</code></dt>
>> +          <dd><span class="since">Since 2.5.0</span>, multiple LUNs behind a
>> +            single SCSI HBA are described by a <code>protocol</code>
>> +            attribute set to "vhost" and a <code>wwpn</code> attribute that
>> +            is the vhost_scsi wwpn (16 hexadecimal digits with a prefix of
>> +            "naa.") established in the host configfs.
>> +          </dd>
>>           </dl>
>>         </dd>
>>         <dt><code>vendor</code>, <code>product</code></dt>
>>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 9/9] docs: Add vhost-scsi
Posted by Jim Fehlig 9 years, 2 months ago
On 11/22/2016 02:16 PM, John Ferlan wrote:
>
>
> On 11/21/2016 10:58 PM, Eric Farman wrote:
>> Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
>> ---
>>  docs/formatdomain.html.in | 24 ++++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>
>
> This will get squashed in with the conf patch. I'll also generate the
> news.html.in entry:
>
>           <li>vhost-scsi: Add support scsi_host hostdev passthrough<br/>
>           Add the capability to pass through a scsi_host HBA and the
>           associated LUNs to the guest.
>           </li>
>
>
> ACK -
>
> I'll push these in a bit, just seeing what I get on my test system... Of
> course I'm also curious what would happen if I try to pass through a
> vHBA ;-)...

I have unsuccessfully tried it, but not sure how to correctly specify the vHBA 
in domXML.

First, create a vHBA:
cat vhba.xml
<device>
    <parent_wwpn>2100001b32847342</parent_wwpn>
    <parent_wwnn>2000001b32847342</parent_wwnn>
    <capability type='scsi_host'>
      <capability type='fc_host'>
       <wwnn>9990100000000001</wwnn>
       <wwpn>9990000000000001</wwpn>
       </capability>
    </capability>
</device>
virsh nodedev-create vhba.xml

(@John: Notice I'm using your "Allow creation of vHBA by parent_wwnn/wwpn or 
fabric_name" series. I'll try to respond with review comments on that series 
tomorrow.)

Add the vHBA to domain config using a variant of Eric's example:
   <hostdev mode='subsystem' type='scsi_host'>
     <source protocol='vhost' wwpn='naa.9990000000000001'/>
     <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x1000'/>
   </hostdev>

Start the VM:
virsh start test
error: Failed to start domain test
error: Path '/sys/kernel/config/target/vhost//naa.5001405df3e54061' is not 
accessible: No such file or directory

It looks like this patch series only handles scsi_host created with targetcli, 
but I didn't look at all the patches closely. Is it possible to use vhost-scsi 
with NPIV vport (vHBA)? If so, any pointers on how to specify the vHBA in 
<hostdev> element?

Regards,
Jim

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 9/9] docs: Add vhost-scsi
Posted by Eric Farman 9 years, 2 months ago

On 12/07/2016 08:16 PM, Jim Fehlig wrote:
> On 11/22/2016 02:16 PM, John Ferlan wrote:
>>
>>
>> On 11/21/2016 10:58 PM, Eric Farman wrote:
>>> Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
>>> ---
>>>  docs/formatdomain.html.in | 24 ++++++++++++++++++++++++
>>>  1 file changed, 24 insertions(+)
>>>
>>
>> This will get squashed in with the conf patch. I'll also generate the
>> news.html.in entry:
>>
>>           <li>vhost-scsi: Add support scsi_host hostdev passthrough<br/>
>>           Add the capability to pass through a scsi_host HBA and the
>>           associated LUNs to the guest.
>>           </li>
>>
>>
>> ACK -
>>
>> I'll push these in a bit, just seeing what I get on my test system... Of
>> course I'm also curious what would happen if I try to pass through a
>> vHBA ;-)...
>
> I have unsuccessfully tried it, but not sure how to correctly specify 
> the vHBA in domXML.
>
> First, create a vHBA:
> cat vhba.xml
> <device>
>    <parent_wwpn>2100001b32847342</parent_wwpn>
>    <parent_wwnn>2000001b32847342</parent_wwnn>
>    <capability type='scsi_host'>
>      <capability type='fc_host'>
>       <wwnn>9990100000000001</wwnn>
>       <wwpn>9990000000000001</wwpn>
>       </capability>
>    </capability>
> </device>
> virsh nodedev-create vhba.xml
>
> (@John: Notice I'm using your "Allow creation of vHBA by 
> parent_wwnn/wwpn or fabric_name" series. I'll try to respond with 
> review comments on that series tomorrow.)

(@John:  Me too :)

>
> Add the vHBA to domain config using a variant of Eric's example:
>   <hostdev mode='subsystem' type='scsi_host'>
>     <source protocol='vhost' wwpn='naa.9990000000000001'/>
>     <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x1000'/>
>   </hostdev>
>
> Start the VM:
> virsh start test
> error: Failed to start domain test
> error: Path '/sys/kernel/config/target/vhost//naa.5001405df3e54061' is 
> not accessible: No such file or directory

Eh?  Where did "5001..." come from?  Given the above hostdev snippet, I 
would've expected this to show "99900..."

Also, if you're not using an s390 machine, the address should probably 
be type='pci' or omitted altogether.

>
> It looks like this patch series only handles scsi_host created with 
> targetcli, but I didn't look at all the patches closely. 

Today, yes.  But more specifically, it's only handling scsi_host that 
connects to the vhost_scsi target, thus the 
"/sys/kernel/config/target/vhost/" prefix.  The NPIV vport is at a 
different locale.

> Is it possible to use vhost-scsi with NPIV vport (vHBA)? If so, any 
> pointers on how to specify the vHBA in <hostdev> element?

This vhost-scsi series had to do some trickery rather than relying on 
virsh nodedev-list for data.  Looking at John's series, I suspect 
there's some additional work necessary for the vport-capable sysfs 
entries than what exists with this series.  Some of which I deferred 
from an earlier review comment.

  - Eric

>
> Regards,
> Jim
>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 9/9] docs: Add vhost-scsi
Posted by Jim Fehlig 9 years, 2 months ago
Eric Farman wrote:
> 
> 
> On 12/07/2016 08:16 PM, Jim Fehlig wrote:
>> On 11/22/2016 02:16 PM, John Ferlan wrote:
>>>
>>>
>>> On 11/21/2016 10:58 PM, Eric Farman wrote:
>>>> Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
>>>> ---
>>>>  docs/formatdomain.html.in | 24 ++++++++++++++++++++++++
>>>>  1 file changed, 24 insertions(+)
>>>>
>>>
>>> This will get squashed in with the conf patch. I'll also generate the
>>> news.html.in entry:
>>>
>>>           <li>vhost-scsi: Add support scsi_host hostdev passthrough<br/>
>>>           Add the capability to pass through a scsi_host HBA and the
>>>           associated LUNs to the guest.
>>>           </li>
>>>
>>>
>>> ACK -
>>>
>>> I'll push these in a bit, just seeing what I get on my test system... Of
>>> course I'm also curious what would happen if I try to pass through a
>>> vHBA ;-)...
>>
>> I have unsuccessfully tried it, but not sure how to correctly specify
>> the vHBA in domXML.
>>
>> First, create a vHBA:
>> cat vhba.xml
>> <device>
>>    <parent_wwpn>2100001b32847342</parent_wwpn>
>>    <parent_wwnn>2000001b32847342</parent_wwnn>
>>    <capability type='scsi_host'>
>>      <capability type='fc_host'>
>>       <wwnn>9990100000000001</wwnn>
>>       <wwpn>9990000000000001</wwpn>
>>       </capability>
>>    </capability>
>> </device>
>> virsh nodedev-create vhba.xml
>>
>> (@John: Notice I'm using your "Allow creation of vHBA by
>> parent_wwnn/wwpn or fabric_name" series. I'll try to respond with
>> review comments on that series tomorrow.)
> 
> (@John:  Me too :)
> 
>>
>> Add the vHBA to domain config using a variant of Eric's example:
>>   <hostdev mode='subsystem' type='scsi_host'>
>>     <source protocol='vhost' wwpn='naa.9990000000000001'/>
>>     <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x1000'/>
>>   </hostdev>
>>
>> Start the VM:
>> virsh start test
>> error: Failed to start domain test
>> error: Path '/sys/kernel/config/target/vhost//naa.5001405df3e54061' is
>> not accessible: No such file or directory
> 
> Eh?  Where did "5001..." come from?  Given the above hostdev snippet, I
> would've expected this to show "99900..."
> 
> Also, if you're not using an s390 machine, the address should probably
> be type='pci' or omitted altogether.

Sorry, too much copy and paste between your example and the various configs I
tried. Also too hasty in trying to get the mail out before knocking off for the day.

The actual hostdev config is

  <hostdev mode='subsystem' type='scsi_host'>
    <source protocol='vhost' wwpn='naa.9990000000000001'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
  </hostdev>

and the error

error: Path '/sys/kernel/config/target/vhost//naa.9990000000000001' is not
accessible: No such file or directory

>> It looks like this patch series only handles scsi_host created with
>> targetcli, but I didn't look at all the patches closely. 
> 
> Today, yes.  But more specifically, it's only handling scsi_host that
> connects to the vhost_scsi target, thus the
> "/sys/kernel/config/target/vhost/" prefix.  The NPIV vport is at a
> different locale.
> 
>> Is it possible to use vhost-scsi with NPIV vport (vHBA)? If so, any
>> pointers on how to specify the vHBA in <hostdev> element?
> 
> This vhost-scsi series had to do some trickery rather than relying on
> virsh nodedev-list for data.  Looking at John's series, I suspect
> there's some additional work necessary for the vport-capable sysfs
> entries than what exists with this series.  Some of which I deferred
> from an earlier review comment.

Ok, thanks. I'll see if I can figure out how to make the vports work with
vhost-scsi.

Regards,
Jim

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 9/9] docs: Add vhost-scsi
Posted by John Ferlan 9 years, 2 months ago

On 12/07/2016 08:16 PM, Jim Fehlig wrote:
> On 11/22/2016 02:16 PM, John Ferlan wrote:
>>
>>
>> On 11/21/2016 10:58 PM, Eric Farman wrote:
>>> Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
>>> ---
>>>  docs/formatdomain.html.in | 24 ++++++++++++++++++++++++
>>>  1 file changed, 24 insertions(+)
>>>
>>
>> This will get squashed in with the conf patch. I'll also generate the
>> news.html.in entry:
>>
>>           <li>vhost-scsi: Add support scsi_host hostdev passthrough<br/>
>>           Add the capability to pass through a scsi_host HBA and the
>>           associated LUNs to the guest.
>>           </li>
>>
>>
>> ACK -
>>
>> I'll push these in a bit, just seeing what I get on my test system... Of
>> course I'm also curious what would happen if I try to pass through a
>> vHBA ;-)...
> 
> I have unsuccessfully tried it, but not sure how to correctly specify
> the vHBA in domXML.
> 
> First, create a vHBA:
> cat vhba.xml
> <device>
>    <parent_wwpn>2100001b32847342</parent_wwpn>
>    <parent_wwnn>2000001b32847342</parent_wwnn>
>    <capability type='scsi_host'>
>      <capability type='fc_host'>
>       <wwnn>9990100000000001</wwnn>
>       <wwpn>9990000000000001</wwpn>
>       </capability>
>    </capability>
> </device>
> virsh nodedev-create vhba.xml
> 
> (@John: Notice I'm using your "Allow creation of vHBA by
> parent_wwnn/wwpn or fabric_name" series. I'll try to respond with review
> comments on that series tomorrow.)
> 
> Add the vHBA to domain config using a variant of Eric's example:
>   <hostdev mode='subsystem' type='scsi_host'>
>     <source protocol='vhost' wwpn='naa.9990000000000001'/>
>     <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x1000'/>
>   </hostdev>
> 
> Start the VM:
> virsh start test
> error: Failed to start domain test
> error: Path '/sys/kernel/config/target/vhost//naa.5001405df3e54061' is
> not accessible: No such file or directory
> 
> It looks like this patch series only handles scsi_host created with
> targetcli, but I didn't look at all the patches closely. Is it possible
> to use vhost-scsi with NPIV vport (vHBA)? If so, any pointers on how to
> specify the vHBA in <hostdev> element?
> 

I've been buried by other things, but didn't want to ignore completely...

Unfortunately I haven't found a way to use configure w/ vHBA either - I
really was really hoping something could be done. It would have been so
nice to just use XML that would include the scsi_hostN of the vHBA. I
need to find the time to work through what targetcli does - I think it
creates another scsi_hostN which is essentially what is used.  That'd be
similar enough to what vport_create does. Then it would be (hah!) just a
matter of some code ;-) perhaps...

The example Eric has in the cover used multipath which is not something
I generally configure/use. I found some example using google to not use
multipath, but didn't spend too much time with it. I got it to do
something, but then got pinged to work on something else (you know how
that goes!).

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list