Bug 1669978

Summary: [CinderLib] - Adding 3PAR managed storage domain via webadmin/RESTAPI fails-ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-4) [] Operation Failed: [Cannot add Storage. Failed to connect to the managed block domain.]
Product: [oVirt] ovirt-engine Reporter: Avihai <aefrat>
Component: BLL.StorageAssignee: Benny Zlotnik <bzlotnik>
Status: CLOSED NOTABUG QA Contact: Elad <ebenahar>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: bugs, frolland
Target Milestone: ovirt-4.3.4Flags: rule-engine: ovirt-4.3+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-03 13:08:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1539837    
Attachments:
Description Flags
engine log and print screen
none
print screen of the HP3PAR webadmin request none

Description Avihai 2019-01-28 09:37:29 UTC
Created attachment 1524175 [details]
engine log and print screen

Description of problem:
Adding a managed storage via webadmin/RESTAPI fails with the following error in the engine:
[CinderLib] - Adding managed storage vi webadmin/RESTAPI fails  ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-4) [] Operation Failed: [Cannot add Storage. Failed to connect to the managed block domain.]

Version-Release number of selected component (if applicable):
Ovirt engine- Version 4.3.0-0.8.master.20190122121624.git9a8a519.el7

How reproducible:
100%


Steps to Reproduce:
1.Via UI/REST add managed storage domain

Actual results:
Fails with the following engine ERROR:
[CinderLib] - Adding managed storage vi webadmin/RESTAPI fails  ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-4) [] Operation Failed: [Cannot add Storage. Failed to connect to the managed block domain.]

Expected results:
Should succceed.

Additional info:
UI operation added in print screen.

RestAPI request :
Method = POST
 
URL:
https://storage-ge-08.scl.lab.tlv.redhat.com/ovirt-engine/api/storagedomains
 
Headers:
Content-Type: application/xml
 
 
BODY:
<storage_domain>
   <name>cinder-kaminario</name>
   <type>managed_block_storage</type>
   <storage>
      <type>managed_block_storage</type>
      <driver_options>
         <property>
            <name>use_multipath_for_image_xfer</name>
            <value>true</value>
         </property>
         <property>
            <name>volume_driver</name>
            <value>cinder.volume.drivers.kaminario.kaminario_iscsi.KaminarioISCSIDriver</value>
         </property>
         <property>
            <name>san_ip</name>
            <value>10.35.84.1</value>
         </property>
      </driver_options>
      <driver_sensitive_options>
         <property>
                <name>san_login</name>
            <value>admin</value>
         </property>
         <property>
            <name>san_password</name>
            <value>admin</value>
         </property>
      </driver_sensitive_options>
   </storage>
   <host>
      <name>host_mixed_1</name>
   </host>
</storage_domain>

Comment 2 Avihai 2019-01-28 12:34:44 UTC
Adding a HP3PAR SD with the one letter workaround (of Bug 1667002) still does not work via REST/Webadmin(see attached print screen).

REST request:
Method = POST 

Headers:
Content-Type = application/xml

Body:
<storage_domain>
   <name>cinder-hp3par</name>
   <type>managed_block_storage</type>
   <storage>
      <type>managed_block_storage</type>
      <driver_options>
        <property>
            <name>hpe3par_api_url</name>
            <value>https://3par-cli.mgmt.lab3.tlv.redhat.com:8080/api/v1</value>
         </property>
        <property>
            <name>san_ip</name>
            <value>10.35.84.14</value>
         </property>
        <property>
            <name>san_login</name>
            <value>admin</value>
         </property>
         <property>
            <name>san_password</name>
            <value>Qum!0net</value>
         </property>
         <property>
            <name>hpe3par_username</name>
            <value>3paredit</value>
         </property>
         <property>
            <name>hpe3par_password</name>
            <value>123456</value>
         </property>
         <property>
            <name>hpe3par_cpg</name>
            <value>O</value>
         </property>
         <property>
            <name>volume_driver</name>
            <value>cinder.volume.drivers.hpe.hpe_3par_fc.HPE3PARFCDriver</value>
         </property>
         <property>
            <name>hpe3par_debug</name>
            <value>False</value>
         </property>
         <property>
            <name>hpe3par_iscsi_chap_enabled</name>
            <value>False</value>
         </property>
         <property>
            <name>hpe3par_snapshot_retention</name>
            <value>48</value>
         </property>
         <property>
            <name>hpe3par_snapshot_expiration</name>
            <value>72</value>
         </property>
         <property>
            <name>max_over_subscription_ratio</name>
            <value>20.0</value>
         </property>
         <property>
            <name>reserved_percentage</name>
            <value>15</value>
         </property>
      </driver_options>
   </storage>
   <host>
      <name>host_mixed_1</name>
   </host>
</storage_domain>

Comment 3 Avihai 2019-01-28 12:36:34 UTC
Created attachment 1524196 [details]
print screen of the HP3PAR webadmin request

Comment 4 Fred Rolland 2019-01-28 13:15:50 UTC
san_login should be "root".
but anyway, it is a bug in the driver code, not an oVirt bug.

It is fixed in this commit:
https://github.com/openstack/cinder/commit/ec7977b7615097fb56c5c1640fb5268dba9b26d4#diff-0eae18f6b32439ae3e4ff3beeecb9e50

Comment 5 Benny Zlotnik 2019-04-03 13:08:11 UTC
Closing, it's a driver bug that has been fixed