Skip to content

Commit 8db91bc

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Configure console proxy settings for nova-cpu.conf"
2 parents 827f6c1 + 65ad794 commit 8db91bc

1 file changed

Lines changed: 35 additions & 19 deletions

File tree

lib/nova

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -606,28 +606,49 @@ function create_nova_conf {
606606
fi
607607
}
608608

609-
function configure_console_proxies {
610-
# Use the provided config file path or default to $NOVA_CONF.
611-
local conf=${1:-$NOVA_CONF}
612-
609+
function configure_console_compute {
613610
# All nova-compute workers need to know the vnc configuration options
614611
# These settings don't hurt anything if n-xvnc and n-novnc are disabled
615612
if is_service_enabled n-cpu; then
616613
NOVNCPROXY_URL=${NOVNCPROXY_URL:-"http://$SERVICE_HOST:6080/vnc_auto.html"}
617-
iniset $conf vnc novncproxy_base_url "$NOVNCPROXY_URL"
614+
iniset $NOVA_CPU_CONF vnc novncproxy_base_url "$NOVNCPROXY_URL"
618615
XVPVNCPROXY_URL=${XVPVNCPROXY_URL:-"http://$SERVICE_HOST:6081/console"}
619-
iniset $conf vnc xvpvncproxy_base_url "$XVPVNCPROXY_URL"
616+
iniset $NOVA_CPU_CONF vnc xvpvncproxy_base_url "$XVPVNCPROXY_URL"
620617
SPICEHTML5PROXY_URL=${SPICEHTML5PROXY_URL:-"http://$SERVICE_HOST:6082/spice_auto.html"}
621-
iniset $conf spice html5proxy_base_url "$SPICEHTML5PROXY_URL"
618+
iniset $NOVA_CPU_CONF spice html5proxy_base_url "$SPICEHTML5PROXY_URL"
622619
fi
623620

624621
if is_service_enabled n-novnc || is_service_enabled n-xvnc || [ "$NOVA_VNC_ENABLED" != False ]; then
625622
# Address on which instance vncservers will listen on compute hosts.
626623
# For multi-host, this should be the management ip of the compute host.
627624
VNCSERVER_LISTEN=${VNCSERVER_LISTEN=$NOVA_SERVICE_LOCAL_HOST}
628625
VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=$NOVA_SERVICE_LOCAL_HOST}
629-
iniset $conf vnc server_listen "$VNCSERVER_LISTEN"
630-
iniset $conf vnc server_proxyclient_address "$VNCSERVER_PROXYCLIENT_ADDRESS"
626+
iniset $NOVA_CPU_CONF vnc server_listen "$VNCSERVER_LISTEN"
627+
iniset $NOVA_CPU_CONF vnc server_proxyclient_address "$VNCSERVER_PROXYCLIENT_ADDRESS"
628+
else
629+
iniset $NOVA_CPU_CONF vnc enabled false
630+
fi
631+
632+
if is_service_enabled n-spice; then
633+
# Address on which instance spiceservers will listen on compute hosts.
634+
# For multi-host, this should be the management ip of the compute host.
635+
SPICESERVER_PROXYCLIENT_ADDRESS=${SPICESERVER_PROXYCLIENT_ADDRESS=$NOVA_SERVICE_LOCAL_HOST}
636+
SPICESERVER_LISTEN=${SPICESERVER_LISTEN=$NOVA_SERVICE_LOCAL_HOST}
637+
iniset $NOVA_CPU_CONF spice enabled true
638+
iniset $NOVA_CPU_CONF spice server_listen "$SPICESERVER_LISTEN"
639+
iniset $NOVA_CPU_CONF spice server_proxyclient_address "$SPICESERVER_PROXYCLIENT_ADDRESS"
640+
fi
641+
642+
if is_service_enabled n-sproxy; then
643+
iniset $NOVA_CPU_CONF serial_console enabled True
644+
fi
645+
}
646+
647+
function configure_console_proxies {
648+
# Use the provided config file path or default to $NOVA_CONF.
649+
local conf=${1:-$NOVA_CONF}
650+
651+
if is_service_enabled n-novnc || is_service_enabled n-xvnc || [ "$NOVA_VNC_ENABLED" != False ]; then
631652
iniset $conf vnc novncproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
632653
iniset $conf vnc xvpvncproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
633654

@@ -641,24 +662,14 @@ function configure_console_proxies {
641662
deploy_int_CA /etc/pki/nova-novnc/ca-cert.pem
642663
deploy_int_cert /etc/pki/nova-novnc/client-cert.pem /etc/pki/nova-novnc/client-key.pem
643664
fi
644-
else
645-
iniset $conf vnc enabled false
646665
fi
647666

648667
if is_service_enabled n-spice; then
649-
# Address on which instance spiceservers will listen on compute hosts.
650-
# For multi-host, this should be the management ip of the compute host.
651-
SPICESERVER_PROXYCLIENT_ADDRESS=${SPICESERVER_PROXYCLIENT_ADDRESS=$NOVA_SERVICE_LOCAL_HOST}
652-
SPICESERVER_LISTEN=${SPICESERVER_LISTEN=$NOVA_SERVICE_LOCAL_HOST}
653-
iniset $conf spice enabled true
654-
iniset $conf spice server_listen "$SPICESERVER_LISTEN"
655-
iniset $conf spice server_proxyclient_address "$SPICESERVER_PROXYCLIENT_ADDRESS"
656668
iniset $conf spice html5proxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
657669
fi
658670

659671
if is_service_enabled n-sproxy; then
660672
iniset $conf serial_console serialproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
661-
iniset $conf serial_console enabled True
662673
fi
663674
}
664675

@@ -911,6 +922,11 @@ function start_nova_compute {
911922
iniset_rpc_backend nova $NOVA_CPU_CONF DEFAULT "nova_cell${NOVA_CPU_CELL}"
912923
fi
913924

925+
# Console proxies were configured earlier in create_nova_conf. Now that the
926+
# nova-cpu.conf has been created, configure the console settings required
927+
# by the compute process.
928+
configure_console_compute
929+
914930
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
915931
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
916932
# ``sg`` is used in run_process to execute nova-compute as a member of the

0 commit comments

Comments
 (0)