|
...
|
...
|
@@ -55,8 +55,6 @@ GLANCE_CACHE_CONF=$GLANCE_CONF_DIR/glance-cache.conf
|
|
55
|
55
|
GLANCE_POLICY_JSON=$GLANCE_CONF_DIR/policy.json
|
|
56
|
56
|
GLANCE_SCHEMA_JSON=$GLANCE_CONF_DIR/schema-image.json
|
|
57
|
57
|
GLANCE_SWIFT_STORE_CONF=$GLANCE_CONF_DIR/glance-swift-store.conf
|
|
58
|
|
-GLANCE_GLARE_CONF=$GLANCE_CONF_DIR/glance-glare.conf
|
|
59
|
|
-GLANCE_GLARE_PASTE_INI=$GLANCE_CONF_DIR/glance-glare-paste.ini
|
|
60
|
58
|
GLANCE_V1_ENABLED=${GLANCE_V1_ENABLED:-False}
|
|
61
|
59
|
|
|
62
|
60
|
if is_ssl_enabled_service "glance" || is_service_enabled tls-proxy; then
|
|
...
|
...
|
@@ -72,8 +70,6 @@ GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$GLANCE_SERVICE_HOST:$GLANCE_SERVICE_PORT}
|
|
72
|
72
|
GLANCE_SERVICE_PROTOCOL=${GLANCE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
|
|
73
|
73
|
GLANCE_REGISTRY_PORT=${GLANCE_REGISTRY_PORT:-9191}
|
|
74
|
74
|
GLANCE_REGISTRY_PORT_INT=${GLANCE_REGISTRY_PORT_INT:-19191}
|
|
75
|
|
-GLANCE_GLARE_PORT=${GLANCE_GLARE_PORT:-9494}
|
|
76
|
|
-GLANCE_GLARE_HOSTPORT=${GLANCE_GLARE_HOSTPORT:-$GLANCE_SERVICE_HOST:$GLANCE_GLARE_PORT}
|
|
77
|
75
|
|
|
78
|
76
|
# Functions
|
|
79
|
77
|
# ---------
|
|
...
|
...
|
@@ -98,9 +94,6 @@ function configure_glance {
|
|
98
|
98
|
sudo install -d -o $STACK_USER $GLANCE_CONF_DIR $GLANCE_METADEF_DIR
|
|
99
|
99
|
|
|
100
|
100
|
# Copy over our glance configurations and update them
|
|
101
|
|
- if is_service_enabled g-glare; then
|
|
102
|
|
- cp $GLANCE_DIR/etc/glance-glare.conf $GLANCE_GLARE_CONF
|
|
103
|
|
- fi
|
|
104
|
101
|
cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
|
|
105
|
102
|
iniset $GLANCE_REGISTRY_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
|
106
|
103
|
iniset $GLANCE_REGISTRY_CONF DEFAULT bind_host $GLANCE_SERVICE_LISTEN_ADDRESS
|
|
...
|
...
|
@@ -143,9 +136,6 @@ function configure_glance {
|
|
143
|
143
|
|
|
144
|
144
|
# Store specific configs
|
|
145
|
145
|
iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
|
|
146
|
|
- if is_service_enabled g-glare; then
|
|
147
|
|
- iniset $GLANCE_GLARE_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
|
|
148
|
|
- fi
|
|
149
|
146
|
iniset $GLANCE_API_CONF DEFAULT registry_host $GLANCE_SERVICE_HOST
|
|
150
|
147
|
|
|
151
|
148
|
iniset $GLANCE_API_CONF DEFAULT workers "$API_WORKERS"
|
|
...
|
...
|
@@ -172,22 +162,6 @@ function configure_glance {
|
|
172
|
172
|
|
|
173
|
173
|
iniset $GLANCE_SWIFT_STORE_CONF ref1 user $SERVICE_PROJECT_NAME:glance-swift
|
|
174
|
174
|
|
|
175
|
|
- # Store the glare in swift if enabled.
|
|
176
|
|
- if is_service_enabled g-glare; then
|
|
177
|
|
- iniset $GLANCE_GLARE_CONF glance_store default_store swift
|
|
178
|
|
- iniset $GLANCE_GLARE_CONF glance_store swift_store_create_container_on_put True
|
|
179
|
|
-
|
|
180
|
|
- iniset $GLANCE_GLARE_CONF glance_store swift_store_config_file $GLANCE_SWIFT_STORE_CONF
|
|
181
|
|
- iniset $GLANCE_GLARE_CONF glance_store default_swift_reference ref1
|
|
182
|
|
- iniset $GLANCE_GLARE_CONF glance_store stores "file, http, swift"
|
|
183
|
|
- iniset $GLANCE_GLARE_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
|
|
184
|
|
-
|
|
185
|
|
- # commenting is not strictly necessary but it's confusing to have bad values in conf
|
|
186
|
|
- inicomment $GLANCE_GLARE_CONF glance_store swift_store_user
|
|
187
|
|
- inicomment $GLANCE_GLARE_CONF glance_store swift_store_key
|
|
188
|
|
- inicomment $GLANCE_GLARE_CONF glance_store swift_store_auth_address
|
|
189
|
|
- fi
|
|
190
|
|
-
|
|
191
|
175
|
iniset $GLANCE_SWIFT_STORE_CONF ref1 key $SERVICE_PASSWORD
|
|
192
|
176
|
if python3_enabled; then
|
|
193
|
177
|
# NOTE(dims): Currently the glance_store+swift does not support either an insecure flag
|
|
...
|
...
|
@@ -266,29 +240,6 @@ function configure_glance {
|
|
266
|
266
|
iniset $GLANCE_API_CONF DEFAULT cinder_endpoint_template "https://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/%(project_id)s"
|
|
267
|
267
|
iniset $GLANCE_CACHE_CONF DEFAULT cinder_endpoint_template "https://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/%(project_id)s"
|
|
268
|
268
|
fi
|
|
269
|
|
-
|
|
270
|
|
- # Configure GLANCE_GLARE (Glance Glare)
|
|
271
|
|
- if is_service_enabled g-glare; then
|
|
272
|
|
- local dburl
|
|
273
|
|
- dburl=`database_connection_url glance`
|
|
274
|
|
- setup_logging $GLANCE_GLARE_CONF
|
|
275
|
|
- iniset $GLANCE_GLARE_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
|
276
|
|
- iniset $GLANCE_GLARE_CONF DEFAULT bind_host $GLANCE_SERVICE_LISTEN_ADDRESS
|
|
277
|
|
- iniset $GLANCE_GLARE_CONF DEFAULT bind_port $GLANCE_GLARE_PORT
|
|
278
|
|
- inicomment $GLANCE_GLARE_CONF DEFAULT log_file
|
|
279
|
|
- iniset $GLANCE_GLARE_CONF DEFAULT workers "$API_WORKERS"
|
|
280
|
|
-
|
|
281
|
|
- iniset $GLANCE_GLARE_CONF database connection $dburl
|
|
282
|
|
- iniset $GLANCE_GLARE_CONF paste_deploy flavor keystone
|
|
283
|
|
- configure_auth_token_middleware $GLANCE_GLARE_CONF glare $GLANCE_AUTH_CACHE_DIR/artifact
|
|
284
|
|
- # Register SSL certificates if provided
|
|
285
|
|
- if is_ssl_enabled_service glance; then
|
|
286
|
|
- ensure_certificates GLANCE
|
|
287
|
|
- iniset $GLANCE_GLARE_CONF DEFAULT cert_file "$GLANCE_SSL_CERT"
|
|
288
|
|
- iniset $GLANCE_GLARE_CONF DEFAULT key_file "$GLANCE_SSL_KEY"
|
|
289
|
|
- fi
|
|
290
|
|
- cp $GLANCE_DIR/etc/glance-glare-paste.ini $GLANCE_GLARE_PASTE_INI
|
|
291
|
|
- fi
|
|
292
|
269
|
}
|
|
293
|
270
|
|
|
294
|
271
|
# create_glance_accounts() - Set up common required glance accounts
|
|
...
|
...
|
@@ -298,7 +249,6 @@ function configure_glance {
|
|
298
|
298
|
# SERVICE_PROJECT_NAME glance service
|
|
299
|
299
|
# SERVICE_PROJECT_NAME glance-swift ResellerAdmin (if Swift is enabled)
|
|
300
|
300
|
# SERVICE_PROJECT_NAME glance-search search (if Search is enabled)
|
|
301
|
|
-# SERVICE_PROJECT_NAME glare service (if enabled)
|
|
302
|
301
|
|
|
303
|
302
|
function create_glance_accounts {
|
|
304
|
303
|
if is_service_enabled g-api; then
|
|
...
|
...
|
@@ -321,16 +271,6 @@ function create_glance_accounts {
|
|
321
|
321
|
iniset $GLANCE_SWIFT_STORE_CONF ref1 project_domain_id $service_domain_id
|
|
322
|
322
|
iniset $GLANCE_SWIFT_STORE_CONF ref1 user_domain_id $service_domain_id
|
|
323
|
323
|
fi
|
|
324
|
|
-
|
|
325
|
|
- # Add glance-glare service and endpoints
|
|
326
|
|
- if is_service_enabled g-glare; then
|
|
327
|
|
- create_service_user "glare"
|
|
328
|
|
- get_or_create_service "glare" "artifact" "Glance Artifact Service"
|
|
329
|
|
-
|
|
330
|
|
- get_or_create_endpoint "artifact" \
|
|
331
|
|
- "$REGION_NAME" \
|
|
332
|
|
- "$GLANCE_SERVICE_PROTOCOL://$GLANCE_GLARE_HOSTPORT"
|
|
333
|
|
- fi
|
|
334
|
324
|
}
|
|
335
|
325
|
|
|
336
|
326
|
# create_glance_cache_dir() - Part of the init_glance() process
|
|
...
|
...
|
@@ -400,15 +340,6 @@ function start_glance {
|
|
400
|
400
|
if ! wait_for_service $SERVICE_TIMEOUT $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT; then
|
|
401
|
401
|
die $LINENO "g-api did not start"
|
|
402
|
402
|
fi
|
|
403
|
|
-
|
|
404
|
|
- #Start g-glare after g-reg/g-api
|
|
405
|
|
- if is_service_enabled g-glare; then
|
|
406
|
|
- run_process g-glare "$GLANCE_BIN_DIR/glance-glare --config-file=$GLANCE_CONF_DIR/glance-glare.conf"
|
|
407
|
|
- echo "Waiting for Glare [g-glare] ($GLANCE_GLARE_HOSTPORT) to start..."
|
|
408
|
|
- if ! wait_for_service $SERVICE_TIMEOUT $GLANCE_SERVICE_PROTOCOL://$GLANCE_GLARE_HOSTPORT; then
|
|
409
|
|
- die $LINENO " Glare [g-glare] did not start"
|
|
410
|
|
- fi
|
|
411
|
|
- fi
|
|
412
|
403
|
}
|
|
413
|
404
|
|
|
414
|
405
|
# stop_glance() - Stop running processes
|
|
...
|
...
|
@@ -416,10 +347,6 @@ function stop_glance {
|
|
416
|
416
|
# Kill the Glance screen windows
|
|
417
|
417
|
stop_process g-api
|
|
418
|
418
|
stop_process g-reg
|
|
419
|
|
-
|
|
420
|
|
- if is_service_enabled g-glare; then
|
|
421
|
|
- stop_process g-glare
|
|
422
|
|
- fi
|
|
423
|
419
|
}
|
|
424
|
420
|
|
|
425
|
421
|
# Restore xtrace
|