From 5ffc66cd69e1cda087056da25ab25548dacb1d32 Mon Sep 17 00:00:00 2001 From: Harm Weites Date: Tue, 5 May 2015 00:37:23 +0200 Subject: [PATCH] Add a novnc container running the novnc-proxy. All VNC-specific configuration bits are moved from nova-api-base to nova-compute and the new nova-novncproxy and nova-consoleauth containers. The compose specification has been updated to reflect this. A future patch will make the desired backend configurable (spice/vnc). Change-Id: I8b64abf125fd1ecd7d3463515e3717dd9bd60420 Blueprint: novnc-container --- ...ctor-scheduler-consoleauth-novncproxy.yml} | 16 +++++++++++++ docker/nova-base/config-nova.sh | 6 ----- .../nova-compute/config-nova-compute.sh | 10 ++++++++ .../nova-consoleauth/Dockerfile | 8 +++++++ docker/nova-controller/nova-consoleauth/build | 1 + .../nova-controller/nova-consoleauth/start.sh | 13 +++++++++++ .../nova-novncproxy/Dockerfile | 10 ++++++++ docker/nova-controller/nova-novncproxy/build | 1 + .../nova-controller/nova-novncproxy/start.sh | 23 +++++++++++++++++++ tools/genenv | 12 ++++++++++ tools/kolla | 2 +- 11 files changed, 95 insertions(+), 7 deletions(-) rename compose/{nova-api-conductor-scheduler.yml => nova-api-conductor-scheduler-consoleauth-novncproxy.yml} (62%) create mode 100644 docker/nova-controller/nova-consoleauth/Dockerfile create mode 120000 docker/nova-controller/nova-consoleauth/build create mode 100755 docker/nova-controller/nova-consoleauth/start.sh create mode 100644 docker/nova-controller/nova-novncproxy/Dockerfile create mode 120000 docker/nova-controller/nova-novncproxy/build create mode 100755 docker/nova-controller/nova-novncproxy/start.sh diff --git a/compose/nova-api-conductor-scheduler.yml b/compose/nova-api-conductor-scheduler-consoleauth-novncproxy.yml similarity index 62% rename from compose/nova-api-conductor-scheduler.yml rename to compose/nova-api-conductor-scheduler-consoleauth-novncproxy.yml index 4415f72f41..17b583d2e7 100644 --- a/compose/nova-api-conductor-scheduler.yml +++ b/compose/nova-api-conductor-scheduler-consoleauth-novncproxy.yml @@ -24,3 +24,19 @@ novascheduler: restart: always env_file: - openstack.env + +novaconsoleauth: + image: kollaglue/centos-rdo-nova-consoleauth:juno + name: nova-consoleauth + net: "host" + restart: always + env_file: + - openstack.env + +novanovncproxy: + image: kollaglue/centos-rdo-nova-novncproxy:juno + name: nova-novncproxy + net: "host" + restart: always + env_file: + - openstack.env diff --git a/docker/nova-base/config-nova.sh b/docker/nova-base/config-nova.sh index f8f7788e3b..8a0bb751ac 100755 --- a/docker/nova-base/config-nova.sh +++ b/docker/nova-base/config-nova.sh @@ -45,8 +45,6 @@ crudini --set $cfg DEFAULT service_down_time 60 crudini --set $cfg DEFAULT rootwrap_config /etc/nova/rootwrap.conf crudini --set $cfg DEFAULT auth_strategy keystone crudini --set $cfg DEFAULT use_forwarded_for False -crudini --set $cfg DEFAULT novncproxy_host 0.0.0.0 -crudini --set $cfg DEFAULT novncproxy_port 6080 crudini --set $cfg DEFAULT glance_api_servers ${GLANCE_API_SERVICE_HOST}:9292 crudini --set $cfg DEFAULT cpu_allocation_ratio 16.0 crudini --set $cfg DEFAULT ram_allocation_ratio 1.5 @@ -54,10 +52,6 @@ crudini --set $cfg DEFAULT scheduler_default_filters RetryFilter,AvailabilityZon crudini --set $cfg DEFAULT compute_driver nova.virt.libvirt.LibvirtDriver crudini --set $cfg DEFAULT vif_plugging_is_fatal True crudini --set $cfg DEFAULT vif_plugging_timeout 300 -crudini --set $cfg DEFAULT novncproxy_base_url http://${PUBLIC_IP}:6080/vnc_auto.html -crudini --set $cfg DEFAULT vncserver_listen 0.0.0.0 -crudini --set $cfg DEFAULT vncserver_proxyclient_address ${PUBLIC_IP} -crudini --set $cfg DEFAULT vnc_enabled True crudini --set $cfg DEFAULT volume_api_class nova.volume.cinder.API crudini --set $cfg DEFAULT image_service nova.image.glance.GlanceImageService crudini --set $cfg DEFAULT osapi_volume_listen 0.0.0.0 diff --git a/docker/nova-compute/nova-compute/config-nova-compute.sh b/docker/nova-compute/nova-compute/config-nova-compute.sh index cb1b01fa13..14e18acc85 100755 --- a/docker/nova-compute/nova-compute/config-nova-compute.sh +++ b/docker/nova-compute/nova-compute/config-nova-compute.sh @@ -5,6 +5,16 @@ cfg=/etc/nova/nova.conf +check_required_vars NOVA_NOVNC_PROXYCLIENT_IP + +# Configures novnc to listen on all interfaces and instructs nova-compute to +# announce PROXYCLIENT_IP to the nova-vncproxy. Clients like Horizon will +# connect with this address. +# As such, PROXYCLIENT_IP is unique per compute node. +crudini --set $cfg DEFAULT vnc_enabled "True" +crudini --set $cfg DEFAULT vncserver_listen "0.0.0.0" +crudini --set $cfg DEFAULT vncserver_proxyclient_address "${NOVA_NOVNC_PROXYCLIENT_IP}" + # configure logging crudini --set $cfg DEFAULT log_file "${NOVA_COMPUTE_LOG_FILE}" diff --git a/docker/nova-controller/nova-consoleauth/Dockerfile b/docker/nova-controller/nova-consoleauth/Dockerfile new file mode 100644 index 0000000000..576c91b5a1 --- /dev/null +++ b/docker/nova-controller/nova-consoleauth/Dockerfile @@ -0,0 +1,8 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%nova-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum -y install openstack-nova-console && yum clean all + +ADD start.sh /start.sh + +CMD ["/start.sh"] diff --git a/docker/nova-controller/nova-consoleauth/build b/docker/nova-controller/nova-consoleauth/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker/nova-controller/nova-consoleauth/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/nova-controller/nova-consoleauth/start.sh b/docker/nova-controller/nova-consoleauth/start.sh new file mode 100755 index 0000000000..fbac5d4b56 --- /dev/null +++ b/docker/nova-controller/nova-consoleauth/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +. /opt/kolla/config-nova.sh + +cfg=/etc/nova/nova.conf + +check_required_vars NOVA_CONSOLEAUTH_LOG_FILE + +crudini --set $cfg DEFAULT log_file "${NOVA_CONSOLEAUTH_LOG_FILE}" + +echo Starting nova-consoleauth +exec /usr/bin/nova-consoleauth diff --git a/docker/nova-controller/nova-novncproxy/Dockerfile b/docker/nova-controller/nova-novncproxy/Dockerfile new file mode 100644 index 0000000000..6826258538 --- /dev/null +++ b/docker/nova-controller/nova-novncproxy/Dockerfile @@ -0,0 +1,10 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%nova-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum -y install \ + novnc openstack-nova-novncproxy && \ + yum clean all + +ADD start.sh /start.sh + +CMD ["/start.sh"] diff --git a/docker/nova-controller/nova-novncproxy/build b/docker/nova-controller/nova-novncproxy/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker/nova-controller/nova-novncproxy/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/nova-controller/nova-novncproxy/start.sh b/docker/nova-controller/nova-novncproxy/start.sh new file mode 100755 index 0000000000..95a4747193 --- /dev/null +++ b/docker/nova-controller/nova-novncproxy/start.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e +. /opt/kolla/kolla-common.sh + +cfg=/etc/nova/nova.conf + +check_required_vars PUBLIC_IP NOVA_NOVNC_PROXY_SERVICE_HOST NOVA_NOVNC_PROXY_PORT \ + NOVA_NOVNC_BASE_ADDRESS NOVA_NOVNCPROXY_LOG_FILE + +crudini --set $cfg DEFAULT log_file "${NOVA_NOVNCPROXY_LOG_FILE}" + +# Listen on all interfaces on port $NOVA_NOVNC_PROXY_PORT for incoming novnc +# requests. +# The base_url is given to clients to connect to, like Horizon, so this could +# very well be fancy DNS name. +echo Configuring VNC... +crudini --set $cfg DEFAULT vnc_enabled "True" +crudini --set $cfg DEFAULT novncproxy_host "${NOVA_NOVNC_PROXY_SERVICE_HOST}" +crudini --set $cfg DEFAULT novncproxy_port "${NOVA_NOVNC_PROXY_PORT}" +crudini --set $cfg DEFAULT novncproxy_base_url "http://${NOVA_NOVNC_BASE_ADDRESS}:${NOVA_NOVNC_PROXY_PORT}/vnc_auto.html" + +echo Starting nova-novncproxy +exec /usr/bin/nova-novncproxy diff --git a/tools/genenv b/tools/genenv index 3fbb55e63b..ecd648e5a5 100755 --- a/tools/genenv +++ b/tools/genenv @@ -40,6 +40,8 @@ NOVA_API_LOG_FILE= NOVA_CONDUCTOR_LOG_FILE= NOVA_SCHEDULER_LOG_FILE= NOVA_COMPUTE_LOG_FILE= +NOVA_CONSOLEAUTH_LOG_FILE= +NOVA_NOVNCPROXY_LOG_FILE= NEUTRON_SERVER_LOG_FILE= NEUTRON_L3_AGENT_LOG_FILE= NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE= @@ -83,6 +85,10 @@ NOVA_PUBLIC_INTERFACE=$MY_DEV NOVA_FLAT_INTERFACE=eth1 ENABLED_APIS=ec2,osapi_compute,metadata METADATA_HOST=$HOST_IP +NOVA_NOVNC_PROXY_PORT=6080 +NOVA_NOVNC_PROXY_SERVICE_HOST=0.0.0.0 +NOVA_NOVNC_BASE_ADDRESS=${PUBLIC_IP} +NOVA_NOVNC_PROXYCLIENT_IP=${PUBLIC_IP} # Neutron NEUTRON_DB_NAME=neutron @@ -127,6 +133,8 @@ NOVA_API_LOG_FILE=$NOVA_API_LOG_FILE NOVA_CONDUCTOR_LOG_FILE=$NOVA_CONDUCTOR_LOG_FILE NOVA_SCHEDULER_LOG_FILE=$NOVA_SCHEDULER_LOG_FILE NOVA_COMPUTE_LOG_FILE=$NOVA_COMPUTE_LOG_FILE +NOVA_CONSOLEAUTH_LOG_FILE=$NOVA_CONSOLEAUTH_LOG_FILE +NOVA_NOVNCPROXY_LOG_FILE=$NOVA_NOVNCPROXY_LOG_FILE NEUTRON_SERVER_LOG_FILE=$NEUTRON_SERVER_LOG_FILE NEUTRON_L3_AGENT_LOG_FILE=$NEUTRON_L3_AGENT_LOG_FILE NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE=$NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE @@ -166,6 +174,10 @@ NOVA_EC2_API_SERVICE_HOST=$NOVA_EC2_SERVICE_HOST NOVA_EC2_SERVICE_HOST=$NOVA_EC2_SERVICE_HOST NOVA_KEYSTONE_PASSWORD=$NOVA_KEYSTONE_PASSWORD NOVA_KEYSTONE_USER=$NOVA_KEYSTONE_USER +NOVA_NOVNC_PROXY_SERVICE_HOST=$NOVA_NOVNC_PROXY_SERVICE_HOST +NOVA_NOVNC_PROXY_PORT=$NOVA_NOVNC_PROXY_PORT +NOVA_NOVNC_BASE_ADDRESS=${NOVA_NOVNC_BASE_ADDRESS} +NOVA_NOVNC_PROXYCLIENT_IP=${NOVA_NOVNC_PROXYCLIENT_IP} NEUTRON_SHARED_SECRET=$NEUTRON_SHARED_SECRET NEUTRON_DB_NAME=$NEUTRON_DB_NAME NEUTRON_DB_USER=$NEUTRON_DB_USER diff --git a/tools/kolla b/tools/kolla index 26bf10ae9e..805a5cca24 100755 --- a/tools/kolla +++ b/tools/kolla @@ -28,7 +28,7 @@ function process_all { process mariadb process keystone process glance-api-registry - process nova-api-conductor-scheduler + process nova-api-conductor-scheduler-consoleauth-novncproxy if [[ "${NETWORK_MANAGER}" == "nova" ]] ; then process nova-compute-network else