Merge "unify logging setup on all services"
diff --git a/lib/nova b/lib/nova
index c47f81a..4d336f6 100644
--- a/lib/nova
+++ b/lib/nova
@@ -457,20 +457,15 @@
iniset $NOVA_CONF DEFAULT scheduler_driver "$SCHEDULER"
iniset $NOVA_CONF DEFAULT scheduler_default_filters "$FILTERS"
iniset $NOVA_CONF DEFAULT default_floating_pool "$PUBLIC_NETWORK_NAME"
- iniset $NOVA_CONF DEFAULT s3_host "$SERVICE_HOST"
- iniset $NOVA_CONF DEFAULT s3_port "$S3_SERVICE_PORT"
if [[ $SERVICE_IP_VERSION == 6 ]]; then
iniset $NOVA_CONF DEFAULT my_ip "$HOST_IPV6"
iniset $NOVA_CONF DEFAULT use_ipv6 "True"
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"
- iniset $NOVA_CONF DEFAULT s3_listen "$NOVA_SERVICE_LISTEN_ADDRESS"
if is_fedora || is_suse; then
# nova defaults to /usr/local/bin, but fedora and suse pip like to
@@ -478,6 +473,14 @@
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
diff --git a/lib/tempest b/lib/tempest
index 3312522..050ac38 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -507,13 +507,17 @@
iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
fi
- # Libvirt-LXC
- if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
- iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
- iniset $TEMPEST_CONFIG compute-feature-enabled resize False
- iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
- iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
- iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
+ # Libvirt
+ if [ "$VIRT_DRIVER" = "libvirt" ]; then
+ # Libvirt-LXC
+ if [ "$LIBVIRT_TYPE" = "lxc" ]; then
+ iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
+ iniset $TEMPEST_CONFIG compute-feature-enabled resize False
+ iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
+ iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
+ iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
+ fi
+ iniset $TEMPEST_CONFIG compute-feature-enabled swap_volume True
fi
# ``service_available``
diff --git a/tools/discover_hosts.sh b/tools/discover_hosts.sh
new file mode 100755
index 0000000..4ec6a40
--- /dev/null
+++ b/tools/discover_hosts.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+# **discover_hosts.sh**
+
+# This is just a very simple script to run the
+# "nova-manage cell_v2 discover_hosts" command
+# which is needed to discover compute nodes and
+# register them with a parent cell in Nova.
+# This assumes that /etc/nova/nova.conf exists
+# and has the following entries filled in:
+#
+# [api_database]
+# connection = This is the URL to the nova_api database
+#
+# In other words this should be run on the primary
+# (API) node in a multi-node setup.
+
+if [[ -x $(which nova-manage) ]]; then
+ nova-manage cell_v2 discover_hosts --verbose
+fi