summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2015-03-10 16:08:03 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-04-07 10:08:31 +0000
commitddd96a8ebccb3828c1f4c4b21a7da4d7b0a07e5d (patch)
tree20b833b3ea41b2e9eefdbebc2ccbd9961ebf1862
parentbe08a78f458a72c75a65def177067b91b880e038 (diff)
downloaddefinitions-ddd96a8ebccb3828c1f4c4b21a7da4d7b0a07e5d.tar.gz
Set novncproxy server ip in nova.conf
The ip of the compute node is gotten from the bridge device and this value is set in the novncproxy configuration in nova.conf. This is required for horizon to access to the compute node so have access to the VMs created on it. Also: - remove /usr/share/vnc which is now created in the vnc chunk. - add explicity where to find novnc client to nova-novncproxy systemd unit.
-rw-r--r--clusters/openstack-cluster.morph2
-rw-r--r--openstack/etc/nova/nova.conf9
-rw-r--r--openstack/etc/systemd/system/openstack-nova-novncproxy.service2
-rw-r--r--openstack/usr/share/openstack/openstack-nova-setup9
4 files changed, 13 insertions, 9 deletions
diff --git a/clusters/openstack-cluster.morph b/clusters/openstack-cluster.morph
index df2d9943..3e220741 100644
--- a/clusters/openstack-cluster.morph
+++ b/clusters/openstack-cluster.morph
@@ -41,7 +41,7 @@ systems:
NOVA_PUBLIC_URL: \"http:\/\/onenode:8774\/v2\/\%\(tenant_id\)s\"
NOVA_INTERNAL_URL: \"http:\/\/onenode:8774\/v2\/\%\(tenant_id\)s\"
NOVA_ADMIN_URL: \"http:\/\/onenode:8774\/v2\/\%\(tenant_id\)s\"
- NOVA_NOVNCPROXY_BASE_URL: http:\/\/onenode:6080\/vnc_auto.html
+ NOVA_NOVNCPROXY_BASE_URL: http:\/\/##NOVNC_HOST##:6080\/vnc_auto.html
NOVA_REGION: regionOne
NOVA_DB_USER: novaDB
NOVA_DB_PASSWORD: veryinsecure
diff --git a/openstack/etc/nova/nova.conf b/openstack/etc/nova/nova.conf
index b703591f..8b3522b5 100644
--- a/openstack/etc/nova/nova.conf
+++ b/openstack/etc/nova/nova.conf
@@ -313,11 +313,16 @@ neutron_metadata_proxy_shared_secret= ##METADATA_PROXY_SHARED_SECRET##
# Do not forget to restart Nova daemons and restart your VMs if you want to use
# NoVNC form now on (VMs video card needs to be attached to a console type, and
# they can accept only one video card at a time).
+#
+# NOTE: novncproxy_base_url and vncserver_proxyclient_address should point to the
+# compute node ip. novncproxy_base_url could replace the ip by a alias if the
+# horizon machine can resolve this alias as the compute node ip.
+#
vnc_enabled=True
novncproxy_base_url=##NOVA_NOVNCPROXY_BASE_URL##
# Change vncserver_proxyclient_address and vncserver_listen to match each compute host
-vncserver_proxyclient_address=##NOVA_HOST##
-vncserver_listen=##NOVA_HOST##
+vncserver_proxyclient_address=##NOVNC_HOST##
+vncserver_listen=0.0.0.0
vnc_keymap="en-us"
######################################
diff --git a/openstack/etc/systemd/system/openstack-nova-novncproxy.service b/openstack/etc/systemd/system/openstack-nova-novncproxy.service
index 21013244..069e0751 100644
--- a/openstack/etc/systemd/system/openstack-nova-novncproxy.service
+++ b/openstack/etc/systemd/system/openstack-nova-novncproxy.service
@@ -5,7 +5,7 @@ After=syslog.target network.target
[Service]
Type=simple
User=nova
-ExecStart=/usr/bin/nova-novncproxy --config-file /etc/nova/nova.conf
+ExecStart=/usr/bin/nova-novncproxy --config-file /etc/nova/nova.conf --web /usr/share/novnc
[Install]
WantedBy=multi-user.target
diff --git a/openstack/usr/share/openstack/openstack-nova-setup b/openstack/usr/share/openstack/openstack-nova-setup
index 7168e7c2..1a93a1b0 100644
--- a/openstack/usr/share/openstack/openstack-nova-setup
+++ b/openstack/usr/share/openstack/openstack-nova-setup
@@ -76,11 +76,10 @@ if ! sudo -u postgres psql -lqt | grep -q nova; then
sudo -u nova nova-manage db sync
fi
-# Nova novncproxy needs /usr/share/novnc folder available
-if [ ! -d /usr/share/novnc ]; then
- mkdir /usr/share/novnc
- chown -R nova:nova /usr/share/novnc
-fi
+# Nova novncproxy needs to know the ip of the novnc host
+# this is a workaround to make nova known which is the novnc host
+eth_ip="$(ip addr | perl -pe 'if (/^\d+: ([^:]+)/) { $iface=$1; } if (m@^\s*inet ([^/]+)/@) { print "$iface $1\n"; } $_=undef;' | grep "^br-eth0" | head -1 | awk '{ print $2 } ')"
+sed -i "s/\#\#NOVNC_HOST\#\#/$eth_ip/g" /etc/nova/nova.conf
chown -R nova:nova /var/lib/nova