Force novaclient to use internal network

Closes-Bug: 1456876
Change-Id: Ibff9d2ae7bf978525d4eccacb8f9a535b36d2056
This commit is contained in:
Edward Hope-Morley 2016-03-24 17:38:30 +00:00
parent 0d4e1bfa43
commit 0a17e7b18d
8 changed files with 39 additions and 1 deletions

View File

@ -73,6 +73,15 @@ options:
default: RegionOne
type: string
description: OpenStack Region
internal-endpoint-type:
default:
type: string
description: |
Openstack mostly defaults to using the Public endpoint for
internal communication between services. This option can be
set to admin|internal|public to alter which endpoints are used
for inter-service communication. If unset, Openstack defaults are
used.
neutron-security-groups:
type: boolean
default: False

View File

@ -379,3 +379,19 @@ class MidonetContext(context.OSContextGenerator):
if self.context_complete(ctxt):
return ctxt
return {}
class InternalEndpointContext(context.OSContextGenerator):
"""Internal endpoint context.
This context provides the endpoint type used for communication between
services e.g. between Nova and Cinder internally. Openstack uses Public
endpoints by default so this allows admins to optionally used the admin or
internal endpoints.
"""
def __call__(self):
type = config('internal-endpoint-type')
if type:
return {'endpoint_type': type}
return {}

View File

@ -153,7 +153,8 @@ BASE_RESOURCE_MAP = OrderedDict([
context.ZeroMQContext(),
context.NotificationDriverContext(),
context.BindHostContext(),
context.WorkerConfigContext()],
context.WorkerConfigContext(),
neutron_api_context.InternalEndpointContext()],
}),
(NEUTRON_DEFAULT, {
'services': ['neutron-server'],

View File

@ -116,3 +116,5 @@ admin_password = {{ admin_password }}
service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default
{% include "parts/nova" %}

View File

@ -105,3 +105,5 @@ service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVP
{% if not neutron_plugin or neutron_plugin != 'midonet' -%}
service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default
{% endif -%}
{% include "parts/nova" %}

View File

@ -106,3 +106,5 @@ root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
[oslo_concurrency]
lock_path = $state_path/lock
{% include "parts/nova" %}

View File

@ -101,3 +101,5 @@ root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
[oslo_concurrency]
lock_path = $state_path/lock
{% include "parts/nova" %}

4
templates/parts/nova Normal file
View File

@ -0,0 +1,4 @@
[nova]
{% if endpoint_type -%}
endpoint_type = {{ endpoint_type }}
{% endif %}