aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-10-03 00:20:31 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-10-03 01:16:44 -0400
commitb625b4c4c3d299e3830951304f468a5399828b51 (patch)
treeca62e1ff521cb2be4849930a52dd735d779c6b1b
parent718ecf27999c69acae27992123d2a7fe85d64c77 (diff)
downloadmeta-cloud-services-b625b4c4c3d299e3830951304f468a5399828b51.tar.gz
meta-cloud-services-b625b4c4c3d299e3830951304f468a5399828b51.tar.bz2
meta-cloud-services-b625b4c4c3d299e3830951304f468a5399828b51.zip
nova: add novnc console proxy support
With this commit the appropriate daemons are started on a control node boot to support horizon console access via the novnc proxy. Additionally, the proper nova configuration is set for boh the control and compute nodes for out of the box console connectivity between the compute, control and horizone interface. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb24
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova.inc3
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth75
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy72
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova/nova.conf5
5 files changed, 173 insertions, 6 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb
index 36b5ba3..c99a890 100644
--- a/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb
+++ b/meta-openstack/recipes-devtools/python/python-nova-controller_2013.1.3.bb
@@ -5,19 +5,24 @@ PR = "r0"
FILESEXTRAPATHS := "${THISDIR}/${PYTHON_PN}"
SRC_URI += "file://nova-all \
+ file://nova-consoleauth \
+ file://nova-novncproxy \
file://nova.conf \
file://openrc \
"
inherit hosts update-rc.d
-#PACKAGES = "${SRCNAME}-controller ${SRCNAME}-controller-misc"
PACKAGES = "${PN} ${PN}-dbg ${SRCNAME}-controller-misc ${SRCNAME}-controller"
+PACKAGES += " ${SRCNAME}-consoleauth"
+PACKAGES += " ${SRCNAME}-novncproxy"
do_install_append() {
if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/nova-all ${D}${sysconfdir}/init.d/nova-all
+ install -m 0755 ${WORKDIR}/nova-consoleauth ${D}${sysconfdir}/init.d/nova-consoleauth
+ install -m 0755 ${WORKDIR}/nova-novncproxy ${D}${sysconfdir}/init.d/nova-novncproxy
fi
}
@@ -49,7 +54,15 @@ pkg_postinst_${SRCNAME}-controller () {
FILES_${SRCNAME}-controller = " \
${bindir} \
${sysconfdir}/${SRCNAME}/* \
- ${sysconfdir}/init.d/nova-all"
+ ${sysconfdir}/init.d/nova-all \
+"
+
+FILES_${SRCNAME}-consoleauth = " \
+ ${sysconfdir}/init.d/nova-consoleauth \
+"
+FILES_${SRCNAME}-novncproxy = " \
+ ${sysconfdir}/init.d/nova-novncproxy \
+"
FILES_${SRCNAME}-controller-misc = " \
${bindir}/nova-compute \
@@ -62,10 +75,13 @@ FILES_${SRCNAME}-controller-misc = " \
FILES_${PN} = " \
${libdir}/python*/site-packages"
-RDEPENDS_${SRCNAME}-controller = "${PYTHON_PN} ${SRCNAME}-common \
+RDEPENDS_${SRCNAME}-controller = "${PYTHON_PN} ${SRCNAME}-common ${SRCNAME}-consoleauth \
+ ${SRCNAME}-novncproxy \
postgresql postgresql-client python-psycopg2"
RCONFLICTS_${SRCNAME}-controller = "${SRCNAME}-compute"
-INITSCRIPT_PACKAGES = "${SRCNAME}-controller"
+INITSCRIPT_PACKAGES = "${SRCNAME}-controller ${SRCNAME}-consoleauth ${SRCNAME}-novncproxy"
INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all"
+INITSCRIPT_NAME_${SRCNAME}-consoleauth = "nova-consoleauth"
+INITSCRIPT_NAME_${SRCNAME}-novncproxy = "nova-novncproxy"
diff --git a/meta-openstack/recipes-devtools/python/python-nova.inc b/meta-openstack/recipes-devtools/python/python-nova.inc
index 01483e7..e520130 100644
--- a/meta-openstack/recipes-devtools/python/python-nova.inc
+++ b/meta-openstack/recipes-devtools/python/python-nova.inc
@@ -68,6 +68,9 @@ do_install_append() {
sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/nova.conf
sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/nova.conf
+ sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${WORKDIR}/nova.conf
+ sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${WORKDIR}/nova.conf
+
sed -e "s:%OS_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${WORKDIR}/openrc
sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${WORKDIR}/openrc
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth b/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth
new file mode 100644
index 0000000..13ad285
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth
@@ -0,0 +1,75 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: nova-consoleauth
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Should-Start: libvirt-bin
+# Should-Stop: libvirt-bin
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: nova-consoleauth service
+# Description: Provides console services for the openstack
+# cloud computing system
+### END INIT INFO
+
+
+set -e
+
+DAEMON=/usr/bin/nova-consoleauth
+DAEMON_ARGS=""
+PIDFILE=/var/run/nova/nova-consoleauth.pid
+
+ENABLED=true
+
+if test -f /etc/default/nova-consoleauth; then
+ . /etc/default/nova-consoleauth
+fi
+
+mkdir -p /var/run/nova
+chown nova:root /var/run/nova/
+
+mkdir -p /var/lock/nova
+chown nova:root /var/lock/nova/
+
+#uid="$(getent passwd nova | cut -f3 -d:)"
+#gid="$(getent passwd nova | cut -f4 -d:)"
+
+. /lib/lsb/init-functions
+
+export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+export TMPDIR=/var/lib/nova/tmp
+
+if ! [ -x ${DAEMON} ] ; then
+ exit 0
+fi
+
+case "$1" in
+ start)
+ test "$ENABLED" = "true" || exit 0
+ echo "Starting nova console" "nova-consoleauth"
+ start-stop-daemon --start -b -m --pidfile $PIDFILE --exec ${DAEMON} -- ${DAEMON_ARGS}
+ log_end_msg $?
+ ;;
+ stop)
+ test "$ENABLED" = "true" || exit 0
+ echo "Stopping nova console" "nova-consoleauth"
+ start-stop-daemon --stop --oknodo --pidfile ${PIDFILE}
+ log_end_msg $?
+ ;;
+ restart|force-reload)
+ test "$ENABLED" = "true" || exit 1
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ test "$ENABLED" = "true" || exit 0
+ status_of_proc -p $PIDFILE $DAEMON nova-consoleauth && exit 0 || exit $?
+ ;;
+ *)
+ echo "Usage: /etc/init.d/nova-consoleauth {start|stop|restart|force-reload|status}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy b/meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy
new file mode 100644
index 0000000..76cd1df
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy
@@ -0,0 +1,72 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: nova-novncproxy
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Should-Start: libvirt-bin
+# Should-Stop: libvirt-bin
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: nova-novncproxy service
+# Description: Provides vnc proxy services for the openstack
+# cloud computing system
+### END INIT INFO
+
+
+set -e
+
+DAEMON=/usr/bin/nova-novncproxy
+DAEMON_ARGS=""
+PIDFILE=/var/run/nova/nova-novncproxy.pid
+
+ENABLED=true
+
+if test -f /etc/default/nova-novncproxy; then
+ . /etc/default/nova-novncproxy
+fi
+
+mkdir -p /var/run/nova
+chown nova:root /var/run/nova/
+
+mkdir -p /var/lock/nova
+chown nova:root /var/lock/nova/
+
+. /lib/lsb/init-functions
+
+export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+export TMPDIR=/var/lib/nova/tmp
+
+if ! [ -x ${DAEMON} ] ; then
+ exit 0
+fi
+
+case "$1" in
+ start)
+ test "$ENABLED" = "true" || exit 0
+ echo "Starting nova vnc proxy" "nova-novncproxy"
+ start-stop-daemon --start -b -m --pidfile $PIDFILE --exec ${DAEMON} -- ${DAEMON_ARGS}
+ log_end_msg $?
+ ;;
+ stop)
+ test "$ENABLED" = "true" || exit 0
+ echo "Stopping nova vnc proxy" "nova-novncproxy"
+ start-stop-daemon --stop --oknodo --pidfile ${PIDFILE}
+ log_end_msg $?
+ ;;
+ restart|force-reload)
+ test "$ENABLED" = "true" || exit 1
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ test "$ENABLED" = "true" || exit 0
+ status_of_proc -p $PIDFILE $DAEMON nova-novncproxy && exit 0 || exit $?
+ ;;
+ *)
+ echo "Usage: /etc/init.d/nova-novncproxy {start|stop|restart|force-reload|status}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova.conf b/meta-openstack/recipes-devtools/python/python-nova/nova.conf
index 695f084..20db54d 100644
--- a/meta-openstack/recipes-devtools/python/python-nova/nova.conf
+++ b/meta-openstack/recipes-devtools/python/python-nova/nova.conf
@@ -22,7 +22,9 @@ glance_host = %CONTROLLER_IP%
#VNC
vnc_enabled = true
-vncserver_listen = 0.0.0.0
+vncserver_listen = %COMPUTE_IP%
+novncproxy_base_url=http://%CONTROLLER_IP%:6080/vnc_auto.html
+vncserver_proxyclient_address=%COMPUTE_IP%
#Network
flat_interface = eth0
@@ -35,7 +37,6 @@ force_dhcp_release=False
dhcpbridge=/usr/bin/nova-dhcpbridge
#Database configuration
-# sql_connection = postgresql://%DB_USER%:%DB_PASSWORD%@localhost/nova
sql_connection = postgresql://%DB_USER%:%DB_PASSWORD%@%CONTROLLER_IP%/nova
#RabbitMQ configuration