@@ -34,6 +34,7 @@ GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images}
3434GLANCE_AUTH_CACHE_DIR=${GLANCE_AUTH_CACHE_DIR:-/var/cache/glance}
3535
3636GLANCE_CONF_DIR=${GLANCE_CONF_DIR:-/etc/glance}
37+ GLANCE_METADEF_DIR=$GLANCE_CONF_DIR/metadefs
3738GLANCE_REGISTRY_CONF=$GLANCE_CONF_DIR/glance-registry.conf
3839GLANCE_API_CONF=$GLANCE_CONF_DIR/glance-api.conf
3940GLANCE_REGISTRY_PASTE_INI=$GLANCE_CONF_DIR/glance-registry-paste.ini
@@ -81,6 +82,11 @@ function configure_glance {
8182 fi
8283 sudo chown $STACK_USER $GLANCE_CONF_DIR
8384
85+ if [[ ! -d $GLANCE_METADEF_DIR ]]; then
86+ sudo mkdir -p $GLANCE_METADEF_DIR
87+ fi
88+ sudo chown $STACK_USER $GLANCE_METADEF_DIR
89+
8490 # Copy over our glance configurations and update them
8591 cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
8692 iniset $GLANCE_REGISTRY_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
@@ -177,6 +183,8 @@ function configure_glance {
177183
178184 cp -p $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
179185 cp -p $GLANCE_DIR/etc/schema-image.json $GLANCE_SCHEMA_JSON
186+
187+ cp -p $GLANCE_DIR/etc/metadefs/*.json $GLANCE_METADEF_DIR
180188}
181189
182190# create_glance_accounts() - Set up common required glance accounts
@@ -241,6 +249,9 @@ function init_glance {
241249 # Migrate glance database
242250 $GLANCE_BIN_DIR/glance-manage db_sync
243251
252+ # Load metadata definitions
253+ $GLANCE_BIN_DIR/glance-manage db_load_metadefs
254+
244255 create_glance_cache_dir
245256}
246257
0 commit comments