Browse code

Merge "Configure console proxy ports in nova_cellN.conf"

Zuul authored on 2019/05/19 22:41:50
Showing 1 changed files
... ...
@@ -607,8 +607,10 @@ function create_nova_conf {
607 607
     else
608 608
         for i in $(seq 1 $NOVA_NUM_CELLS); do
609 609
             local conf
610
+            local offset
610 611
             conf=$(conductor_conf $i)
611
-            configure_console_proxies $conf
612
+            offset=$((i - 1))
613
+            configure_console_proxies $conf $offset
612 614
         done
613 615
     fi
614 616
 }
... ...
@@ -678,10 +680,17 @@ function configure_console_compute {
678 678
 function configure_console_proxies {
679 679
     # Use the provided config file path or default to $NOVA_CONF.
680 680
     local conf=${1:-$NOVA_CONF}
681
+    local offset=${2:-0}
682
+    # Stagger the offset based on the total number of possible console proxies
683
+    # (novnc, xvpvnc, spice, serial) so that their ports will not collide if
684
+    # all are enabled.
685
+    offset=$((offset * 4))
681 686
 
682 687
     if is_service_enabled n-novnc || is_service_enabled n-xvnc || [ "$NOVA_VNC_ENABLED" != False ]; then
683 688
         iniset $conf vnc novncproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
689
+        iniset $conf vnc novncproxy_port $((6080 + offset))
684 690
         iniset $conf vnc xvpvncproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
691
+        iniset $conf vnc xvpvncproxy_port $((6081 + offset))
685 692
 
686 693
         if is_nova_console_proxy_compute_tls_enabled ; then
687 694
             iniset $conf vnc auth_schemes "vencrypt"
... ...
@@ -713,10 +722,12 @@ function configure_console_proxies {
713 713
 
714 714
     if is_service_enabled n-spice; then
715 715
         iniset $conf spice html5proxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
716
+        iniset $conf spice html5proxy_port $((6082 + offset))
716 717
     fi
717 718
 
718 719
     if is_service_enabled n-sproxy; then
719 720
         iniset $conf serial_console serialproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
721
+        iniset $conf serial_console serialproxy_port $((6083 + offset))
720 722
     fi
721 723
 }
722 724