Bug 1702814 - Can't use a hostname for undercloud_admin_host or undercloud_public_host
Summary: Can't use a hostname for undercloud_admin_host or undercloud_public_host
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-tripleoclient
Version: 15.0 (Stein)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: z2
: 15.0 (Stein)
Assignee: Emilien Macchi
QA Contact: Jad Haj Yahya
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-24 20:57 UTC by James Slagle
Modified: 2020-03-05 11:59 UTC (History)
8 users (show)

Fixed In Version: python-tripleoclient-11.4.1-0.20190516120432.9b04afe.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-05 11:59:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1763776 0 None None None 2019-04-25 17:43:24 UTC
OpenStack gerrit 658278 0 'None' MERGED undercloud: resolve undercloud_*_host 2021-01-28 21:04:16 UTC
OpenStack gerrit 660991 0 'None' MERGED standalone/undercloud - post: use EndpointMap to fetch Keystone URL 2021-01-28 21:04:16 UTC
OpenStack gerrit 665152 0 'None' ABANDONED undercloud: add undercloud_admin_host to ExtraHostFileEntries 2021-01-28 21:04:16 UTC
Red Hat Product Errata RHBA-2020:0643 0 None None None 2020-03-05 11:59:49 UTC

Description James Slagle 2019-04-24 20:57:27 UTC
If you try and use a hostname for undercloud_admin_host or undercloud_public_host in undercloud.conf it fails with:

[stack@tripleo-08 ~]$ openstack undercloud install
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version!
  RequestsDependencyWarning)
Exception occured while running the command
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/tripleoclient/command.py", line 30, in run
    super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 184, in run
    return_code = self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/undercloud.py", line 128, in take_action
    dry_run=parsed_args.dry_run)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/undercloud_config.py", line 392, in prepare_undercloud_deploy
    _process_network_args(env_data)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/undercloud_config.py", line 336, in _process_network_args
    'AllocationPools': _calculate_allocation_pools(s)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/undercloud_config.py", line 310, in _calculate_allocation_pools
    ip_set.remove(netaddr.IPNetwork(CONF.undercloud_public_host))
  File "/usr/lib/python2.7/site-packages/netaddr/ip/__init__.py", line 938, in __init__
    raise AddrFormatError('invalid IPNetwork %s' % addr)
AddrFormatError: invalid IPNetwork tripleo-08-undercloud
invalid IPNetwork tripleo-08-undercloud


Many (most?) customers use hostnames for these values, especially when using SSL.

Comment 1 James Slagle 2019-04-24 21:00:21 UTC
[stack@tripleo-08 ~]$ cat undercloud.conf 
[DEFAULT]

enable_ironic = false
enable_ironic_inspector = false
hieradata_override = /home/stack/hieradata-override.yaml
local_interface = eno3
local_ip = 192.168.24.1/24
undercloud_admin_host = 192.168.24.3
undercloud_public_host = tripleo-08-undercloud

Comment 2 James Slagle 2019-04-25 15:04:16 UTC
Even if you work around the initial problem in _calculate_allocation_pools, you still can't use a hostname.

If you put a hostname for either undercloud_admin_host or undercloud_public_host, then it creates an exception in undercloud_config.py around line 590, which is ignored with a pass statement.

To properly fix this, it would take some combination of all the CloudName* parameters and likely using environments/ssl/tls-endpoints-public-dns.yaml so that you can get the public endpoints using a hostname.

To complicate things a bit more, previously with instack-undercloud, that hostname could resolve to any IP address on a network not managed by the installer. It would allow you to end up with an installed undercloud with the public endpoints bound using a hostname with resolved to an IP on a routable network.

This was necessary for not only the UI, but also pre-provisioned nodes which often talk back to the undercloud using a hostname across a routed network.

Comment 7 Victor Voronkov 2019-06-13 05:14:52 UTC
Failed to verify the bug

While undercloud_public_host FQDN was applied, undercloud_admin_host wasn't

$ cat core_puddle_version 
RHOS_TRUNK-15.0-RHEL-8-20190607.n.1

(undercloud) [stack@undercloud-0 ~]$ openstack endpoint list
+----------------------------------+-----------+------------------+-------------------------+---------+-----------+------------------------------------------------+
| ID                               | Region    | Service Name     | Service Type            | Enabled | Interface | URL                                            |
+----------------------------------+-----------+------------------+-------------------------+---------+-----------+------------------------------------------------+
| 0b2b13e9f35b4864a3d85f3b629a68db | regionOne | keystone         | identity                | True    | admin     | http://192.168.24.3:35357                      |
| 106eefcd26e4498a89c8bd9757e2c49e | regionOne | swift            | object-store            | True    | public    | https://uc-public:13808/v1/AUTH_%(tenant_id)s  |
| 256320f20d954df7ab88b5e972911c53 | regionOne | zaqar-websocket  | messaging-websocket     | True    | internal  | ws://192.168.24.3:9000                         |
| 26edb61d40ac40dea02043ddc5a710bc | regionOne | neutron          | network                 | True    | admin     | http://192.168.24.3:9696                       |
| 270c29c3d8ff480fb6bf322e79324625 | regionOne | ironic           | baremetal               | True    | public    | https://uc-public:13385                        |

...

$ cat undercloud.conf 
[DEFAULT]
local_interface = eth0
local_ip = 192.168.24.1/24
#undercloud_public_host = 192.168.24.2
undercloud_public_host = uc-public
#undercloud_admin_host = 192.168.24.3
undercloud_admin_host = uc-admin
undercloud_ntp_servers=clock.redhat.com
container_images_file=/home/stack/containers-prepare-parameter.yaml
container_insecure_registries=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888
generate_service_certificate = True
hieradata_override = /home/stack/hiera_override.yaml
[ctlplane-subnet]
local_subnet = ctlplane-subnet
cidr = 192.168.24.0/24
dhcp_start = 192.168.24.5
dhcp_end = 192.168.24.24
gateway = 192.168.24.1
inspection_iprange = 192.168.24.100,192.168.24.120
masquerade = true

$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.35.64.93  rhos-qe-mirror-tlv.usersys.redhat.com download.lab.bos.redhat.com download.eng.bos.redhat.com download-node-02.eng.bos.redhat.com
192.168.24.2 uc-public
192.168.24.3 uc-admin

# HEAT_HOSTS_START - Do not edit manually within this section!

192.168.24.1 undercloud-0.localdomain undercloud-0
192.168.24.1 undercloud-0.external.localdomain undercloud-0.external
192.168.24.1 undercloud-0.ctlplane.localdomain undercloud-0.ctlplane

192.168.24.2 uc-public
# HEAT_HOSTS_END

Comment 12 Jaromir Coufal 2019-06-18 20:35:21 UTC
Removing blocker flag per kbasil's consultation

Comment 20 errata-xmlrpc 2020-03-05 11:59:04 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, 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-2020:0643


Note You need to log in before you can comment on or make changes to this bug.