diff --git a/elements/nova-api/element-deps b/elements/nova-api/element-deps index 88d48d2af..e20b3d106 100644 --- a/elements/nova-api/element-deps +++ b/elements/nova-api/element-deps @@ -1,2 +1,3 @@ iptables nova +nova-novncproxy diff --git a/elements/nova-compute/element-deps b/elements/nova-compute/element-deps index 3461de13c..31c787fdd 100644 --- a/elements/nova-compute/element-deps +++ b/elements/nova-compute/element-deps @@ -1,2 +1 @@ nova -novnc diff --git a/elements/nova-kvm/install.d/nova-package-install/80-nova-kvm b/elements/nova-kvm/install.d/nova-package-install/80-nova-kvm index 691e6d34f..2769d1d48 100755 --- a/elements/nova-kvm/install.d/nova-package-install/80-nova-kvm +++ b/elements/nova-kvm/install.d/nova-package-install/80-nova-kvm @@ -2,8 +2,6 @@ set -eux -install-packages openstack-nova-novncproxy - if ! getent group libvirtd; then groupadd libvirtd fi diff --git a/elements/nova-kvm/install.d/nova-source-install/80-nova-kvm b/elements/nova-kvm/install.d/nova-source-install/80-nova-kvm index e2ded6cc1..9da51c475 100755 --- a/elements/nova-kvm/install.d/nova-source-install/80-nova-kvm +++ b/elements/nova-kvm/install.d/nova-source-install/80-nova-kvm @@ -11,9 +11,6 @@ fi usermod -a -G libvirtd nova -os-svc-daemon -i "$NOVA_VENV_DIR" nova-novncproxy nova nova-novncproxy "--config-dir /etc/nova" -os-svc-enable -n nova-novncproxy - # On Fedora configure polkit to allow nova to use libvirt if [ -e /etc/polkit-1/rules.d ] ; then cat - <<-EOF > /etc/polkit-1/rules.d/50-nova.rules diff --git a/elements/nova-novncproxy/README.md b/elements/nova-novncproxy/README.md new file mode 100644 index 000000000..910937355 --- /dev/null +++ b/elements/nova-novncproxy/README.md @@ -0,0 +1,8 @@ +Install nova-novncproxy along with the necessary components from noVNC. + +Configuration (via the nova element) +------------- + +When using VNC be sure to set nova.public_ip (providated via the nova element). +This is used to specify the novncproxy_base_url for external proxy connections +and is typically configured on controller nodes. diff --git a/elements/nova-novncproxy/element-deps b/elements/nova-novncproxy/element-deps new file mode 100644 index 000000000..31c787fdd --- /dev/null +++ b/elements/nova-novncproxy/element-deps @@ -0,0 +1 @@ +nova diff --git a/elements/novnc/install.d/novnc-package-install/50-install-novnc b/elements/nova-novncproxy/install.d/novnc-package-install/50-install-novnc similarity index 51% rename from elements/novnc/install.d/novnc-package-install/50-install-novnc rename to elements/nova-novncproxy/install.d/novnc-package-install/50-install-novnc index d93a69917..6f0fc6e6b 100755 --- a/elements/novnc/install.d/novnc-package-install/50-install-novnc +++ b/elements/nova-novncproxy/install.d/novnc-package-install/50-install-novnc @@ -2,4 +2,6 @@ set -eux +install-packages openstack-nova-novncproxy + install-packages novnc diff --git a/elements/novnc/install.d/novnc-source-install/50-install-novnc b/elements/nova-novncproxy/install.d/novnc-source-install/50-install-novnc similarity index 82% rename from elements/novnc/install.d/novnc-source-install/50-install-novnc rename to elements/nova-novncproxy/install.d/novnc-source-install/50-install-novnc index 170912573..2195253bc 100755 --- a/elements/novnc/install.d/novnc-source-install/50-install-novnc +++ b/elements/nova-novncproxy/install.d/novnc-source-install/50-install-novnc @@ -1,6 +1,8 @@ #!/bin/bash set -ex +os-svc-daemon -i "$NOVA_VENV_DIR" nova-novncproxy nova nova-novncproxy "--config-dir /etc/nova" + # nova-novncproxy looks in /usr/share/novnc by default install -d -m 0755 -o root -g root /usr/share/novnc install -m 0644 -o root -g root /opt/stack/novnc/favicon.ico /usr/share/novnc diff --git a/elements/nova-novncproxy/os-refresh-config/post-configure.d/81-nova-novncproxy b/elements/nova-novncproxy/os-refresh-config/post-configure.d/81-nova-novncproxy new file mode 100755 index 000000000..585664b65 --- /dev/null +++ b/elements/nova-novncproxy/os-refresh-config/post-configure.d/81-nova-novncproxy @@ -0,0 +1,5 @@ +#!/bin/bash +set -eux + +os-svc-enable -n nova-novncproxy +os-svc-restart -n nova-novncproxy diff --git a/elements/nova-novncproxy/os-refresh-config/pre-configure.d/98-nova-novncproxy-fedora-iptables b/elements/nova-novncproxy/os-refresh-config/pre-configure.d/98-nova-novncproxy-fedora-iptables new file mode 100755 index 000000000..62dd7c871 --- /dev/null +++ b/elements/nova-novncproxy/os-refresh-config/pre-configure.d/98-nova-novncproxy-fedora-iptables @@ -0,0 +1,5 @@ +#!/bin/bash +set -eu + +# open default port for nova-novncproxy connections +add-rule INPUT -p tcp -m multiport --dports 6080 -j ACCEPT diff --git a/elements/novnc/source-repository-novnc b/elements/nova-novncproxy/source-repository-novnc similarity index 100% rename from elements/novnc/source-repository-novnc rename to elements/nova-novncproxy/source-repository-novnc diff --git a/elements/nova/README.md b/elements/nova/README.md index 5a860bf6e..5cd0fd983 100644 --- a/elements/nova/README.md +++ b/elements/nova/README.md @@ -32,3 +32,6 @@ nova: e.g. 'linux-ext4=mkfs -t ext4 -F -L %(fs_label)s %(target)s' compute_manager: "ironic.nova.compute.manager.ClusterComputeManager" - set to override the compute manager class used by Nova-Compute. + public_ip: + - public IP address (if any) assigned to this node. Used for VNC proxy + connections so this is typically only required on controller nodes. diff --git a/elements/nova/os-apply-config/etc/nova/nova.conf b/elements/nova/os-apply-config/etc/nova/nova.conf index 77f4f1ec5..702862669 100644 --- a/elements/nova/os-apply-config/etc/nova/nova.conf +++ b/elements/nova/os-apply-config/etc/nova/nova.conf @@ -47,10 +47,12 @@ keystone_ec2_url=http://{{keystone.host}}:5000/v2.0/ec2tokens # Imaging service glance_api_servers={{glance.host}}:9292 -# Vnc configuration -novncproxy_base_url=http://{{nova.host}}:6080/vnc_auto.html +# VNC configuration +{{#nova.public_ip}} +novncproxy_base_url=http://{{nova.public_ip}}:6080/vnc_auto.html +{{/nova.public_ip}} novncproxy_port=6080 -vncserver_proxyclient_address=127.0.0.1 +vncserver_proxyclient_address={{local-ipv4}} vncserver_listen=0.0.0.0 # Networking # diff --git a/elements/novnc/README.md b/elements/novnc/README.md deleted file mode 100644 index 638f93c78..000000000 --- a/elements/novnc/README.md +++ /dev/null @@ -1 +0,0 @@ -Installs the necessary components from noVNC to satisfy nova-novncproxy. diff --git a/elements/novnc/element-deps b/elements/novnc/element-deps deleted file mode 100644 index 715c11e2f..000000000 --- a/elements/novnc/element-deps +++ /dev/null @@ -1 +0,0 @@ -source-repositories