Browse code

Add support for setting up nova-spicehtml5proxy

Add a new service 'n-spice' which is off by default, but can
be enabled to turn on SPICE support in the Nova libvirt driver.
Also if neither n-novnc or n-xvnc are enabled, then disable
VNC support. This allows running in a SPICE only environment.

The spice-html5 repo will be checked out to support the Horizon
client integration

Change-Id: If74fad33a7b491450afd823758d35b06ebe72cb9
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

Daniel P. Berrange authored on 2013/01/03 20:51:42
Showing 4 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1 @@
0
+numpy
... ...
@@ -551,13 +551,14 @@ function start_nova() {
551 551
     screen_it n-sch "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-scheduler"
552 552
     screen_it n-novnc "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-novncproxy --config-file $NOVA_CONF --web $NOVNC_DIR"
553 553
     screen_it n-xvnc "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-xvpvncproxy --config-file $NOVA_CONF"
554
+    screen_it n-spice "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-spicehtml5proxy --config-file $NOVA_CONF --web $SPICE_DIR"
554 555
     screen_it n-cauth "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-consoleauth"
555 556
 }
556 557
 
557 558
 # stop_nova() - Stop running processes (non-screen)
558 559
 function stop_nova() {
559 560
     # Kill the nova screen windows
560
-    for serv in n-api n-cpu n-crt n-net n-sch n-novnc n-xvnc n-cauth n-cond; do
561
+    for serv in n-api n-cpu n-crt n-net n-sch n-novnc n-xvnc n-cauth n-cond n-spice; do
561 562
         screen -S $SCREEN_NAME -p $serv -X kill
562 563
     done
563 564
 }
... ...
@@ -313,6 +313,7 @@ source $TOP_DIR/lib/baremetal
313 313
 HORIZON_DIR=$DEST/horizon
314 314
 OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
315 315
 NOVNC_DIR=$DEST/noVNC
316
+SPICE_DIR=$DEST/spice-html5
316 317
 SWIFT3_DIR=$DEST/swift3
317 318
 
318 319
 # Should cinder perform secure deletion of volumes?
... ...
@@ -716,6 +717,10 @@ if is_service_enabled n-novnc; then
716 716
     # a websockets/html5 or flash powered VNC console for vm instances
717 717
     git_clone $NOVNC_REPO $NOVNC_DIR $NOVNC_BRANCH
718 718
 fi
719
+if is_service_enabled n-spice; then
720
+    # a websockets/html5 or flash powered SPICE console for vm instances
721
+    git_clone $SPICE_REPO $SPICE_DIR $SPICE_BRANCH
722
+fi
719 723
 if is_service_enabled horizon; then
720 724
     # dashboard
721 725
     install_horizon
... ...
@@ -1008,17 +1013,38 @@ if is_service_enabled nova; then
1008 1008
         iniset $NOVA_CONF DEFAULT novncproxy_base_url "$NOVNCPROXY_URL"
1009 1009
         XVPVNCPROXY_URL=${XVPVNCPROXY_URL:-"http://$SERVICE_HOST:6081/console"}
1010 1010
         iniset $NOVA_CONF DEFAULT xvpvncproxy_base_url "$XVPVNCPROXY_URL"
1011
+        SPICEHTML5PROXY_URL=${SPICEHTML5PROXY_URL:-"http://$SERVICE_HOST:6082/spice_auto.html"}
1012
+        iniset $NOVA_CONF spice html5proxy_base_url "$SPICEHTML5PROXY_URL"
1011 1013
     fi
1012 1014
     if [ "$VIRT_DRIVER" = 'xenserver' ]; then
1013 1015
         VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=169.254.0.1}
1014 1016
     else
1015 1017
         VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=127.0.0.1}
1016 1018
     fi
1017
-    # Address on which instance vncservers will listen on compute hosts.
1018
-    # For multi-host, this should be the management ip of the compute host.
1019
-    VNCSERVER_LISTEN=${VNCSERVER_LISTEN=127.0.0.1}
1020
-    iniset $NOVA_CONF DEFAULT vncserver_listen "$VNCSERVER_LISTEN"
1021
-    iniset $NOVA_CONF DEFAULT vncserver_proxyclient_address "$VNCSERVER_PROXYCLIENT_ADDRESS"
1019
+
1020
+    if is_service_enabled n-novnc || is_service_enabled n-xvnc ; then
1021
+      # Address on which instance vncservers will listen on compute hosts.
1022
+      # For multi-host, this should be the management ip of the compute host.
1023
+      VNCSERVER_LISTEN=${VNCSERVER_LISTEN=127.0.0.1}
1024
+      iniset $NOVA_CONF DEFAULT vnc_enabled true
1025
+      iniset $NOVA_CONF DEFAULT vncserver_listen "$VNCSERVER_LISTEN"
1026
+      iniset $NOVA_CONF DEFAULT vncserver_proxyclient_address "$VNCSERVER_PROXYCLIENT_ADDRESS"
1027
+    else
1028
+      iniset $NOVA_CONF DEFAULT vnc_enabled false
1029
+    fi
1030
+
1031
+    if is_service_enabled n-spice; then
1032
+      # Address on which instance spiceservers will listen on compute hosts.
1033
+      # For multi-host, this should be the management ip of the compute host.
1034
+      SPICESERVER_PROXYCLIENT_ADDRESS=${SPICESERVER_PROXYCLIENT_ADDRESS=127.0.0.1}
1035
+      SPICESERVER_LISTEN=${SPICESERVER_LISTEN=127.0.0.1}
1036
+      iniset $NOVA_CONF spice enabled true
1037
+      iniset $NOVA_CONF spice server_listen "$SPICESERVER_LISTEN"
1038
+      iniset $NOVA_CONF spice server_proxyclient_address "$SPICESERVER_PROXYCLIENT_ADDRESS"
1039
+    else
1040
+      iniset $NOVA_CONF spice enabled false
1041
+    fi
1042
+
1022 1043
     iniset $NOVA_CONF DEFAULT ec2_dmz_host "$EC2_DMZ_HOST"
1023 1044
     iniset_rpc_backend nova $NOVA_CONF DEFAULT
1024 1045
     iniset $NOVA_CONF DEFAULT glance_api_servers "$GLANCE_HOSTPORT"
... ...
@@ -78,6 +78,10 @@ KEYSTONE_BRANCH=master
78 78
 NOVNC_REPO=https://github.com/kanaka/noVNC.git
79 79
 NOVNC_BRANCH=master
80 80
 
81
+# a websockets/html5 or flash powered SPICE console for vm instances
82
+SPICE_REPO=http://anongit.freedesktop.org/git/spice/spice-html5.git
83
+SPICE_BRANCH=master
84
+
81 85
 # django powered web control panel for openstack
82 86
 HORIZON_REPO=${GIT_BASE}/openstack/horizon.git
83 87
 HORIZON_BRANCH=master