diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-04-14 18:54:57 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-17 15:35:24 +0000 |
commit | 16ec568ee57045464cd2435358a28c25820a6a61 (patch) | |
tree | ed4a0f5936c03ba7e49db11f6d056b5b9ce15136 /openstack-nova.configure | |
parent | f1baa4ade17fcd1eaa2fed4aecf3901c414acc9a (diff) | |
download | definitions-16ec568ee57045464cd2435358a28c25820a6a61.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.configure | 86 |
1 files changed, 65 insertions, 21 deletions
diff --git a/openstack-nova.configure b/openstack-nova.configure index d2f790f0..4e30d93a 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 @@ -86,6 +69,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 ########################################################################## |