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)
"""
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
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] = {}
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
return self.config[self.ROOT]['provider_networks'][network]['vlan_ranges']
-
def get_provider_network_mtu(self, network):
"""
Get mtu for the given provider network
#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: <VALUE>
+
+ ### Network domains
+ #network_domains:
+ ### User defined name for network domain
+ #rack-1:
+ ### Network address in CIDR format
+ #cidr: <VALUE>
+
+ ### Optional vlan id
+ #vlan: <VALUE>
+
+ ### IP address of the gateway for default route.
+ ### If unspecified, the subnet's first IP address assumed.
+ #gateway: <VALUE>
+
+ ### Range for IPs
+ #ip_range_start: <VALUE>
+ #ip_range_end: <VALUE>
+
+ ### Optional static routes
+ #routes:
+ # - {to: <CIDR>, via: <IP>}
+
### Provider networks
### Provider network to physical interface mapping is done
### in the network profile configuration