Move OVN VIP to all_nodes and consider if OVN is configured for a separate VIP

In the same vein as I7ca94dff4acf0816708110b9fe6f78d19dcc7b4d
(Move redis_vip to all_nodes.j2) we want to have the ovn_dbs_vip moved
to all nodes. Because we ultimately want to revert
I0d9eb663405d1113ea84e3c12651a3f0dbdfc75d (Add OvnDbInternal to EndpointMap
and use it for ovn_db_host) as that forces all connections to OVN to go
through the haproxy vip.

We set ovn_dbs_vip to:
A) the ovn_dbs network VIP if net_vip_map.ovn_dbs is not defined
B) to the separate VIP if net_vip_map.ovn_dbs is defined

The separate OVN VIP THT patch that makes the OVN VIP separate is
in I620e37117c26b5b51bf9e1eda91daeb00fdf0f43.

We choose this approach of setting the ovn_dbs_vip in two different
cases because it makes landing all the patches to have OVN live with
a separate VIP a lot simpler (less dependencies).

Testes as follows:
1) Deployed a vanilla tripleo master deployment with this patch and
observed that the OVN VIP is set to the VIP on the internal_api network:
[root@overcloud-controller-2 ~]# pcs resource show ovn-dbs-bundle |grep $(hiera -c /etc/puppet/hiera.yaml ovn_dbs_vip)
   Attributes: inactive_probe_interval=180000 manage_northd=yes master_ip=172.16.2.168 nb_master_port=6641 sb_master_port=6642
[root@overcloud-controller-2 ~]# pcs resource show ovn-dbs-bundle |grep $(hiera -c /etc/puppet/hiera.yaml internal_api_virtual_ip)
   Attributes: inactive_probe_interval=180000 manage_northd=yes master_ip=172.16.2.168 nb_master_port=6641 sb_master_port=6642

2) Also applied I4e4bf0a91751fb4f9e4c7233242cdc5649c421f8 "Revert Add
OvnDbInternal to EndpointMap and use it for ovn_db_host" and observed
that the deploy completes fine and that the OVN VIP is still pointing to
the to the internal_api one:
[root@overcloud-controller-2 ~]# pcs resource show ovn-dbs-bundle |grep $(hiera -c /etc/puppet/hiera.yaml ovn_dbs_vip)
   Attributes: inactive_probe_interval=180000 manage_northd=yes master_ip=172.16.2.220 nb_master_port=6641 sb_master_port=6642
[root@overcloud-controller-2 ~]# pcs resource show ovn-dbs-bundle |grep $(hiera -c /etc/puppet/hiera.yaml internal_api_virtual_ip)
   Attributes: inactive_probe_interval=180000 manage_northd=yes master_ip=172.16.2.220 nb_master_port=6641 sb_master_port=6642

3) Also applied I620e37117c26b5b51bf9e1eda91daeb00fdf0f43
"OVN DBS separate vip" (tht) and Ic62b0fbc0fee40638811a5cd77a5dc5a4d82acf5
"OVN separate vip" (puppet-tripleo) with this review and observed that the OVN VIP is
not the same as the internal_api one:
[root@overcloud-controller-2 hieradata]# hiera -c /etc/puppet/hiera.yaml ovn_dbs_vip
172.16.2.4
[root@overcloud-controller-2 hieradata]# hiera -c /etc/puppet/hiera.yaml internal_api_virtual_ip
172.16.2.48
[root@overcloud-controller-2 ~]# pcs resource show ovn-dbs-bundle |grep $(hiera -c /etc/puppet/hiera.yaml internal_api_virtual_ip)
[root@overcloud-controller-2 ~]# pcs resource show ovn-dbs-bundle |grep $(hiera -c /etc/puppet/hiera.yaml ovn_dbs_vip)
   Attributes: inactive_probe_interval=180000 manage_northd=yes master_ip=172.16.2.4 nb_master_port=6641 sb_master_port=6642

Related-Bug: #1841811

Change-Id: I1d80587752ffca6c3eb5281aa89ea3d7cf5535ce
This commit is contained in:
Michele Baldessari 2019-09-10 09:16:06 +02:00
parent 1a2dd95e1f
commit 139334c200
3 changed files with 9 additions and 1 deletions

View File

@ -113,6 +113,7 @@ provisioner:
ctlplane_subnet: 192.168.24.1/24
ctlplane_uri: 192.168.24.1
redis: 192.168.24.1
ovn_dbs: 192.168.24.1
network_virtual_ips:
ctlplane:
index: 1

View File

@ -38,6 +38,9 @@
{% if 'redis' in enabled_services %}
{% set _ = all_nodes.__setitem__('redis_vip', (net_vip_map.redis)) %}
{% endif %}
{% if 'ovn_dbs' in enabled_services and net_vip_map.ovn_dbs is defined %}
{% set _ = all_nodes.__setitem__('ovn_dbs_vip', (net_vip_map.ovn_dbs)) %}
{% endif %}
{% set _ = all_nodes.__setitem__('deploy_identifier', deploy_identifier) %}
{% set _ = all_nodes.__setitem__('stack_action', stack_action) %}
{% set _ = all_nodes.__setitem__('stack_update_type', stack_update_type) %}

View File

@ -39,7 +39,11 @@
{% for service in enabled_services %}
{% if service_net_map.get(service ~ '_network', 'noop') in net_vip_map %}
{# we set explicit vips for these services, no need to calculate them dynamically #}
{% if service not in ['redis', 'ganesha', 'keystone_admin_api_vip', 'keystone_public_api_vip', 'ceph_grafana'] %}
{% if service not in ['ovn_dbs', 'redis', 'ganesha', 'keystone_admin_api_vip', 'keystone_public_api_vip', 'ceph_grafana'] %}
{% set _ = vip_data.__setitem__((service ~ '_vip'), (net_vip_map[service_net_map[service ~ '_network']])) %}
{% endif %}
{# we set the ovn_dbs_vip to the per-network VIP *if* we detect that there is no separate ovn_dbs VIP set (I.e. THT patch for separate OVN VIP is missing) #}
{% if service in ['ovn_dbs'] and net_vip_map.ovn_dbs is not defined%}
{% set _ = vip_data.__setitem__((service ~ '_vip'), (net_vip_map[service_net_map[service ~ '_network']])) %}
{% endif %}
{% endif %}