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] d8dec362baa2bf7f6ffe1c47352fdbe032eaf20a 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
|
rm -rf $GLANCE_IMAGE_DIR
|
||||||
mkdir -p $GLANCE_IMAGE_DIR
|
mkdir -p $GLANCE_IMAGE_DIR
|
||||||
|
|
||||||
# (Re)create glance database
|
if is_service_enabled $DATABASE_BACKENDS; then
|
||||||
recreate_database glance
|
# (Re)create glance database
|
||||||
|
recreate_database glance
|
||||||
|
|
||||||
time_start "dbsync"
|
time_start "dbsync"
|
||||||
# Migrate glance database
|
# Migrate glance database
|
||||||
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync
|
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync
|
||||||
|
|
||||||
# Load metadata definitions
|
# Load metadata definitions
|
||||||
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs
|
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs
|
||||||
time_stop "dbsync"
|
time_stop "dbsync"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# install_glanceclient() - Collect source and prepare
|
# install_glanceclient() - Collect source and prepare
|
||||||
|
Loading…
x
Reference in New Issue
Block a user