Browse Source

[train-only] Fix unhealthy ovn_metadata_agent during hybrid state

The ovn_metadata_agent does not know yet about changed ovndb VIP.
We have to update this setting in hybrid state and restart the
container.

Change-Id: Ib0698dde545bd0b029c3cdf4d8e56dd4aead43ec
Resolves: rhbz#1873742
changes/30/752230/6
Lukas Bezdicka 11 months ago
committed by Eduardo Olivares
parent
commit
991d990d5f
  1. 7
      deployment/ovn/ovn-controller-container-puppet.yaml
  2. 27
      deployment/ovn/ovn-metadata-container-puppet.yaml

7
deployment/ovn/ovn-controller-container-puppet.yaml

@ -305,7 +305,10 @@ outputs:
shell: |
ovs-vsctl get open . external_ids:ovn-remote
register: ovn_remote
- name: Set fact - OVN SB connection string
set_fact:
ovn_sb_conn_str: "{{ [enable_internal_tls | bool | ternary('ssl','tcp'), ovn_dbs_vip | ipwrap, service_configs['ovn::southbound::port']] | join(':') }}"
- name: Set new ovn remote setting
shell: |
ovs-vsctl set open . external_ids:ovn-remote="tcp:{{ ovn_dbs_vip | ipwrap }}:6642"
when: ovn_dbs_vip not in ovn_remote.stdout
ovs-vsctl set open . external_ids:ovn-remote="{{ ovn_sb_conn_str }}"
when: ovn_sb_conn_str not in ovn_remote.stdout

27
deployment/ovn/ovn-metadata-container-puppet.yaml

@ -366,4 +366,29 @@ outputs:
dest: /var/lib/neutron/kill_scripts/haproxy-kill
mode: 0755
content: {get_file: ../neutron/kill-script}
upgrade_tasks: []
upgrade_tasks:
- name: Switch ovn remote setting
tags:
- never
- nova_hybrid_state
when: step|int == 0
block:
- name: Get ovn remote setting in networking-ovn-metadata-agent.ini
shell: |
crudini --get /var/lib/config-data/puppet-generated/neutron/etc/neutron/plugins/networking-ovn/networking-ovn-metadata-agent.ini ovn ovn_sb_connection
register: ovn_remote
- name: Set fact - OVN SB connection string
set_fact:
ovn_sb_conn_str: "{{ [enable_internal_tls | bool | ternary('ssl','tcp'), ovn_dbs_vip | ipwrap, service_configs['ovn::southbound::port']] | join(':') }}"
- name: Set new ovn remote setting in networking-ovn-metadata-agent.ini
shell: |
crudini --set /var/lib/config-data/puppet-generated/neutron/etc/neutron/plugins/networking-ovn/networking-ovn-metadata-agent.ini ovn ovn_sb_connection "{{ ovn_sb_conn_str }}"
when: ovn_sb_conn_str not in ovn_remote.stdout
- name: Restart ovn_metadata_agent container to apply change in networking-ovn-metadata-agent.ini
docker_container:
name: ovn_metadata_agent
state: started
restart: True
comparisons:
'*': ignore
when: ovn_sb_conn_str not in ovn_remote.stdout
Loading…
Cancel
Save