From: Krisztian Lengyel Date: Mon, 16 Sep 2019 18:59:36 +0000 (-0400) Subject: Add "caas_oam" networking type X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fconfig-manager.git;a=commitdiff_plain;h=4ce1263147d1bd6106730a9a2ae0d4ed933f8af7 Add "caas_oam" networking type Change-Id: I19fa9882dbf15f1be90b18c50b1d5413deb09c2a Signed-off-by: Krisztian Lengyel --- diff --git a/cmdatahandlers/src/cmdatahandlers/networking/config.py b/cmdatahandlers/src/cmdatahandlers/networking/config.py index 4f724ec..b94b62c 100644 --- a/cmdatahandlers/src/cmdatahandlers/networking/config.py +++ b/cmdatahandlers/src/cmdatahandlers/networking/config.py @@ -20,11 +20,19 @@ from serviceprofiles import profiles from netaddr import IPNetwork, IPSet, IPRange -VALID_NETWORKS = \ - ['infra_external', 'infra_storage_cluster', 'infra_hw_management', 'infra_internal', 'cloud_tenant', 'infra_access'] +VALID_NETWORKS = [ + 'caas_oam', + 'cloud_tenant', + 'infra_access', + 'infra_external', + 'infra_internal', + 'infra_hw_management', + 'infra_storage_cluster', +] NETWORK_DOMAINS = 'network_domains' + class Config(config.Config): def __init__(self, confman): super(Config, self).__init__(confman) @@ -486,6 +494,19 @@ class Config(config.Config): """ return 'infra_internal' + @staticmethod + def get_caas_oam_network_name(): + """ get the CaaS OAM network name + + Return: + + The CaaS OAM network name + + Raise: + + """ + return 'caas_oam' + def get_cloud_tenant_network_name(self): """ get the network name for the cloud tenant network @@ -560,6 +581,12 @@ class Config(config.Config): except configerror.ConfigError: pass + try: + cidr = self.get_network_cidr(network, domain) + networkdata['cidr'] = cidr + except configerror.ConfigError: + pass + key = host + '.' + self.DOMAIN if key not in self.config: self.config[key] = {} @@ -654,13 +681,11 @@ class Config(config.Config): return self.config[hostnetconfigkey][network]['mask'] - def get_external_vip(self): """ get the external vip ip, this is always the first ip in the range """ return self.external_vip - def get_provider_networks(self): """ Get provider network names @@ -718,7 +743,6 @@ class Config(config.Config): return self.config[self.ROOT]['provider_networks'][network]['vlan_ranges'] - def get_provider_network_mtu(self, network): """ Get mtu for the given provider network diff --git a/userconfigtemplate/user_config.yaml b/userconfigtemplate/user_config.yaml index 2ea4a1e..fdf6bde 100644 --- a/userconfigtemplate/user_config.yaml +++ b/userconfigtemplate/user_config.yaml @@ -172,6 +172,38 @@ networking: #routes: # - {to: 192.168.12.0/22, via: 192.168.12.65} + ### Optional. + ### This network is used as the underlay network for inter-cluster + ### communication within CaaS. Setting this network can expose CaaS cluster + ### services to this network. + ### If unspecified, infra_internal used as a fallback option. + #caas_oam: + ### Optional network mtu + ### If not defined default value is used. + #mtu: + + ### Network domains + #network_domains: + ### User defined name for network domain + #rack-1: + ### Network address in CIDR format + #cidr: + + ### Optional vlan id + #vlan: + + ### IP address of the gateway for default route. + ### If unspecified, the subnet's first IP address assumed. + #gateway: + + ### Range for IPs + #ip_range_start: + #ip_range_end: + + ### Optional static routes + #routes: + # - {to: , via: } + ### Provider networks ### Provider network to physical interface mapping is done ### in the network profile configuration