Add "caas_oam" networking type 77/1677/7
authorKrisztian Lengyel <krisztian.lengyel@nokia.com>
Mon, 16 Sep 2019 18:59:36 +0000 (14:59 -0400)
committerKrisztian Lengyel <krisztian.lengyel@nokia.com>
Fri, 18 Oct 2019 13:40:48 +0000 (15:40 +0200)
Change-Id: I19fa9882dbf15f1be90b18c50b1d5413deb09c2a
Signed-off-by: Krisztian Lengyel <krisztian.lengyel@nokia.com>
cmdatahandlers/src/cmdatahandlers/networking/config.py
userconfigtemplate/user_config.yaml

index 4f724ec..b94b62c 100644 (file)
@@ -20,11 +20,19 @@ from serviceprofiles import profiles
 from netaddr import IPNetwork, IPSet, IPRange
 
 
 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'
 
 
 NETWORK_DOMAINS = 'network_domains'
 
+
 class Config(config.Config):
     def __init__(self, confman):
         super(Config, self).__init__(confman)
 class Config(config.Config):
     def __init__(self, confman):
         super(Config, self).__init__(confman)
@@ -486,6 +494,19 @@ class Config(config.Config):
         """
         return 'infra_internal'
 
         """
         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
 
     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
 
             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] = {}
             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']
 
 
         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_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
     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']
 
 
         return self.config[self.ROOT]['provider_networks'][network]['vlan_ranges']
 
-
     def get_provider_network_mtu(self, network):
         """
         Get mtu for the given provider network
     def get_provider_network_mtu(self, network):
         """
         Get mtu for the given provider network
index 2ea4a1e..fdf6bde 100644 (file)
@@ -172,6 +172,38 @@ networking:
                 #routes:
                 #    - {to: 192.168.12.0/22, via: 192.168.12.65}
 
                 #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
     ### Provider networks
     ### Provider network to physical interface mapping is done
     ### in the network profile configuration