Browse Source

Always specify interface for vips

Currently the interfaces end up being detected during the deploy however
this only works when the undercloud_*_host configurations use the same
ip cidr as the local_ip. We should define this to be the br-ctlplane by
default, however this may need to be configured differently when the
user is using their on network configuration override.  We will also
throw warnings about these configurations when this type of
configuration occurs. The end user can override these via their own
custom env file if they want the vips to end up on a different
interface.

Change-Id: I32b44184a840ec7932a812ce0fabaa0256061993
Closes-Bug: #1841850
(cherry picked from commit 7e5b133122)
changes/34/680434/1
Alex Schultz 3 weeks ago
parent
commit
91d37108d3
1 changed files with 30 additions and 7 deletions
  1. 30
    7
      tripleoclient/v1/undercloud_config.py

+ 30
- 7
tripleoclient/v1/undercloud_config.py View File

@@ -448,11 +448,6 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
448 448
         env_data.update(
449 449
             _get_public_tls_parameters(
450 450
                 CONF.get('undercloud_service_certificate')))
451
-        deploy_args += [
452
-            '-e', os.path.join(tht_templates, 'environments/services/'
453
-                               'undercloud-haproxy.yaml'),
454
-            '-e', os.path.join(tht_templates, 'environments/services/'
455
-                               'undercloud-keepalived.yaml')]
456 451
     elif CONF.get('generate_service_certificate'):
457 452
         deploy_args += ['-e', os.path.join(
458 453
             tht_templates,
@@ -468,7 +463,7 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
468 463
             CONF.get('undercloud_public_host'), tht_templates)
469 464
 
470 465
         public_host = utils.get_single_ip(CONF.get('undercloud_public_host'))
471
-        netaddr.IPAddress(public_host)
466
+        public_ip = netaddr.IPAddress(public_host)
472 467
         deploy_args += ['--public-virtual-ip', public_host]
473 468
 
474 469
         # To make sure the resolved host is set to the right IP in /etc/hosts
@@ -477,9 +472,37 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
477 472
             env_data['ExtraHostFileEntries'] = extra_host
478 473
 
479 474
         admin_host = utils.get_single_ip(CONF.get('undercloud_admin_host'))
480
-        netaddr.IPAddress(admin_host)
475
+        admin_ip = netaddr.IPAddress(admin_host)
481 476
         deploy_args += ['--control-virtual-ip', admin_host]
482 477
 
478
+        local_net = netaddr.IPNetwork(CONF.get('local_ip'))
479
+        if CONF.get('net_config_override', None):
480
+            if (admin_ip not in local_net.cidr):
481
+                LOG.warning('You may need to specify a custom '
482
+                            'ControlVirtualInterface in a custom env file to '
483
+                            'correctly assign the ip address to an interface '
484
+                            'for undercloud_admin_host. By default it will be '
485
+                            'set to br-ctlplane.')
486
+            if (public_ip not in local_net.cidr):
487
+                LOG.warning('You may need to specify a custom '
488
+                            'PublicVirtualInterface in a custom env file to '
489
+                            'correctly assign the ip address to an interface '
490
+                            'for undercloud_public_host. By default it will be'
491
+                            ' set to br-ctlplane.')
492
+        else:
493
+            if (admin_ip not in local_net.cidr or
494
+                    public_ip not in local_net.cidr):
495
+                LOG.warning('undercloud_admin_host or undercloud_public_host '
496
+                            'is not in the same cidr as local_ip.')
497
+
498
+        # Define the *VirtualInterfaces for keepalived. These are used when
499
+        # configuring the undercloud_*_host addresses. If these adddesses are
500
+        # not in the default cidr for the ctlplane, it will not be defined
501
+        # and leads to general sadness during the deployment. Our default
502
+        # net_config uses br-ctlplane. See rhbz#1737150
503
+        env_data['ControlVirtualInterface'] = 'br-ctlplane'
504
+        env_data['PublicVirtualInterface'] = 'br-ctlplane'
505
+
483 506
         deploy_args += [
484 507
             '-e', endpoint_environment,
485 508
             '-e', os.path.join(

Loading…
Cancel
Save