Init Glance database only on the node with the database backend
Since [1] Glance init depends on either g-api or g-reg being
enabled.
This broke multinode g-api deployments with singlenode database
backend.
This commit aligns Glance with other services w.r.t when to
apply database init.
[1] d8dec362ba
Change-Id: Idc07764d6ba3a828f19691f56c73cbe9179c2673
Closes-bug: #1860021
This commit is contained in:
parent
035b41b9b2
commit
ec3543a028
18
lib/glance
18
lib/glance
@ -276,16 +276,18 @@ function init_glance {
|
||||
rm -rf $GLANCE_IMAGE_DIR
|
||||
mkdir -p $GLANCE_IMAGE_DIR
|
||||
|
||||
# (Re)create glance database
|
||||
recreate_database glance
|
||||
if is_service_enabled $DATABASE_BACKENDS; then
|
||||
# (Re)create glance database
|
||||
recreate_database glance
|
||||
|
||||
time_start "dbsync"
|
||||
# Migrate glance database
|
||||
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync
|
||||
time_start "dbsync"
|
||||
# Migrate glance database
|
||||
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync
|
||||
|
||||
# Load metadata definitions
|
||||
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs
|
||||
time_stop "dbsync"
|
||||
# Load metadata definitions
|
||||
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs
|
||||
time_stop "dbsync"
|
||||
fi
|
||||
}
|
||||
|
||||
# install_glanceclient() - Collect source and prepare
|
||||
|
Loading…
Reference in New Issue
Block a user