Skip to content

Commit e8bad5c

Browse files
committed
Init placement before nova
With change I7e1e89cd66397883453935dcf7172d977bf82e84 the placement service may optionally use its own database. In order for this to work, however, the ordering of how both nova and placement are configured and initialized in stack.sh requires careful control. * nova.conf must be created first * then placement must make some adjustments to it * then lib/placement needs to create the placement database * before nova does a database sync (of both databases) Otherwise, when the placement_database/connection is defined, the nova db_sync command will fail because the placement database does not yet exist. If we try to do a sync before the nova_api database is created _that_ sync will fail. This patch adjusts the ordering and also removes a comment that will no longer be true when I7e1e89cd66397883453935dcf7172d977bf82e84 is merged. Change-Id: Id5b5911c04d198fe7b94c7d827afeb5cdf43a076
1 parent 24fa317 commit e8bad5c

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

lib/placement

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ PLACEMENT_UWSGI_CONF=$PLACEMENT_CONF_DIR/placement-uwsgi.ini
4444

4545
# The placement service can optionally use a separate database
4646
# connection. Set PLACEMENT_DB_ENABLED to True to use it.
47-
# NOTE(cdent): This functionality depends on some code that is not
48-
# yet merged in nova but is coming soon.
4947
PLACEMENT_DB_ENABLED=$(trueorfalse False PLACEMENT_DB_ENABLED)
5048

5149
if is_service_enabled tls-proxy; then
@@ -152,9 +150,9 @@ function create_placement_accounts {
152150
function init_placement {
153151
if [ "$PLACEMENT_DB_ENABLED" != False ]; then
154152
recreate_database placement
155-
time_start "dbsync"
156-
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF api_db sync
157-
time_stop "dbsync"
153+
# Database migration will be handled when nova does an api_db sync
154+
# TODO(cdent): When placement is extracted we'll do our own sync
155+
# here.
158156
fi
159157
create_placement_accounts
160158
}

stack.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,8 @@ if is_service_enabled neutron; then
894894
stack_install_service neutron
895895
fi
896896

897+
# Nova configuration is used by placement so we need to create nova.conf
898+
# first.
897899
if is_service_enabled nova; then
898900
# Compute service
899901
stack_install_service nova
@@ -1184,6 +1186,13 @@ if is_service_enabled cinder; then
11841186
init_cinder
11851187
fi
11861188

1189+
# Placement Service
1190+
# ---------------
1191+
1192+
if is_service_enabled placement; then
1193+
echo_summary "Configuring placement"
1194+
init_placement
1195+
fi
11871196

11881197
# Compute Service
11891198
# ---------------
@@ -1202,11 +1211,6 @@ if is_service_enabled nova; then
12021211
init_nova_cells
12031212
fi
12041213

1205-
if is_service_enabled placement; then
1206-
echo_summary "Configuring placement"
1207-
init_placement
1208-
fi
1209-
12101214

12111215
# Extras Configuration
12121216
# ====================

0 commit comments

Comments
 (0)