summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2014-11-24 15:37:01 +0000
committerRichard Ipsum <richardipsum@fastmail.co.uk>2014-11-27 18:12:14 +0000
commit439d33aee360df3effe81c60824ec09628f122cf (patch)
tree28d03101f1a97b472ba64db8dcde3a323cca0de1
parentd020ad40229ebee90d19e57388ea83e678789075 (diff)
downloaddefinitions-439d33aee360df3effe81c60824ec09628f122cf.tar.gz
FIXUPME: Fix nova-setup script: add services, add needed directories and sort them by runtime dependencies
-rw-r--r--openstack/usr/share/openstack/openstack-nova-setup58
1 files changed, 39 insertions, 19 deletions
diff --git a/openstack/usr/share/openstack/openstack-nova-setup b/openstack/usr/share/openstack/openstack-nova-setup
index a2128095..28b6db01 100644
--- a/openstack/usr/share/openstack/openstack-nova-setup
+++ b/openstack/usr/share/openstack/openstack-nova-setup
@@ -39,12 +39,6 @@ keystone endpoint-create --service-id $(keystone service-list | awk '/ compute
--adminurl ##NOVA_ADMIN_URL## \
--region ##NOVA_REGION##
-# Setup the nova database
-if [ ! -e /var/lib/nova/nova.sqlite ]; then
- chown -R nova:nova /var/lib/nova
- sudo -u nova nova-manage db sync
-fi
-
# Nova compute configuration
if [ ! -d /var/run/nova ]; then
mkdir -p /var/run/nova
@@ -56,48 +50,74 @@ if [ ! -d /var/lock/nova ]; then
chown -R nova:nova /var/lock/nova
fi
+if [ ! -d /var/log/nova ]; then
+ mkdir -p /var/log/nova
+ chown -R nova:nova /var/log/nova
+fi
+
if [ ! -d /var/lib/nova/instances ]; then
mkdir /var/lib/nova/instances
chown -R nova:nova /var/lib/nova/instances
fi
+# Setup the nova database
+if [ ! -e /var/lib/nova/nova.sqlite ]; then
+ chown -R nova:nova /var/lib/nova
+ sudo -u nova nova-manage db sync
+fi
+
# Nova compute needs to write in /var/run/libvirt/libvirt-sock
# to start the hypervisor
chmod 766 /var/run/libvirt/libvirt-sock
+# Nova novncproxy needs /usr/share/novnc folder available
+if [ ! -d /usr/share/novnc ]; then
+ mkdir /usr/share/novnc
+ chown -R nova:nova /usr/share/novnc
+fi
+
# Check existence of Network Block Device module in the kernel
# NOTE: modprobe does not work actually and returns always
# failure, enable this check when modprobe is fixed.
#modprobe nbd
+# Remove the one-shot setup service
+rm /etc/systemd/system/multi-user.target.wants/openstack-nova-setup.service
+
+# Start nova services
systemctl start openstack-nova-compute
# [1] Never enable openstack-nova-conductor service in a node with
# openstack-nova-compute or the security benefits of removing
# database access from nova-compute will be negated
#systemctl start openstack-nova-conductor
-#systemctl start openstack-nova-api
-#systemctl start openstack-nova-cert
-#systemctl start openstack-nova-consoleauth
-#systemctl start openstack-nova-scheduler
-#systemctl start openstack-nova-novncproxy
+systemctl start openstack-nova-api
+systemctl start openstack-nova-cert
+systemctl start openstack-nova-consoleauth
+systemctl start openstack-nova-scheduler
+systemctl start openstack-nova-novncproxy
#systemctl start openstack-nova-xvpnvncproxy
-# TODO, need to start more nova services.
-
+# Create the links to run nova services when system start next times.
ln -s "/etc/systemd/system/openstack-nova-compute.service" \
"/etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service"
# See description of why this shouldn't run in a openstack in one node in [1]
#ln -s "/etc/systemd/system/openstack-nova-conductor.service" \
# "/etc/systemd/system/multi-user.target.wants/openstack-nova-conductor.service"
-#ln -s "/etc/systemd/system/openstack-nova-api.service" \
-# "/etc/systemd/system/multi-user.target.wants/openstack-nova-api.service"
+ln -s "/etc/systemd/system/openstack-nova-api.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-nova-api.service"
+
+ln -s "/etc/systemd/system/openstack-nova-cert.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-nova-cert.service"
+
+ln -s "/etc/systemd/system/openstack-nova-consoleauth.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-nova-consoleauth.service"
-#ln -s "/etc/systemd/system/openstack-nova-api.service" \
-# "/etc/systemd/system/multi-user.target.wants/openstack-nova-api.service"
+ln -s "/etc/systemd/system/openstack-nova-scheduler.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-nova-scheduler.service"
-#ln -s "/etc/systemd/system/openstack-nova-cert.service" \
-# "/etc/systemd/system/multi-user.target.wants/openstack-nova-cert.service"
+ln -s "/etc/systemd/system/openstack-nova-novncproxy.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-nova-novncproxy.service"
exit 0