diff --git a/lib/glance b/lib/glance index b4cab2ad74..740bcabf6a 100644 --- a/lib/glance +++ b/lib/glance @@ -276,18 +276,16 @@ function init_glance { rm -rf $GLANCE_IMAGE_DIR mkdir -p $GLANCE_IMAGE_DIR - if is_service_enabled $DATABASE_BACKENDS; then - # (Re)create glance database - recreate_database glance + # (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" - fi + # Load metadata definitions + $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs + time_stop "dbsync" } # install_glanceclient() - Collect source and prepare diff --git a/stack.sh b/stack.sh index 089510fa48..fe71eae36c 100755 --- a/stack.sh +++ b/stack.sh @@ -1155,7 +1155,8 @@ fi # Glance # ------ -if is_service_enabled g-reg; then +# NOTE(yoctozepto): limited to node hosting the database which is the controller +if is_service_enabled $DATABASE_BACKENDS && is_service_enabled glance; then echo_summary "Configuring Glance" init_glance fi @@ -1280,8 +1281,8 @@ fi # scripts as userdata. # See https://help.ubuntu.com/community/CloudInit for more on ``cloud-init`` -if is_service_enabled g-reg; then - +# NOTE(yoctozepto): limited to node hosting the database which is the controller +if is_service_enabled $DATABASE_BACKENDS && is_service_enabled glance; then echo_summary "Uploading images" for image_url in ${IMAGE_URLS//,/ }; do