Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1510860 - Reports fullTargets on /hosts/123/iscsidiscover (iSCSI multipath)
Summary: Reports fullTargets on /hosts/123/iscsidiscover (iSCSI multipath)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: ovirt-4.2.0
: ---
Assignee: Ala Hino
QA Contact: Natalie Gavrielov
URL:
Whiteboard:
: 1264777 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-08 10:32 UTC by Simone Tiraboschi
Modified: 2019-01-14 03:18 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Cause: On a multipath iSCSI env, the same target that is exposed by multiple portals in the same target portal group Consequence: Only targets are listed w/o full details Fix: Add a new discoveredTargets that contains all details Result: <discovered_targets> <iscsi_details> <address>10.35.146.129</address> <port>3260</port> <portal>10.35.146.129:3260,1</portal> <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c00</target> </iscsi_details> <iscsi_details> <address>10.35.146.161</address> <port>3260</port> <portal>10.35.146.161:3260,1</portal> <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c01</target> </iscsi_details> <iscsi_details> <address>10.35.146.193</address> <port>3260</port> <portal>10.35.146.193:3260,1</portal> <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c04</target> </iscsi_details> <iscsi_details> <address>10.35.146.225</address> <port>3260</port> <portal>10.35.146.225:3260,1</portal> <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c05</target> </iscsi_details> </discovered_targets>
Clone Of:
Environment:
Last Closed: 2018-01-12 12:56:42 UTC
oVirt Team: Storage
rule-engine: ovirt-4.2+


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 84198 master MERGED Add discoveredTargets property to HostService 2017-11-22 09:39:59 UTC
oVirt gerrit 84200 master MERGED rest: Populate discoveredTargets when executing iscsidiscover 2017-11-23 15:43:16 UTC
oVirt gerrit 84489 model_4.2 MERGED Add discoveredTargets property to HostService 2017-11-22 09:40:18 UTC
oVirt gerrit 84538 master MERGED restapi: Update to model 4.2.26 and model 1.2.15 2017-11-23 14:28:15 UTC
oVirt gerrit 86518 master MERGED Updating the model version to 4.2.28 2018-01-18 07:57:15 UTC

Description Simone Tiraboschi 2017-11-08 10:32:53 UTC
Description of problem:
On a multipath iSCSI env, the same target could be exposed by multiple portals in the same target portal group.

In my example iqn.2017-10.com.redhat.stirabos:he is exposed over 192.168.1.125, 192.168.2.125 and 192.168.3.125 all three portals are part of the same target portal group (tpgt=1).

VDSM handles it as:
2017-11-08 09:55:52,008+0100 INFO  (jsonrpc/6) [vdsm.api] FINISH discoverSendTargets return={'fullTargets': ['192.168.1.125:3260,1 iqn.2017-10.com.redhat.stirabos:data', '192.168.2.125:3260,1 iqn.2017-10.com.redhat.stirabos:data', '192.168.3.125:3260,1 iqn.2017-10.com.redhat.stirabos:data', '192.168.1.125:3260,1 iqn.2017-10.com.redhat.stirabos:he', '192.168.2.125:3260,1 iqn.2017-10.com.redhat.stirabos:he', '192.168.3.125:3260,1 iqn.2017-10.com.redhat.stirabos:he'], 'targets': ['iqn.2017-10.com.redhat.stirabos:data', 'iqn.2017-10.com.redhat.stirabos:data', 'iqn.2017-10.com.redhat.stirabos:data', 'iqn.2017-10.com.redhat.stirabos:he', 'iqn.2017-10.com.redhat.stirabos:he', 'iqn.2017-10.com.redhat.stirabos:he']} from=::ffff:192.168.122.119,51488, flow_id=3de8a7ca-f4ba-4e99-9b02-e1bfe6b60a87, task_id=a0d8ac91-9ec1-4222-ae86-c5aeb4785a23 (api:52)

Where fullTargets contains also portal IP and tpgt info while targets lists contains just target iqn lists.

/hosts/123/iscsidiscover endpoint reports just targets list while fullTargets is needed on a multipath env.

Example (via ansible playbook):
TASK [debug] ******************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "iscsi_targets": {
        "changed": false, 
        "failed": false, 
        "id": "23d8555d-4d16-407e-ab6b-6f777ff20576", 
        "iscsi_targets": [
            "iqn.2017-10.com.redhat.stirabos:data", 
            "iqn.2017-10.com.redhat.stirabos:data", 
            "iqn.2017-10.com.redhat.stirabos:data", 
            "iqn.2017-10.com.redhat.stirabos:he", 
            "iqn.2017-10.com.redhat.stirabos:he", 
            "iqn.2017-10.com.redhat.stirabos:he"
        ]
    }
}



Version-Release number of selected component (if applicable):
4.2

How reproducible:
100%

Steps to Reproduce:
1. launch iSCSI discover from REST API (/hosts/123/iscsidiscover) on multipath env
2.
3.

Actual results:
Only targets list with duplicates is in the result

Expected results:
fullTargets with portal and tpgt info is there.

Additional info:
it's needed to enable iSCSI multipath

Comment 1 Juan Hernández 2017-11-08 10:41:02 UTC
I suggest that we deprecate the current `iscsi_targets` output parameter of the `iscsidiscover` operation, and replace it with a new one, maybe `discovered_targets`, that contains all the required details. We can use for that the existing `IscsiDetails` type:

  @Out IscsiDetails[] discoveredTargets();

Comment 2 Allon Mureinik 2017-11-08 14:30:00 UTC
Juan - can you explain why we should deprecate the current output parameter? Why not enhance it with the missing details?

Comment 3 Juan Hernández 2017-11-08 14:37:44 UTC
The current parameter is an array of strings:

  @Out String[] iscsiTargets();

We can't enhance it, it isn't possible to enhance strings, and we can't change the type because it breaks backwards compatibility.

Comment 4 Allon Mureinik 2017-11-08 14:42:44 UTC
(In reply to Juan Hernández from comment #3)
> The current parameter is an array of strings:
> 
>   @Out String[] iscsiTargets();
> 
> We can't enhance it, it isn't possible to enhance strings, and we can't
> change the type because it breaks backwards compatibility.
The was stupid of me...
Thanks!

Comment 5 Allon Mureinik 2017-11-08 14:43:01 UTC
Simone - my gut instinct is to defer this to 4.3. Is there a pressing need for it in 4.2 (e.g., as part of the HE work?)

Comment 6 Simone Tiraboschi 2017-11-08 16:50:51 UTC
(In reply to Allon Mureinik from comment #5)
> Simone - my gut instinct is to defer this to 4.3. Is there a pressing need
> for it in 4.2 (e.g., as part of the HE work?)

In the current hosted-engine-setup we are gathering fullTargets directly from vdsm and we are consuming also tpgt to enable multi-path connecting different targets over the different portals of a portal group.

We are working on a brand new hosted-engine-setup flow where we are using a locally running engine to bootstrap the system avoid directly interacting with vdsm (we could skip importing hosted engine stuff from the engine since everything is already there, we could have just one storage domain and so on...).
We want to replicate in the new flow whatever is in the current setup (possibly including iSCSI multi-path support).

Comment 7 Allon Mureinik 2017-11-09 12:13:03 UTC
Let's see if we it will make it for 4.2 then.

Ala - can you shortloop this please?

Comment 8 Ala Hino 2017-11-09 12:15:43 UTC
(In reply to Allon Mureinik from comment #7)
> Let's see if we it will make it for 4.2 then.
> 
> Ala - can you shortloop this please?

Ack - on it

Comment 9 Simone Tiraboschi 2017-11-09 12:37:19 UTC
Thanks Allon,
another thing before making you working for nothing.

In order to close the loop we have also to create the iSCSI storage domain, and we are trying to do it via ansible module, passing the different portal addresses plus the target portal group tag to the engine.

According to latest documentation ( http://docs.ansible.com/ansible/latest/ovirt_storage_domains_module.html ), ovirt_storage_domains ansible module for sure lacks this capability.
Maybe is worth also to double check that everything is there at API level.

Comment 10 Ala Hino 2017-11-15 15:24:15 UTC
@Simone,

Would the following info be enough?

<action>
    <discovered_targets>
        <iscsi_details>
            <address>10.35.1.72</address>
            <port>3260</port>
            <target>iqn.2015-08.com.ahino:444</target>
        </iscsi_details>
    </discovered_targets>
    <iscsi>
        <address>bs-scsi.usersys.redhat.com</address>
    </iscsi>
    <iscsi_targets>
        <iscsi_target>iqn.2015-08.com.ahino:444</iscsi_target>
    </iscsi_targets>
    <status>complete</status>
</action>

Comment 11 Ala Hino 2017-11-15 20:35:21 UTC
(In reply to Ala Hino from comment #10)
> @Simone,
> 
> Would the following info be enough?
> 
> <action>
>     <discovered_targets>
>         <iscsi_details>
>             <address>10.35.1.72</address>
>             <port>3260</port>
>             <target>iqn.2015-08.com.ahino:444</target>
>         </iscsi_details>
>     </discovered_targets>
>     <iscsi>
>         <address>bs-scsi.usersys.redhat.com</address>
>     </iscsi>
>     <iscsi_targets>
>         <iscsi_target>iqn.2015-08.com.ahino:444</iscsi_target>
>     </iscsi_targets>
>     <status>complete</status>
> </action>

Specifically, should 'portal', 'serial', 'productId', and 'vendorId' attributes be added?

Comment 12 Simone Tiraboschi 2017-11-15 21:04:15 UTC
(In reply to Ala Hino from comment #10)
> @Simone,
> 
> Would the following info be enough?

I think it still misses the tpgt (target portal group tag) field to match the portals of the same portal group.

> Specifically, should 'portal', 'serial', 'productId', and 'vendorId' attributes be added?

Maybe you are calling here 'portal' the 'tgpt' field, others are not relevant for hosted-engine-setup.

Comment 13 Ala Hino 2017-11-15 21:53:24 UTC
Will return the following:

        <iscsi_details>
            <address>10.35.1.72</address>
            <port>3260</port>
            <portal>10.35.1.72:3260,1</portal>
            <target>iqn.2015-08.com.ahino:444</target>
        </iscsi_details>

Please confirm that this is what you expect to get.

Comment 14 Simone Tiraboschi 2017-11-16 08:20:36 UTC
(In reply to Ala Hino from comment #13)
> Please confirm that this is what you expect to get.

Yes, it is. Thanks.

Comment 15 Natalie Gavrielov 2018-01-01 15:21:26 UTC
Verified using builds:
rhvm-4.2.0.2-0.1.el7.noarch
vdsm-4.20.9.3-1.el7ev.x86_64

Example output for iscsidiscover:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
    <discovered_targets>
        <iscsi_details>
            <address>1.2.3.4</address>
            <port>1234</port>
            <portal>1.2.3.4:1234,1</portal>
            <target>iqn.1234-01.com.xtremio:xio00123456789-514f0c50023f6c00</target>
        </iscsi_details>
        <iscsi_details>
            <address>10.35.146.161</address>
            <port>1234</port>
            <portal>10.35.146.161:1234,1</portal>
            <target>iqn.1234-01.com.xtremio:xio00123456789-514f0c50023f6c01</target>
        </iscsi_details>
        <iscsi_details>
            <address>10.35.146.193</address>
            <port>1234</port>
            <portal>10.35.146.193:1234,1</portal>
            <target>iqn.1234-01.com.xtremio:xio00123456789-514f0c50023f6c04</target>
        </iscsi_details>
        <iscsi_details>
            <address>10.35.146.225</address>
            <port>1234</port>
            <portal>10.35.146.225:1234,1</portal>
            <target>iqn.1234-01.com.xtremio:xio00123456789-514f0c50023f6c05</target>
        </iscsi_details>
    </discovered_targets>
    <iscsi>
        <address>1.2.3.4</address>
    </iscsi>
    <iscsi_targets>
        <iscsi_target>iqn.1234-01.com.xtremio:xio00123456789-514f0c50023f6c00</iscsi_target>
        <iscsi_target>iqn.1234-01.com.xtremio:xio00123456789-514f0c50023f6c01</iscsi_target>
        <iscsi_target>iqn.1234-01.com.xtremio:xio00123456789-514f0c50023f6c04</iscsi_target>
        <iscsi_target>iqn.1234-01.com.xtremio:xio00123456789-514f0c50023f6c05</iscsi_target>
    </iscsi_targets>
    <status>complete</status>
</action>

Comment 16 Idan Shaby 2018-05-31 05:10:31 UTC
*** Bug 1264777 has been marked as a duplicate of this bug. ***

Comment 17 qiyue 2019-01-11 12:31:07 UTC
hosted-engine-setup
          Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs)[nfs]: iscsi
          Please specify the iSCSI portal IP address: 192.168.2.3
          Please specify the iSCSI portal port [3260]: 
          Please specify the iSCSI discover user: 
          Please specify the iSCSI discover password: 
          Please specify the iSCSI portal login user: 
          Please specify the iSCSI portal login password: 
[ INFO  ] Discovering iSCSI targets
[ INFO  ] TASK [Gathering Facts]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [include_tasks]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [Obtain SSO token using username/password credentials]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [Prepare iSCSI parameters]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [Fetch host facts]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [iSCSI discover with REST API]
[ INFO  ] ok: [localhost]
          The following targets have been found:
          	[1]	iqn.2017-11.com.lenovo:target1
          		TPGT: 1, portals:
          			192.168.2.3:3260

but!!!!

Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs)[nfs]: iscsi
Please specify the iSCSI portal IP address: 192.168.2.3,192.168.2.4
Please specify the iSCSI portal port [3260]: 
...
[ INFO  ] Discovering iSCSI targets
[ INFO  ] TASK [Gathering Facts]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [include_tasks]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [Obtain SSO token using username/password credentials]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [Prepare iSCSI parameters]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [Fetch host facts]
[ INFO  ] ok: [localhost]
[ INFO  ] TASK [iSCSI discover with REST API]
[ ERROR ] fatal: [localhost]: FAILED! => {"changed": false, "connection": "close", "content": "{\n  \"detail\" : \"For correct usage, see: https://engine.tchyp.com/ovirt-engine/apidoc#services/host/methods/iscsi-discover\",\n  \"reason\" : \"Request syntactically incorrect.\"\n}", "content_encoding": "identity", "content_type": "application/json", "correlation_id": "ede67e4b-1e53-4b03-b00d-6fd48f711310", "date": "Fri, 11 Jan 2019 09:35:08 GMT", "json": {"detail": "For correct usage, see: https://engine.tchyp.com/ovirt-engine/apidoc#services/host/methods/iscsi-discover", "reason": "Request syntactically incorrect."}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request", "redirected": false, "server": "Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips", "status": 400, "transfer_encoding": "chunked", "url": "https://engine.tchyp.com/tedge-engine/api/hosts/04b908b8-8b6e-4e6f-b9f1-5590fe7eb1ed/iscsidiscover"}
[ ERROR ] Unable to get target list
          Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs)[nfs]: 
......

why??
please tell me.thanks!


Note You need to log in before you can comment on or make changes to this bug.