From 1b457c9acfe7c0bcf7ba06dd4029d1e4ef9cdded Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 18 Jan 2017 07:53:33 -0500 Subject: [PATCH] remove db setting when no nova service need it We shouldn't have the db connection laying around if services don't need it. Change-Id: I9290e80c499c0c4644094e3c0666fd0ab002a23c --- lib/nova | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/nova b/lib/nova index 450242b579..3e29c1320d 100644 --- a/lib/nova +++ b/lib/nova @@ -465,8 +465,6 @@ function create_nova_conf { else iniset $NOVA_CONF DEFAULT my_ip "$HOST_IP" fi - iniset $NOVA_CONF database connection `database_connection_url nova` - iniset $NOVA_CONF api_database connection `database_connection_url nova_api` iniset $NOVA_CONF DEFAULT instance_name_template "${INSTANCE_NAME_PREFIX}%08x" iniset $NOVA_CONF DEFAULT osapi_compute_listen "$NOVA_SERVICE_LISTEN_ADDRESS" iniset $NOVA_CONF DEFAULT metadata_listen "$NOVA_SERVICE_LISTEN_ADDRESS" @@ -478,6 +476,14 @@ function create_nova_conf { iniset $NOVA_CONF DEFAULT bindir "/usr/bin" fi + # only setup database connections if there are services that + # require them running on the host. The ensures that n-cpu doesn't + # leak a need to use the db in a multinode scenario. + if is_service_enabled n-api n-cond n-sched; then + iniset $NOVA_CONF database connection `database_connection_url nova` + iniset $NOVA_CONF api_database connection `database_connection_url nova_api` + fi + if is_service_enabled n-api; then if is_service_enabled n-api-meta; then # If running n-api-meta as a separate service