Bug 1744051

Summary: Multiattach volumes are only supported starting with compute API version 2.60
Product: Red Hat OpenStack Reporter: Tzach Shefi <tshefi>
Component: documentationAssignee: Irina <igallagh>
Status: CLOSED CURRENTRELEASE QA Contact: RHOS Documentation Team <rhos-docs>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: apevec, dcadzow, igallagh, jpichon, lhh, mariel, marjones, mwitt
Target Milestone: ---Keywords: Triaged
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: 2021-07-06 11:24:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1732850    
Bug Blocks:    

Description Tzach Shefi 2019-08-21 08:19:23 UTC
Description of problem: While testing a Cinder multi attach RBD back port (bz1700882)I had to attach a multi-attach volume to instances. 

With openstack unidentified client commands fails, however with Nova client volume attach works just fine. 


Version-Release number of selected component (if applicable):
python-openstackclient-lang-3.14.3-4.el7ost.noarch
python2-openstackclient-3.14.3-4.el7ost.noarch
python2-novaclient-10.1.0-1.el7ost.noarch
python2-cinderclient-3.5.0-1.el7ost.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Create a multi-attach volume:
(overcloud) [stack@undercloud-0 ~]$ cinder create 1 --volume-type multiattach  --name MA_vol1


(overcloud) [stack@undercloud-0 ~]$ cinder list
+--------------------------------------+-----------+---------+------+-------------+----------+-------------+
| ID                                   | Status    | Name    | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+---------+------+-------------+----------+-------------+
| 14d0c9e2-7dbf-4459-881e-c332daecac98 | available | MA_vol1 | 1    | multiattach | false    |             |
+--------------------------------------+-----------+---------+------+-------------+----------+-------------+

2. Boot up an instances, you only need one:
(overcloud) [stack@undercloud-0 ~]$ nova list
+--------------------------------------+-------+--------+------------+-------------+-----------------------------------+
| ID                                   | Name  | Status | Task State | Power State | Networks                          |
+--------------------------------------+-------+--------+------------+-------------+-----------------------------------+
| de218391-f19d-4fb5-af8e-d234c1c0eb2e | inst1 | ACTIVE | -          | Running     | internal=192.168.0.21, 10.0.0.210 |
| a07efd6c-ce6e-43a3-990c-5d515ab0be6d | inst2 | ACTIVE | -          | Running     | internal=192.168.0.15, 10.0.0.213 |
| 7338f7d4-588a-4339-b658-7838a08d364b | inst3 | ACTIVE | -          | Running     | internal=192.168.0.16, 10.0.0.239 |
+--------------------------------------+-------+--------+------------+-------------+-----------------------------------+

3. Try to attach a multiattach volume to an instance, with unified client:

(overcloud) [stack@undercloud-0 ~]$ openstack server add volume inst1 MA_vol1
Multiattach volumes are only supported starting with compute API version 2.60. (HTTP 400) (Request-ID: req-dd2088e7-bf52-4334-84b6-3c731afefb15)

Volume fails to attach. 


4. Try to attach same volume to same instance using Nova client, volume is successfully attached:

(overcloud) [stack@undercloud-0 ~]$ nova volume-attach inst1 14d0c9e2-7dbf-4459-881e-c332daecac98 auto
+----------+--------------------------------------+
| Property | Value                                |
+----------+--------------------------------------+
| device   | /dev/vdb                             |
| id       | 14d0c9e2-7dbf-4459-881e-c332daecac98 |
| serverId | de218391-f19d-4fb5-af8e-d234c1c0eb2e |
| volumeId | 14d0c9e2-7dbf-4459-881e-c332daecac98 |
+----------+--------------------------------------+

Volume is attached
(overcloud) [stack@undercloud-0 ~]$ cinder list
+--------------------------------------+--------+---------+------+-------------+----------+--------------------------------------+
| ID                                   | Status | Name    | Size | Volume Type | Bootable | Attached to                          |
+--------------------------------------+--------+---------+------+-------------+----------+--------------------------------------+
| 14d0c9e2-7dbf-4459-881e-c332daecac98 | in-use | MA_vol1 | 1    | multiattach | false    | de218391-f19d-4fb5-af8e-d234c1c0eb2e |
+--------------------------------------+--------+---------+------+-------------+----------+--------------------------------------+




Actual results:

(overcloud) [stack@undercloud-0 ~]$ openstack server add volume inst1 MA_vol1
Multiattach volumes are only supported starting with compute API version 2.60. (HTTP 400) (Request-ID: req-dd2088e7-bf52-4334-84b6-3c731afefb15)


Expected results:

Well if Nova client attaches volume Openstack's unified client should also manage to attach volume.
Additional info:

Comment 1 melanie witt 2019-08-22 23:13:46 UTC
Hi,

You will need to explicitly pass the necessary compute API microversion when you run the unified client command, for example:

openstack --os-compute-api-version 2.60 server add volume inst1 MA_vol1

The unified client defaults to using the minimum supported API microversion whereas the legacy nova client defaults to using the maximum supported API microversion, so this is expected behavior.

Comment 2 melanie witt 2019-08-23 15:31:10 UTC
We've added the Documentation keyword in hopes of getting a note added to openstackclient documentation that explains the default compute API version behavior of the client (default to minimum support compute API microversion) and the need to explicitly pass the --os-compute-api-version if a later compute API microversion is required to issue a particular request to the compute API.

Comment 4 Mikey Ariel 2019-08-30 14:21:33 UTC
Converting this to a documentation bug since it is a docs-only fix.