From 47e49624923617991056dec97a2be5d31ef8d2a5 Mon Sep 17 00:00:00 2001 From: Paolo de Rosa Date: Mon, 21 Nov 2016 00:30:58 +0100 Subject: [PATCH] Bind vncserver_proxyclient_address to internal network. Change-Id: I2448e01dae6bf3524350208ce8a61b7e04057ca3 Closes-Bug: 1643375 --- config.yaml | 8 ++++++++ hooks/nova_compute_context.py | 7 +++++-- metadata.yaml | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index 5c648c92..2aa20fd9 100644 --- a/config.yaml +++ b/config.yaml @@ -311,6 +311,14 @@ options: wait for you to execute the openstack-upgrade action for this charm on each unit. If False it will revert to existing behavior of upgrading all units on config change. + os-internal-network: + type: string + default: + description: | + The IP address and netmask of the OpenStack Internal network (e.g. + 192.168.0.0/24) + + This network will be used to bind vncproxy client. harden: default: type: string diff --git a/hooks/nova_compute_context.py b/hooks/nova_compute_context.py index 2f6d02f7..b5a21167 100644 --- a/hooks/nova_compute_context.py +++ b/hooks/nova_compute_context.py @@ -40,7 +40,10 @@ from charmhelpers.contrib.openstack.utils import ( get_os_version_package, get_os_version_codename, ) - +from charmhelpers.contrib.openstack.ip import ( + INTERNAL, + resolve_address, +) from charmhelpers.contrib.network.ip import ( get_ipv6_addr, ) @@ -533,7 +536,7 @@ class InstanceConsoleContext(context.OSContextGenerator): else: ctxt = dict(ctxt, **self.get_console_info(proto, **rel)) break - ctxt['console_listen_addr'] = get_host_ip(unit_get('private-address')) + ctxt['console_listen_addr'] = resolve_address(endpoint_type=INTERNAL) return ctxt diff --git a/metadata.yaml b/metadata.yaml index 99a77890..095495a2 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -21,6 +21,8 @@ provides: nrpe-external-master: interface: nrpe-external-master scope: container +extra-bindings: + internal: requires: shared-db: interface: mysql-shared