From e8ecbecb6a36c1222a5ff4459ceaa6e7e3b9a680 Mon Sep 17 00:00:00 2001 From: Numan Siddique Date: Fri, 15 Nov 2019 19:40:44 +0530 Subject: [PATCH] ovn-db standalone: Create ovndbs before starting the OVN ovsdb servers The kolla commit [1] deleted the extend_start script for ovn-nb-db-server/ovn-sb-db-server kolla images. This script created the ovn dbs from the schema. After this commit tripleo CI is broken as the ovn dbs are not present. To fix this issue, this patch first creates OVN dbs before starting the OVN ovsdb-servers. [1] - I31a372d801dace92950cd85b29b308431f78bbdb Closes-bug: #1852682 Change-Id: I9640529455e1d14c98c3b53993a71d77de8d7a25 Signed-off-by: Numan Siddique --- deployment/ovn/ovn-dbs-container-puppet.yaml | 37 ++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/deployment/ovn/ovn-dbs-container-puppet.yaml b/deployment/ovn/ovn-dbs-container-puppet.yaml index 9ce61470d7..1a533e1164 100644 --- a/deployment/ovn/ovn-dbs-container-puppet.yaml +++ b/deployment/ovn/ovn-dbs-container-puppet.yaml @@ -137,10 +137,43 @@ outputs: owner: root:root recurse: true docker_config: + step_3: + ovn_north_db_init: + image: &northd_db_image {get_param: ContainerOvnNbDbImage} + net: host + privileged: false + detach: false + user: root + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/ovn_north_db_server.json:/var/lib/kolla/config_files/config.json:ro + - /lib/modules:/lib/modules:ro + - /var/lib/openvswitch/ovn:/var/lib/openvswitch:shared,z + - /var/lib/openvswitch/ovn:/run/openvswitch:shared,z + - /var/log/containers/openvswitch:/var/log/openvswitch:z + command: "ovsdb-tool create /var/lib/openvswitch/ovnnb.db /usr/share/openvswitch/ovn-nb.ovsschema" + ovn_south_db_init: + image: &south_db_image {get_param: ContainerOvnSbDbImage} + net: host + privileged: false + detach: false + user: root + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/kolla/config_files/ovn_north_db_server.json:/var/lib/kolla/config_files/config.json:ro + - /lib/modules:/lib/modules:ro + - /var/lib/openvswitch/ovn:/var/lib/openvswitch:shared,z + - /var/lib/openvswitch/ovn:/run/openvswitch:shared,z + - /var/log/containers/openvswitch:/var/log/openvswitch:z + command: "ovsdb-tool create /var/lib/openvswitch/ovnsb.db /usr/share/openvswitch/ovn-sb.ovsschema" step_4: ovn_north_db_server: start_order: 0 - image: {get_param: ContainerOvnNbDbImage} + image: *northd_db_image net: host privileged: false restart: always @@ -157,7 +190,7 @@ outputs: KOLLA_CONFIG_STRATEGY: COPY_ALWAYS ovn_south_db_server: start_order: 0 - image: {get_param: ContainerOvnSbDbImage} + image: *south_db_image net: host privileged: false restart: always