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 1354595 - Discover unregistered iSCSI storage domains is impossible using REST API
Summary: Discover unregistered iSCSI storage domains is impossible using REST API
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: ovirt-4.0.2
: ---
Assignee: Maor
QA Contact: Raz Tamir
URL:
Whiteboard:
: 1371566 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-11 16:18 UTC by Raz Tamir
Modified: 2016-09-05 12:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-13 15:21:34 UTC
oVirt Team: Storage
amureini: ovirt-4.0.z?
rule-engine: blocker?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)
engine and vdsm logs (deleted)
2016-07-11 16:18 UTC, Raz Tamir
no flags Details

Description Raz Tamir 2016-07-11 16:18:37 UTC
Created attachment 1178480 [details]
engine and vdsm logs

Description of problem:
When trying to send a REST request to discover all unregistered storage domains, the response is:
400 Bad Request

body:
<fault>
    <reason>Operation Failed</reason>
    <detail>couldn't connect to the specified targets</detail>
</fault>

From the engine log:
2016-07-11 19:12:43,381 ERROR [org.ovirt.engine.core.bll.storage.domain.GetUnregisteredBlockStorageDomainsQuery] (default task-20) [] Failed to retrieve storage domains by connections info: Couldn't connect to the specified targets
2016-07-11 19:12:43,382 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-20) [] Operation Failed: couldn't connect to the specified targets
2016-07-11 19:12:43,382 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-20) [] Operation Failed: HTTP 400 Bad Request
2016-07-11 19:12:43,382 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-20) [] Exception: org.ovirt.engine.api.restapi.resource.BaseBackendResource$WebFaultException: HTTP 400 Bad Request

Full log attrached


Version-Release number of selected component (if applicable):
rhevm-4.0.2-0.2.rc1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Send POST to api/hosts/{host: id}/unregisteredstoragedomainsdiscover
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2016-07-11 16:30:40 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 2 Raz Tamir 2016-07-11 16:37:35 UTC
The POST request body is:
<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <iscsi>
        <address>STORAGE_SERVER</address>
    </iscsi>
</action>

When STORAGE_SERVER is an iSCSI server

update:
works fine for FCP when no arguments needed for the request according to rsdl:
(
<description>
Discover the block Storage Domains which are candidates to be imported to the setup. For FCP no arguments are needed.
</description>
)

Comment 3 Yaniv Kaul 2016-07-12 09:47:18 UTC
Is this with v3 or v4 of the API?

I assume the following snippet of engine.log is relevant and should be included:

2016-07-11 19:13:00,862 ERROR [org.ovirt.engine.core.bll.storage.domain.GetUnregisteredBlockStorageDomainsQuery] (default task-23) [] Failed to retrieve storage domains by connections info: Couldn't connect to the specified targets
2016-07-11 19:13:00,875 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-23) [] Operation Failed: couldn't connect to the specified targets
2016-07-11 19:13:00,876 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-23) [] Operation Failed: HTTP 400 Bad Request
2016-07-11 19:13:00,876 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-23) [] Exception: org.ovirt.engine.api.restapi.resource.BaseBackendResource$WebFaultException: HTTP 400 Bad Request
	at org.ovirt.engine.api.restapi.resource.BaseBackendResource.handleError(BaseBackendResource.java:230) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.BackendResource.getEntity(BackendResource.java:118) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.BackendResource.getEntity(BackendResource.java:98) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.restapi.resource.BackendHostResource.unregisteredStorageDomainsDiscover(BackendHostResource.java:449) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.v3.V3Server.adaptAction(V3Server.java:216) [restapi-jaxrs.jar:]
	at org.ovirt.engine.api.v3.servers.V3HostServer.unregisteredStorageDomainsDiscover(V3HostServer.java:147) [restapi-jaxrs.jar:]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_101]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_101]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_101]
	at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_101]

Comment 4 Raz Tamir 2016-07-12 10:39:05 UTC
Yaniv,
API v3

Comment 5 Maor 2016-07-12 11:39:34 UTC
It looks like your request doesn't contain any storage server targets.

The call for unregisteredstoragedomainsdiscover should be as follow:

<action>
    <iscsi>
        <address>STORAGE_SERVER</address>
    </iscsi>
    <iscsi_targets>
        <iscsi_target>iqn.2015-07.com.mlipchuk2.redhat:444</iscsi_target>
        <iscsi_target>iqn.2015-07.com.mlipchuk1.redhat:444</iscsi_target>
    </iscsi_targets>
</action>

Comment 6 Maor 2016-07-12 11:51:23 UTC
(In reply to Maor from comment #5)
> It looks like your request doesn't contain any storage server targets.
> 
> The call for unregisteredstoragedomainsdiscover should be as follow:
> 
> <action>
>     <iscsi>
>         <address>STORAGE_SERVER</address>
>     </iscsi>
>     <iscsi_targets>
>         <iscsi_target>iqn.2015-07.com.mlipchuk2.redhat:444</iscsi_target>
>         <iscsi_target>iqn.2015-07.com.mlipchuk1.redhat:444</iscsi_target>
>     </iscsi_targets>
> </action>

This process should be compatible to how it works also for the GUI.
In the GUI we first connect to the storage server.
The equivalent REST step should be :
  /api/hosts/{host_id}/iscsidiscover

  <action>
      <iscsi>
          <address>ISCSI_SERVER_IP</address>
      </iscsi>
  </action>

Then, after the user sees all the targets, he/she connect to the targets he wants to check unregistered SDs.
The equivalent REST step should be :
  /api/hosts/{host_id}/unregisteredstoragedomainsdiscover 

  <action>
    <iscsi>
          <address>ISCSI_SERVER_IP</address>
    </iscsi>
    <iscsi_targets>
        <iscsi_target>iqn.2015-07.com.mlipchuk2.redhat:444</iscsi_target>
        <iscsi_target>iqn.2015-07.com.mlipchuk1.redhat:444</iscsi_target>
    </iscsi_targets>
  </action>

Once the connect succeeded, the user should see the candidate storage domains to be imported, and he can pick those to be imported.
The equivalent REST step should be :
  /api/storagedomains/

  <storage_domain id="306af235-0cbf-4aa7-8682-e27957018112">
    <import>true</import>
    <host id="{host_id}" />
    <type>data</type>
    <storage>
        <type>iscsi</type>
    </storage>
  </storage_domain>

Comment 7 Raz Tamir 2016-07-13 15:21:34 UTC
So it seems like the differences between v3 API and v4 API caused the issue.
Closing this as this is not a bug

Comment 8 Eyal Shenitzky 2016-09-05 12:02:20 UTC
*** Bug 1371566 has been marked as a duplicate of this bug. ***


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