Bug 1871165

Summary: Unable to define a IPv6 host with cinder manage
Product: Red Hat OpenStack Reporter: David Vallee Delisle <dvd>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED CURRENTRELEASE QA Contact: Tzach Shefi <tshefi>
Severity: high Docs Contact: RHOS Documentation Team <rhos-docs>
Priority: high    
Version: 13.0 (Queens)CC: broose, coldford, eharney, gfidente, ltoscano
Target Milestone: ---Keywords: TestOnly, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-15.3.1-7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-05 10:32:20 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: 1944671, 1946230    
Bug Blocks:    

Description David Vallee Delisle 2020-08-21 13:20:40 UTC
Description of problem:
When we cinder manage a volume to set the host, it will be blocked by the regex validation when it's IPv6 because brackets are not included in the regex pattern.

I believe this could be fixed by adding the brackets to this pattern [a]. Asking the customer to test and will submit a patch upstream if it works.

Version-Release number of selected component (if applicable):
openstack-cinder-15.1.1-0.20200403213514.cfa2d1b.el8ost.noarch


Additional info:

[a] https://opendev.org/openstack/cinder/src/branch/master/cinder/api/validation/parameter_types.py#L232

[1]
~~~
DEBUG (shell:1025) Invalid input for field/attribute host. Value: hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01. 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' does not match '^[a-zA-Z0-9-._#@:/+]*$' (HTTP 400) (Request-ID: req-2aafd9a5-3f3e-44cd-9e97-e9391636822f)
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/cinderclient/shell.py", line 1017, in main
    OpenStackCinderShell().main(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/cinderclient/shell.py", line 790, in main
    args.func(self.cs, args)
  File "/usr/lib/python3.6/site-packages/cinderclient/v3/shell.py", line 1265, in do_manage
    cluster=getattr(args, 'cluster', None))
  File "/usr/lib/python3.6/site-packages/cinderclient/v3/volumes.py", line 247, in manage
    return self._create('/os-volume-manage', body, 'volume')
  File "/usr/lib/python3.6/site-packages/cinderclient/base.py", line 302, in _create
    resp, body = self.api.client.post(url, body=body)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 217, in post
    return self._cs_request(url, 'POST', **kwargs)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 205, in _cs_request
    return self.request(url, method, **kwargs)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 191, in request
    raise exceptions.from_response(resp, body)
cinderclient.exceptions.BadRequest: Invalid input for field/attribute host. Value: hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01. 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' does not match '^[a-zA-Z0-9-._#@:/+]*$' (HTTP 400) (Request-ID: req-2aafd9a5-3f3e-44cd-9e97-e9391636822f)
DEBUG:cinderclient.shell:Invalid input for field/attribute host. Value: hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01. 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' does not match '^[a-zA-Z0-9-._#@:/+]*$' (HTTP 400) (Request-ID: req-2aafd9a5-3f3e-44cd-9e97-e9391636822f)
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/cinderclient/shell.py", line 1017, in main
    OpenStackCinderShell().main(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/cinderclient/shell.py", line 790, in main
    args.func(self.cs, args)
  File "/usr/lib/python3.6/site-packages/cinderclient/v3/shell.py", line 1265, in do_manage
    cluster=getattr(args, 'cluster', None))
  File "/usr/lib/python3.6/site-packages/cinderclient/v3/volumes.py", line 247, in manage
    return self._create('/os-volume-manage', body, 'volume')
  File "/usr/lib/python3.6/site-packages/cinderclient/base.py", line 302, in _create
    resp, body = self.api.client.post(url, body=body)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 217, in post
    return self._cs_request(url, 'POST', **kwargs)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 205, in _cs_request
    return self.request(url, method, **kwargs)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 191, in request
    raise exceptions.from_response(resp, body)
cinderclient.exceptions.BadRequest: Invalid input for field/attribute host. Value: hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01. 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' does not match '^[a-zA-Z0-9-._#@:/+]*$' (HTTP 400) (Request-ID: req-2aafd9a5-3f3e-44cd-9e97-e9391636822f)
ERROR: Invalid input for field/attribute host. Value: hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01. 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' does not match '^[a-zA-Z0-9-._#@:/+]*$' (HTTP 400) (Request-ID: req-2aafd9a5-3f3e-44cd-9e97-e9391636822f)
~~~

Comment 1 David Vallee Delisle 2020-08-21 13:22:38 UTC
Command used:
cinder --debug manage --id-type source-name --name ssbench-vim2-2 "hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01" 3e5e3852-fe19-49f3-b841-41ec1c69c6bc

Comment 14 Lon Hohberger 2021-06-02 11:06:43 UTC
According to our records, this should be resolved by openstack-cinder-15.3.1-7.el8ost.  This build is available now.

Comment 15 Tzach Shefi 2021-07-04 07:25:43 UTC
Verified on:
openstack-cinder-15.3.1-7.el8ost.noarch

Reused David's example from #1, see below.  
Confirm we no longer get "Invalid input for field/attribute host. ...does not match '^[a-zA-Z0-9-._#@:/+]*$'" errors as we did before. 

Ignore the obvious host not found related errors,
as I re-used same bogus host/IPv6/share/vol. 


(overcloud) [stack@undercloud-0 ~]$ cinder --debug manage --id-type source-name --name ssbench-vim2-2 "hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01" 3e5e3852-fe19-49f3-b841-41ec1c69c6bc
DEBUG:keystoneauth.session:REQ: curl -g -i -X GET http://10.0.0.138:5000 -H "Accept: application/json" -H "User-Agent: cinder keystoneauth1/3.17.3 python-requests/2.20.0 CPython/3.6.8"                                                     
DEBUG:keystoneauth.session:RESP: [300] Content-Length: 265 Content-Type: application/json Date: Tue, 29 Jun 2021 08:01:49 GMT Location: http://10.0.0.138:5000/v3/ Server: Apache Vary: X-Auth-Token x-openstack-request-id: req-01798eef-deaa-420a-a11e-9b8b2d3476d5                                                                                                                                                                                                                     
DEBUG:keystoneauth.session:RESP BODY: {"versions": {"values": [{"id": "v3.13", "status": "stable", "updated": "2019-07-19T00:00:00Z", "links": [{"rel": "self", "href": "http://10.0.0.138:5000/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}]}]}}                                                                                                                                                                           
DEBUG:keystoneauth.session:GET call to http://10.0.0.138:5000/ used request id req-01798eef-deaa-420a-a11e-9b8b2d3476d5                                                                                                                      
DEBUG:keystoneauth.identity.v3.base:Making authentication request to http://10.0.0.138:5000/v3/auth/tokens                                                                                                                                   
DEBUG:keystoneauth.identity.v3.base:{"token": {"methods": ["password"], "user": {"domain": {"id": "default", "name": "Default"}, "id": "89a5b02a218d4bd286210638345cabaa", "name": "admin", "password_expires_at": null}, "audit_ids": ["IZocg6iZTw6J5Iv1FEe-SA"], "expires_at": "2021-06-29T09:01:50.000000Z", "issued_at": "2021-06-29T08:01:50.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "6c5e7935f34d4684818f6fb5db469301", "name": "admin"}, "is_domain": false, "roles": [{"id": "9a0a97fc6dcb4eb9a823185f9a3ad68c", "name": "member"}, {"id": "f5fdb911c1b44920b6c1af02ac14c8ea", "name": "reader"}, {"id": "2f917f9c37a44e898ae628a511d84782", "name": "admin"}], "catalog": [{"endpoints": [{"id": "271f61177ada42c69f63b6963ff93ec7", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:9311", "region": "regionOne"}, {"id": "593a386523f84758becbdcd7c6aee621", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:9311", "region": "regionOne"}, {"id": "9b6416715574474da9853abbb3177835", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:9311", "region": "regionOne"}], "id": "0925d8ea0dfd42018c10051707ee1184", "type": "key-manager", "name": "barbican"}, {"endpoints": [{"id": "19407f037f9e43c19c9ddcd793989367", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:8000/v1", "region": "regionOne"}, {"id": "89b850ea0e6843e0ae3efeced43f3e13", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:8000/v1", "region": "regionOne"}, {"id": "f805eab94abd4ac69aadaaa4138b9da5", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:8000/v1", "region": "regionOne"}], "id": "1bf5f8de21fe4bda979622c99d5f18ba", "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"id": "1f23f542f5694425abf0216a8d4ad412", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:8080/v1/AUTH_6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}, {"id": "457a563d66124d419e34b0de7f3d3aa5", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.3.112:8080/v1/AUTH_6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}, {"id": "514f92dc314b47fda54eee906fbeaddd", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.3.112:8080", "region": "regionOne"}], "id": "2c6f06599f524eb78d4c4060452fbb5d", "type": "object-store", "name": "swift"}, {"endpoints": [{"id": "23e0cee46b01467f867c6b6c22a54bd8", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:9292", "region": "regionOne"}, {"id": "adf4916cf31047f88ed18f1d0cdc033c", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:9292", "region": "regionOne"}, {"id": "f155ab63afc04626b2493e95957c67a7", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:9292", "region": "regionOne"}], "id": "3e510fa119a64179ae0d77c1bbec4e9c", "type": "image", "name": "glance"}, {"endpoints": [{"id": "21e4f4a1695e4e848c0f3303a61b28b5", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:8774/v2.1", "region": "regionOne"}, {"id": "7d0216edf19f4ac19b7f28c9d16add1c", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:8774/v2.1", "region": "regionOne"}, {"id": "b1fd098d4f6e42b7b24cc02ed474769b", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:8774/v2.1", "region": "regionOne"}], "id": "493ea26c144440fa8fa6451fc0ee62f8", "type": "compute", "name": "nova"}, {"endpoints": [{"id": "46ddf585f4754a5fbb1bd87913733bd5", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:5000", "region": "regionOne"}, {"id": "8a5483c1961641b5b0f4025a01e64707", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:5000", "region": "regionOne"}, {"id": "9f12977d3a094d2f8deec990a706ecf1", "interface": "admin", "region_id": "regionOne", "url": "http://192.168.24.10:35357", "region": "regionOne"}], "id": "628b0bf3ba2e4089831467c9649a9d05", "type": "identity", "name": "keystone"}, {"endpoints": [{"id": "9037ed4b4fe14fc1904a03ffe6168130", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:8776/v2/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}, {"id": "e9196e12246b432ca21a5fc805c12b8f", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:8776/v2/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}, {"id": "eb4d096a5eb84a37a2a82e21a18525e9", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:8776/v2/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}], "id": "80dcde0bd4774ac9aac9d5fa94d05463", "type": "volumev2", "name": "cinderv2"}, {"endpoints": [{"id": "093197572f6e451cb8d4c4b7e5fc0898", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:8004/v1/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}, {"id": "1811327aaed34a65b70312435d9d46b8", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:8004/v1/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}, {"id": "2456a1416da24dda94972b1557fbe935", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:8004/v1/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}], "id": "89e51cc4d4d949df8f0a4996d3a0999d", "type": "orchestration", "name": "heat"}, {"endpoints": [{"id": "11db041e3efd47e3a2f84b52205ef461", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:8776/v3/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}, {"id": "278e578087714a95bf701917de9f4717", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:8776/v3/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}, {"id": "d3abed15da024ea1973911dfc005a74c", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:8776/v3/6c5e7935f34d4684818f6fb5db469301", "region": "regionOne"}], "id": "bf3d028e20c44c67b994575961f7f383", "type": "volumev3", "name": "cinderv3"}, {"endpoints": [{"id": "13db4ef23632463db678235bb8da0e82", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:8778/placement", "region": "regionOne"}, {"id": "3901a35cb8cf4cd5b759592074b0c599", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:8778/placement", "region": "regionOne"}, {"id": "70eca9a009dc4c19b73a3b928fc145d1", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:8778/placement", "region": "regionOne"}], "id": "dc4b9b65b3f845b78ad5d528ad605107", "type": "placement", "name": "placement"}, {"endpoints": [{"id": "4536b4ec310e4789901656af266624f6", "interface": "public", "region_id": "regionOne", "url": "http://10.0.0.138:9696", "region": "regionOne"}, {"id": "9b4ab8515f214b12841aab6a7858cece", "interface": "admin", "region_id": "regionOne", "url": "http://172.17.1.52:9696", "region": "regionOne"}, {"id": "b010cf5c330942aa9bb6f8ef86e4a854", "interface": "internal", "region_id": "regionOne", "url": "http://172.17.1.52:9696", "region": "regionOne"}], "id": "e52d769986404f6e89fd3221d3cc1537", "type": "network", "name": "neutron"}]}}
DEBUG:keystoneauth:REQ: curl -g -i -X GET http://10.0.0.138:8776/ -H "Accept: application/json" -H "OpenStack-API-Version: volume 3.59" -H "User-Agent: python-cinderclient" -H "X-Auth-Token: {SHA256}e1451aba5bdab37ac01f14f4ec101e29ac178df95aac35fd80436a7199fe9eb7"
DEBUG:keystoneauth:RESP: [300] Content-Length: 748 Content-Type: application/json Date: Tue, 29 Jun 2021 08:01:50 GMT OpenStack-API-Version: volume 3.0 Server: Apache Vary: OpenStack-API-Version
DEBUG:keystoneauth:RESP BODY: {"versions": [{"id": "v2.0", "status": "DEPRECATED", "version": "", "min_version": "", "updated": "2017-02-25T12:00:00Z", "links": [{"rel": "describedby", "type": "text/html", "href": "https://docs.openstack.org/"}, {"rel": "self", "href": "http://10.0.0.138:8776/v2/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.volume+json;version=2"}]}, {"id": "v3.0", "status": "CURRENT", "version": "3.59", "min_version": "3.0", "updated": "2018-07-17T00:00:00Z", "links": [{"rel": "describedby", "type": "text/html", "href": "https://docs.openstack.org/"}, {"rel": "self", "href": "http://10.0.0.138:8776/v3/"}], "media-types": [{"base": "application/json", "type": "application/vnd.openstack.volume+json;version=3"}]}]}
DEBUG:keystoneauth:REQ: curl -g -i -X POST http://10.0.0.138:8776/v3/6c5e7935f34d4684818f6fb5db469301/os-volume-manage -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: python-cinderclient" -H "X-Auth-Token: {SHA256}e1451aba5bdab37ac01f14f4ec101e29ac178df95aac35fd80436a7199fe9eb7" -d '{"volume": {"host": "hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01", "ref": {"source-name": "3e5e3852-fe19-49f3-b841-41ec1c69c6bc"}, "name": "ssbench-vim2-2", "description": null, "volume_type": null, "availability_zone": null, "metadata": null, "bootable": false}}'
DEBUG:keystoneauth:RESP: [400] Content-Length: 120 Content-Type: application/json Date: Tue, 29 Jun 2021 08:01:50 GMT OpenStack-API-Version: volume 3.0 Server: Apache Vary: OpenStack-API-Version x-compute-request-id: req-f7c46310-2760-4681-834c-bd96f30d88a7 x-openstack-request-id: req-f7c46310-2760-4681-834c-bd96f30d88a7
DEBUG:keystoneauth:RESP BODY: {"badRequest": {"code": 400, "message": "Host 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' not found"}}
DEBUG:keystoneauth:POST call to volumev3 for http://10.0.0.138:8776/v3/6c5e7935f34d4684818f6fb5db469301/os-volume-manage used request id req-f7c46310-2760-4681-834c-bd96f30d88a7
DEBUG (shell:1025) Host 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' not found (HTTP 400) (Request-ID: req-f7c46310-2760-4681-834c-bd96f30d88a7)
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/cinderclient/shell.py", line 1017, in main
    OpenStackCinderShell().main(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/cinderclient/shell.py", line 790, in main
    args.func(self.cs, args)
  File "/usr/lib/python3.6/site-packages/cinderclient/v3/shell.py", line 1265, in do_manage
    cluster=getattr(args, 'cluster', None))
  File "/usr/lib/python3.6/site-packages/cinderclient/v3/volumes.py", line 247, in manage
    return self._create('/os-volume-manage', body, 'volume')
  File "/usr/lib/python3.6/site-packages/cinderclient/base.py", line 302, in _create
    resp, body = self.api.client.post(url, body=body)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 217, in post
    return self._cs_request(url, 'POST', **kwargs)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 205, in _cs_request
    return self.request(url, method, **kwargs)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 191, in request
    raise exceptions.from_response(resp, body)
cinderclient.exceptions.BadRequest: Host 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' not found (HTTP 400) (Request-ID: req-f7c46310-2760-4681-834c-bd96f30d88a7)
DEBUG:cinderclient.shell:Host 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' not found (HTTP 400) (Request-ID: req-f7c46310-2760-4681-834c-bd96f30d88a7)
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/cinderclient/shell.py", line 1017, in main
    OpenStackCinderShell().main(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/cinderclient/shell.py", line 790, in main
    args.func(self.cs, args)
  File "/usr/lib/python3.6/site-packages/cinderclient/v3/shell.py", line 1265, in do_manage
    cluster=getattr(args, 'cluster', None))
  File "/usr/lib/python3.6/site-packages/cinderclient/v3/volumes.py", line 247, in manage
    return self._create('/os-volume-manage', body, 'volume')
  File "/usr/lib/python3.6/site-packages/cinderclient/base.py", line 302, in _create
    resp, body = self.api.client.post(url, body=body)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 217, in post
    return self._cs_request(url, 'POST', **kwargs)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 205, in _cs_request
    return self.request(url, method, **kwargs)
  File "/usr/lib/python3.6/site-packages/cinderclient/client.py", line 191, in request
    raise exceptions.from_response(resp, body)
cinderclient.exceptions.BadRequest: Host 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' not found (HTTP 400) (Request-ID: req-f7c46310-2760-4681-834c-bd96f30d88a7)
ERROR: Host 'hostgroup@tripleo_netapp#[dead:beef::cafe]:/remus_cinder_01' not found (HTTP 400) (Request-ID: req-f7c46310-2760-4681-834c-bd96f30d88a7)