Correctly use a dedicated database for glance.
Instead of sharing a database with nova, request our own database for glance. As of Folsom, using a sigle database no longer seems to work and was a bad to begin with. Also, remove a unncessary config snippet from the source tree.
This commit is contained in:
parent
0aaee5e268
commit
79c2e9c837
|
@ -15,7 +15,7 @@ options:
|
|||
default: glance
|
||||
type: string
|
||||
description: Database username
|
||||
nova-db:
|
||||
default: nova
|
||||
glance-db:
|
||||
default: glance
|
||||
type: string
|
||||
description: Nova database name
|
||||
description: Glance database name.
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
glance:
|
||||
glance-release: trunk
|
||||
registry-config: /etc/glance/glance-registry.conf
|
||||
api-config: /etc/glance/glance-api.conf
|
||||
db-user: glance
|
||||
nova-db: nova
|
|
@ -9,7 +9,7 @@ GLANCE_API_CONF=$(config-get api-config)
|
|||
GLANCE_API_PASTE_INI="/etc/glance/glance-api-paste.ini"
|
||||
|
||||
DB_USER=$(config-get db-user)
|
||||
NOVA_DB=$(config-get nova-db)
|
||||
GLANCE_DB=$(config-get glance)
|
||||
PPA=$(config-get glance-release)
|
||||
|
||||
HOSTNAME=`hostname -f`
|
||||
|
|
|
@ -35,8 +35,8 @@ function install_hook {
|
|||
}
|
||||
|
||||
function db_joined {
|
||||
juju-log "glance: db_joined: requesting access to $NOVA_DB for $DB_USER@`unit-get private-address`"
|
||||
relation-set database=$NOVA_DB
|
||||
juju-log "glance: db_joined: requesting access to $GLANCE_DB for $DB_USER@`unit-get private-address`"
|
||||
relation-set database=$GLANCE_DB
|
||||
relation-set username=$DB_USER
|
||||
relation-set hostname=`unit-get private-address`
|
||||
}
|
||||
|
@ -50,9 +50,9 @@ function db_changed {
|
|||
else
|
||||
echo "db_changed: Received password from $DB_HOST"
|
||||
fi
|
||||
juju-log "glance: db_changed: Configuring registry for access to $NOVA_DB@$DB_HOST"
|
||||
juju-log "glance: db_changed: Configuring registry for access to $GLANCE_DB@$DB_HOST"
|
||||
glance_ctl all stop
|
||||
set_or_update sql_connection "mysql://$DB_USER:$DB_PASSWORD@$DB_HOST/$NOVA_DB" registry
|
||||
set_or_update sql_connection "mysql://$DB_USER:$DB_PASSWORD@$DB_HOST/$GLANCE_DB" registry
|
||||
# Set the db version to 0 if its not under version control. We assume that any existing
|
||||
# database we are being related to was created WITH version control.
|
||||
if ! glance-manage db_version ; then
|
||||
|
|
Loading…
Reference in New Issue