summaryrefslogtreecommitdiff
path: root/openstack-nova.configure
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-04-14 18:54:57 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-04-16 04:09:41 +0000
commit8de7d921a3f8b7375691a4fbcfcfa8a66c49226c (patch)
tree50b7d54b47b710afbd35365bff021131e5ddfaa9 /openstack-nova.configure
parent65e059c107ffad30aed47e3c38774e8f33783089 (diff)
downloaddefinitions-8de7d921a3f8b7375691a4fbcfcfa8a66c49226c.tar.gz
OpenStack: Split nova into control and compute
This adds NOVA_ENABLE_{CONTROLLER,COMPUTE}. Both are enabled by deafult, but if CONTROLLER is enabled but COMPUTE isn't, then the conductor service is enabled. Change-Id: I523a7270d4afdcd1e2a30eaac42ea499581fe971
Diffstat (limited to 'openstack-nova.configure')
-rw-r--r--openstack-nova.configure86
1 files changed, 65 insertions, 21 deletions
diff --git a/openstack-nova.configure b/openstack-nova.configure
index 3605f8b9..b1ad237f 100644
--- a/openstack-nova.configure
+++ b/openstack-nova.configure
@@ -18,27 +18,10 @@ set -e
ROOT="$1"
-##########################################################################
-
-ln -sf "/usr/lib/systemd/system/openstack-nova-setup.service" \
- "$ROOT/etc/systemd/system/multi-user.target.wants/openstack-nova-setup.service"
-
-##########################################################################
-# Enable libvirtd and libvirt-guests services
-##########################################################################
-
-wants_dir="$ROOT"/usr/lib/systemd/system/multi-user.target.wants
-mkdir -p "$wants_dir"
-mkdir -p "$ROOT"/var/lock/subsys
-ln -sf ../libvirtd.service "$wants_dir/libvirtd.service"
-
-##########################################################################
-# Change iprange for the interal libvirt to avoid clashes
-# with eth0 ip range
-##########################################################################
-
-sed -i "s/192\.168\.122\./192\.168\.1\./g" \
- "$ROOT"/etc/libvirt/qemu/networks/default.xml
+enable(){
+ ln -sf "/usr/lib/systemd/system/openstack-nova-$1.service" \
+ "$ROOT/etc/systemd/system/multi-user.target.wants/openstack-nova-$1.service"
+}
##########################################################################
# Check variables
@@ -83,6 +66,67 @@ if [ -z "$NOVA_SERVICE_USER" -o \
exit 1
fi
+# Check optional variables
+
+unnaceptable(){
+ eval echo Unexpected value \$$1 for $1 >&2
+ exit 1
+}
+
+check_bool(){
+ case "$(eval echo \"\$$1\")" in
+ True|'')
+ eval "$1=true"
+ ;;
+ False)
+ eval "$1=false"
+ ;;
+ *)
+ unnaceptable "$1"
+ ;;
+ esac
+}
+
+check_bool NOVA_ENABLE_CONTROLLER
+check_bool NOVA_ENABLE_COMPUTE
+
+###############################################
+# Enable libvirtd and libvirt-guests services #
+###############################################
+
+wants_dir="$ROOT"/usr/lib/systemd/system/multi-user.target.wants
+mkdir -p "$wants_dir"
+mkdir -p "$ROOT"/var/lock/subsys
+ln -sf ../libvirtd.service "$wants_dir/libvirtd.service"
+
+######################################
+# Enable relevant openstack services #
+######################################
+
+if "$NOVA_ENABLE_CONTROLLER" || "$NOVA_ENABLE_COMPUTE"; then
+ enable config-setup
+fi
+if "$NOVA_ENABLE_CONTROLLER" && ! "$NOVA_ENABLE_COMPUTE"; then
+ enable conductor
+fi
+if "$NOVA_ENABLE_COMPUTE"; then
+ enable compute
+fi
+if "$NOVA_ENABLE_CONTROLLER"; then
+ for service in db-setup api cert consoleauth novncproxy scheduler serialproxy; do
+ enable "$service"
+ done
+fi
+
+##########################################################################
+# Change iprange for the interal libvirt to avoid clashes
+# with eth0 ip range
+##########################################################################
+
+sed -i "s/192\.168\.122\./192\.168\.1\./g" \
+ "$ROOT"/etc/libvirt/qemu/networks/default.xml
+
+
##########################################################################
# Generate configuration file
##########################################################################