Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1182158 - [RFE][ImportDomain] Add support for importing Block Storage Domain using REST-api
[RFE][ImportDomain] Add support for importing Block Storage Domain using REST...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-sdk (Show other bugs)
3.5.0
Unspecified Unspecified
unspecified Severity high
: ---
: 3.5.1
Assigned To: Maor
lkuchlan
storage
: FutureFeature, ZStream
Depends On: 1179901
Blocks: 1193058 1197441
  Show dependency treegraph
 
Reported: 2015-01-14 09:26 EST by rhev-integ
Modified: 2016-02-10 15:25 EST (History)
12 users (show)

See Also:
Fixed In Version: vt14
Doc Type: Enhancement
Doc Text:
This enhancement adds the ability to import block storage domains using the REST API.
Story Points: ---
Clone Of: 1179901
Environment:
Last Closed: 2015-04-28 14:44:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
ylavi: Triaged+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 36727 None None None Never
oVirt gerrit 36728 None None None Never
oVirt gerrit 36859 None None None Never
oVirt gerrit 36860 None None None Never
Red Hat Product Errata RHSA-2015:0888 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Virtualization Manager 3.5.1 update 2015-04-28 18:40:04 EDT

  None (edit)
Comment 1 Allon Mureinik 2015-01-15 08:51:43 EST
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 09:08:34 EST
Adding the backported patches to the bug
Comment 3 Ori Gofen 2015-03-04 09:32:09 EST
Maor, can you please provide steps for new api?
Comment 4 Maor 2015-03-04 11:53:13 EST
(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 07:08:36 EDT
Maor, please provide doctext for this bug (and the 3.6.0 too, while you're at it).
Comment 6 lkuchlan 2015-03-11 10:13:36 EDT
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 06:35:29 EDT
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 08:22:48 EDT
(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 08:31:02 EDT
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 14:44:22 EDT
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.