From 7726620121424d8f0959587d0a1baf1768e57c63 Mon Sep 17 00:00:00 2001 From: Feng Pan Date: Mon, 6 Jun 2016 16:57:12 -0400 Subject: Add API network support - Create additional NIC on virtual deployment if API network is enabled. - Include API network in clean - Change keystone admin api network to admin network. This should have no effect when api network is disabled, as today's behavior is to fall back to admin network anyway. However, when api network is defined, we need to be able to reach overcloud from undercloud through keystone admin api network. Change-Id: Ib0aea4a0daeed5878793530c10d8f8a1bbe5fd72 Signed-off-by: Feng Pan --- lib/python/apex/network_environment.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'lib/python') diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py index e6f0135a..4bab34c9 100644 --- a/lib/python/apex/network_environment.py +++ b/lib/python/apex/network_environment.py @@ -20,6 +20,10 @@ STORAGE_RESOURCES = {'OS::TripleO::Network::Storage': None, 'OS::TripleO::Network::Ports::StorageVipPort': PORTS, 'OS::TripleO::Controller::Ports::StoragePort': PORTS, 'OS::TripleO::Compute::Ports::StoragePort': PORTS} +API_RESOURCES = {'OS::TripleO::Network::InternalApi': None, + 'OS::TripleO::Network::Ports::InternalApiVipPort': PORTS, + 'OS::TripleO::Controller::Ports::InternalApiPort': PORTS, + 'OS::TripleO::Compute::Ports::InternalApiPort': PORTS} class NetworkEnvironment: @@ -117,6 +121,27 @@ class NetworkEnvironment: if prefix is None: prefix = '' self.netenv_obj[reg][key] = tht_dir + prefix + postfix + + if constants.API_NETWORK in enabled_networks: + api_range = net_settings[constants.API_NETWORK][ + 'usable_ip_range'].split(',') + self.netenv_obj[param_def]['InternalApiAllocationPools'] = \ + [{'start': + api_range[0], + 'end': + api_range[1] + }] + api_cidr = net_settings[constants.API_NETWORK]['cidr'] + self.netenv_obj[param_def]['InternalApiNetCidr'] = str(api_cidr) + postfix = '/internal_api.yaml' + else: + postfix = '/noop.yaml' + + for key, prefix in API_RESOURCES.items(): + if prefix is None: + prefix = '' + self.netenv_obj[reg][key] = tht_dir + prefix + postfix + return self.netenv_obj def get_netenv_settings(self): -- cgit 1.2.3-korg