diff options
| author | Zuul <zuul@review.opendev.org> | 2019-10-24 12:45:09 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-10-24 12:45:09 +0000 |
| commit | e3764ac72c5874baee26336ae277cde7bdceef93 (patch) | |
| tree | 8523f71bc26301436a175652014dd1ac2e365876 /docker | |
| parent | ad623aec1e700f56b520c44e5c366dce10404221 (diff) | |
| parent | d1a07584ed116c3e046dc0b77370b70374a5c947 (diff) | |
| download | kolla-e3764ac72c5874baee26336ae277cde7bdceef93.tar.gz kolla-e3764ac72c5874baee26336ae277cde7bdceef93.zip | |
Merge "ovn: Create the ovn dbs only if the schema file exists"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/ovn/ovn-nb-db-server/extend_start.sh | 17 | ||||
| -rw-r--r-- | docker/ovn/ovn-sb-db-server/extend_start.sh | 17 |
2 files changed, 30 insertions, 4 deletions
diff --git a/docker/ovn/ovn-nb-db-server/extend_start.sh b/docker/ovn/ovn-nb-db-server/extend_start.sh index dffc85c1f..dfaa0f12a 100644 --- a/docker/ovn/ovn-nb-db-server/extend_start.sh +++ b/docker/ovn/ovn-nb-db-server/extend_start.sh @@ -1,6 +1,19 @@ #!/bin/bash mkdir -p "/run/openvswitch" -if [[ ! -e "/var/lib/openvswitch/ovnnb.db" ]]; then - ovsdb-tool create "/var/lib/openvswitch/ovnnb.db" "/usr/share/openvswitch/ovn-nb.ovsschema" + +# Check for the presence of schema file in the old +# location before accessing it. +# Note: If latest OVN is used (post split from openvswitch), +# then the new location for the schema file +# is - /usr/share/ovn/ovn-nb.ovsschema. +# It is advisable to use the ovn-ctl script to start +# ovn NB db server. ovn-ctl takes care of creating the +# db file from the schema file if the db file is not +# present. ovn-ctl also takes care of updating the db file +# if the schema file is updated. +if [[ -e "/usr/share/openvswitch/ovn-nb.ovsschema" ]]; then + if [[ ! -e "/var/lib/openvswitch/ovnnb.db" ]]; then + ovsdb-tool create "/var/lib/openvswitch/ovnnb.db" "/usr/share/openvswitch/ovn-nb.ovsschema" + fi fi diff --git a/docker/ovn/ovn-sb-db-server/extend_start.sh b/docker/ovn/ovn-sb-db-server/extend_start.sh index 688e37a0e..782a49c37 100644 --- a/docker/ovn/ovn-sb-db-server/extend_start.sh +++ b/docker/ovn/ovn-sb-db-server/extend_start.sh @@ -1,6 +1,19 @@ #!/bin/bash mkdir -p "/run/openvswitch" -if [[ ! -e "/var/lib/openvswitch/ovnsb.db" ]]; then - ovsdb-tool create "/var/lib/openvswitch/ovnsb.db" "/usr/share/openvswitch/ovn-sb.ovsschema" + +# Check for the presence of schema file in the old +# location before accessing it. +# Note: If latest OVN is used (post split from openvswitch), +# then the new location for the schema file +# is - /usr/share/ovn/ovn-sb.ovsschema. +# It is advisable to use the ovn-ctl script to start +# ovn SB db server. ovn-ctl takes care of creating the +# db file from the schema file if the db file is not +# present. ovn-ctl also takes care of updating the db file +# if the schema file is updated. +if [[ -e "/usr/share/openvswitch/ovn-sb.ovsschema" ]]; then + if [[ ! -e "/var/lib/openvswitch/ovnsb.db" ]]; then + ovsdb-tool create "/var/lib/openvswitch/ovnsb.db" "/usr/share/openvswitch/ovn-sb.ovsschema" + fi fi |
