Allow binding locally to different IP than endpoint IP

Sometimes you want the actual endpoint IP to be a load balanced IP, but
the bind IP to be a local IP (different per node).

This change allows that by using attributes from the [network-api-bind]
namespace.

Implements blueprint increase-ip-binding-flexibility

Change-Id: I4e134a5dc24ace58a7b9cb2705e66a7b17fd2554
This commit is contained in:
Darren Birkett 2014-04-24 14:18:14 +01:00
parent 3e5e74c5e2
commit f6d3dc60e2
3 changed files with 22 additions and 3 deletions

View File

@ -116,6 +116,15 @@ Modular Layer 2 Plugin Configuration
* `openstack['openstack']['network']['ml2']['vni_ranges']` - (ListOpt) Comma-separated list of <vni_min>:<vni_max> tuples enumerating ranges of VXLAN VNI IDs that are available for tenant network allocation.
* `openstack['openstack']['network']['ml2']['vxlan_group']` - (StrOpt) Multicast group for the VXLAN interface.
The following attributes are defined in attributes/default.rb of the common cookbook, but are documented here due to their relevance:
* `openstack['endpoints']['network-api-bind']['host']` - The IP address to bind the api service to
* `openstack['endpoints']['network-api-bind']['port']` - The port to bind the api service to
* `openstack['endpoints']['network-api-bind']['bind_interface']` - The interface name to bind the api service to
If the value of the 'bind_interface' attribute is non-nil, then the network service will be bound to the first IP address on that interface. If the value of the 'bind_interface' attribute is nil, then the network service will be bound to the IP address specified in the host attribute.
Templates
=========
* `api-paste.ini.erb` - Paste config for OpenStack Network server

View File

@ -113,7 +113,7 @@ db_user = node['openstack']['db']['network']['username']
db_pass = get_password 'db', 'neutron'
sql_connection = db_uri('network', db_user, db_pass)
api_endpoint = endpoint 'network-api'
network_api_bind = endpoint 'network-api-bind'
service_pass = get_password 'service', 'openstack-network'
platform_options['neutron_client_packages'].each do |pkg|
@ -174,8 +174,8 @@ template '/etc/neutron/neutron.conf' do
group node['openstack']['network']['platform']['group']
mode 00644
variables(
bind_address: api_endpoint.host,
bind_port: api_endpoint.port,
bind_address: network_api_bind.host,
bind_port: network_api_bind.port,
rabbit_hosts: rabbit_hosts,
mq_service_type: mq_service_type,
mq_password: mq_password,

View File

@ -48,6 +48,16 @@ describe 'openstack-network::common' do
/^core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin/)
end
it 'has bind_host set' do
node.set['openstack']['endpoints']['network-api-bind']['host'] = '1.1.1.1'
expect(chef_run).to render_file(file.name).with_content('bind_host = 1.1.1.1')
end
it 'has bind_port set' do
node.set['openstack']['endpoints']['network-api-bind']['port'] = '9999'
expect(chef_run).to render_file(file.name).with_content('bind_port = 9999')
end
# TODO: flush out rest of template attributes
end
end