Bug 1182158 - [RFE][ImportDomain] Add support for importing Block Storage Domain using REST-api
Summary: [RFE][ImportDomain] Add support for importing Block Storage Domain using REST...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-sdk
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.1
Assignee: Maor
QA Contact: lkuchlan
URL:
Whiteboard: storage
Depends On: 1179901
Blocks: 1193058 1197441
TreeView+ depends on / blocked
 
Reported: 2015-01-14 14:26 UTC by rhev-integ
Modified: 2022-07-09 08:43 UTC (History)
12 users (show)

Fixed In Version: vt14
Doc Type: Enhancement
Doc Text:
This enhancement adds the ability to import block storage domains using the REST API.
Clone Of: 1179901
Environment:
Last Closed: 2015-04-28 18:44:22 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:
ylavi: Triaged+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-47368 0 None None None 2022-07-09 08:43:51 UTC
Red Hat Product Errata RHSA-2015:0888 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Virtualization Manager 3.5.1 update 2015-04-28 22:40:04 UTC
oVirt gerrit 36727 0 None MERGED restapi: Add API to query block Storage Domains to import. 2020-06-09 07:54:01 UTC
oVirt gerrit 36728 0 None MERGED restapi: Import block Storage Domain 2020-06-09 07:54:01 UTC
oVirt gerrit 36859 0 None MERGED restapi: Add API to query block Storage Domains to import. 2020-06-09 07:54:01 UTC
oVirt gerrit 36860 0 None MERGED restapi: Import block Storage Domain 2020-06-09 07:54:01 UTC

Comment 1 Allon Mureinik 2015-01-15 13:51:43 UTC
Maor, both patches in the external tracker refer to upstream/master.
If they were not backported, this BZ should be on POST, not MODIFIED.
If they were, please add them as external trackers and move back to MODIFIED.

Comment 2 Maor 2015-01-15 14:08:34 UTC
Adding the backported patches to the bug

Comment 3 Ori Gofen 2015-03-04 14:32:09 UTC
Maor, can you please provide steps for new api?

Comment 4 Maor 2015-03-04 16:53:13 UTC
(In reply to Ori Gofen from comment #3)
> Maor, can you please provide steps for new api?

sure, It is described in the documentation at http://www.ovirt.org/Features/ImportStorageDomain#Import_block_Storage_Domain:

Step1: Discover the targets in your iSCSI Storage Server:

POST /api/hosts/052a880a-53e0-4fe3-9ed5-01f939d1df66/iscsidiscover
Accept: application/xml
Content-Type: application/xml
<action>
  <iscsi>
     <address>iscsi.server</address>
  </iscsi>
    <iscsi_target>iqn.iscsi.120.01</iscsi_target>  
    <iscsi_target>iqn.iscsi.120.02</iscsi_target>
   <iscsi_target>iqn.iscsi.120.03</iscsi_target>
</action>



Step2: Get a candidates Storage Domains list to be imported

After the iscsilogin operation, the host is already connected to the targets in the iSCSI and we can fetch the Storage Domains which are candidates to be imported.

POST /api/hosts/052a880a-53e0-4fe3-9ed5-01f939d1df66/unregisteredstoragedomainsdiscover HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action>
   <iscsi>
       <address>iscsiHost</address>
   </iscsi>
   <iscsi_target>iqn.name1.120.01</iscsi_target>
   <iscsi_target>iqn.name2.120.02</iscsi_target>
   <iscsi_target>iqn.name3.120.03</iscsi_target>
</action>

The response which should returned as a list of Storage Domains, as follow:

<action>
   <iscsi>
       <address>iscsiHost</address>
   </iscsi>
   <storage_domains>
       <storage_domain id="6ab65b16-0f03-4b93-85a7-5bc3b8d52be0">
           <name>scsi4</name>
           <type>data</type>
           <master>false</master>
           <storage>
               <type>iscsi</type>
               <volume_group id="OLkKwa-VmEM-abW7-hPiv-BGrw-sQ2E-vTdAy1"/>
           </storage>
           <available>0</available>
           <used>0</used>
           <committed>0</committed>
           <storage_format>v3</storage_format>
       </storage_domain>
   <status>
       <state>complete</state>
   </status>
   <iscsi_target>iqn.name1.120.01</iscsi_target>
   <iscsi_target>iqn.name2.120.02</iscsi_target>
   <iscsi_target>iqn.name3.120.03</iscsi_target>
</action>




Step3: Import the block Storage Domains to the setup

POST /api/storagedomains/ HTTP/1.1
Accept: application/xml
Content-type: application/xml
<storage_domain id="39baf524-380e-407c-8625-50709fcaa9c2">
  <import>true</import>
  <host id="052a880a-53e0-4fe3-9ed5-01f939d1df66" />
  <type>data</type>
  <storage>
     <type>iscsi</type>
  </storage>
</storage_domain>

Comment 5 Allon Mureinik 2015-03-08 11:08:36 UTC
Maor, please provide doctext for this bug (and the 3.6.0 too, while you're at it).

Comment 6 lkuchlan 2015-03-11 14:13:36 UTC
Tested using rhevm-3.5.1-0.1.el6ev, vdsm-4.16.12-2.el7ev.x86_64
The importing FC domain using Rest-api is supported

Comment 7 Andrew Dahms 2015-04-21 10:35:29 UTC
Revised doc text; a docs bug to be raised to include an example of adding a block storage domain using the REST API.

Comment 8 Allon Mureinik 2015-04-21 12:22:48 UTC
(In reply to Andrew Dahms from comment #7)
> Revised doc text; a docs bug to be raised to include an example of adding a
> block storage domain using the REST API.
Thanks Andrew!
When you open it, could you please add a reference to it here?

Comment 9 Andrew Dahms 2015-04-21 12:31:02 UTC
Hi Allon,

Here it is - https://bugzilla.redhat.com/show_bug.cgi?id=1213803

Let me know if there is anything else we can do for you! :)

Kind regards,

Andrew

Comment 10 errata-xmlrpc 2015-04-28 18:44:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0888.html


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