Bug 1946230

Summary: Unable to define a IPv6 host with cinder manage
Product: Red Hat OpenStack Reporter: Eric Harney <eharney>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED ERRATA QA Contact: Tzach Shefi <tshefi>
Severity: medium Docs Contact: Andy Stillman <astillma>
Priority: medium    
Version: 16.1 (Train)Keywords: Triaged
Target Milestone: z6   
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-15.3.1-7.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-26 13:52:31 UTC Type: ---
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    
Bug Blocks: 1871165    

Description Eric Harney 2021-04-05 13:07:29 UTC
This bug was initially created as a copy of Bug #1871165

I am copying this bug because: 



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 11 errata-xmlrpc 2021-05-26 13:52:31 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 (Red Hat OpenStack Platform 16.1.6 bug fix and enhancement 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://access.redhat.com/errata/RHBA-2021:2097