Browse Source

Make NetCidrMapValue contain list of cidrs in each net

Prior to routed networks we only had one subnet per network.
With routed networks each network can have multiple subnets.
The NetCidrMapValue should contain a list storing the cidr
of each subnet for each network.

Ceph:
  list_join is used to make a comma separated list of
  cidrs for public_network, monitor_address_block,
  cluster_network and radosgw_address_block.

Partial: blueprint tripleo-routed-networks-templates
Depends-On: Ia8e219b30d4f8b199b882e95fe2834252a92c15a
Depends-On: I1ace0a02e6aa2610559fee0d8576e6f1bc98d699
Change-Id: I68e064d23ec5d43f59146d974cae604d2c5fdb52
tags/10.3.0
Harald Jensås 8 months ago
parent
commit
8665a0d97b

+ 7
- 1
deployed-server/deployed-neutron-port.yaml View File

@@ -12,7 +12,10 @@ description: "
12 12
           fixed_ips:
13 13
             - ip_address: 127.0.0.1
14 14
           subnets:
15
-            - cidr: 127.0.0.0/24"
15
+            - cidr: 127.0.0.0/24
16
+          network:
17
+            tags:
18
+              - 127.0.0.0/24"
16 19
 
17 20
 parameters:
18 21
   name:
@@ -39,6 +42,9 @@ outputs:
39 42
   subnets:
40 43
     value:
41 44
       {get_param: [DeployedServerPortMap, {get_param: name}, subnets]}
45
+  network:
46
+    value:
47
+      {get_param: [DeployedServerPortMap, {get_param: name}, network]}
42 48
   name:
43 49
     value: {get_param: name}
44 50
   status:

+ 1
- 0
deployment/memcached/memcached-container-puppet.yaml View File

@@ -83,6 +83,7 @@ outputs:
83 83
       monitoring_subscription: {get_param: MonitoringSubscriptionMemcached}
84 84
       config_settings:
85 85
         memcached_network:
86
+          # TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, MemcachedNetwork]}
86 87
           str_replace:
87 88
             template:
88 89
               "%{hiera('$NETWORK_subnet')}"

+ 1
- 0
deployment/snmp/snmp-baremetal-puppet.yaml View File

@@ -67,6 +67,7 @@ outputs:
67 67
         snmp::agentaddress: {get_param: SnmpdBindHost}
68 68
         snmp::snmpd_options: {get_param: SnmpdOptions}
69 69
         snmpd_network:
70
+          # TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, SnmpdNetwork]}
70 71
           str_replace:
71 72
             template: "%{hiera('$NETWORK_subnet')}"
72 73
             params:

+ 12
- 3
docker/services/ceph-ansible/ceph-base.yaml View File

@@ -231,9 +231,18 @@ resources:
231 231
           ceph_docker_image: {get_attr: [DockerImageUrlParts, value, image]}
232 232
           ceph_docker_image_tag: {get_attr: [DockerImageUrlParts, value, image_tag]}
233 233
           containerized_deployment: true
234
-          public_network: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]}
235
-          monitor_address_block: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]}
236
-          cluster_network: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]}
234
+          public_network:
235
+            list_join:
236
+              - ','
237
+              - get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]
238
+          monitor_address_block:
239
+            list_join:
240
+              - ','
241
+              - get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]
242
+          cluster_network:
243
+            list_join:
244
+              - ','
245
+              - get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]
237 246
           user_config: true
238 247
           ceph_stable: true
239 248
           ceph_origin: distro

+ 4
- 1
docker/services/ceph-ansible/ceph-rgw.yaml View File

@@ -58,7 +58,10 @@ resources:
58 58
         vars:
59 59
           radosgw_keystone: true
60 60
           radosgw_keystone_ssl: false
61
-          radosgw_address_block: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephRgwNetwork]}]}
61
+          radosgw_address_block:
62
+            list_join:
63
+              - ','
64
+              - get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephRgwNetwork]}]
62 65
           radosgw_civetweb_port: {get_param: [EndpointMap, CephRgwInternal, port]}
63 66
 
64 67
 outputs:

+ 1
- 4
network/network.j2 View File

@@ -195,10 +195,7 @@ outputs:
195 195
   OS::stack_id:
196 196
     description: {{network.name_lower}} network
197 197
     value: {get_resource: {{network.name}}Network}
198
-  subnet_cidr:
199
-    description: The {{network.name}} networks base subnet in CIDR notation.
200
-    value: {get_attr: [{{network.name}}Subnet, cidr]}
201
-  subnet_cidrs:
198
+  network_cidrs:
202 199
     description: List of {{network.name}} network's subnets in CIDR notation.
203 200
     value:
204 201
       list_concat:

+ 11
- 4
network/networks.j2.yaml View File

@@ -2,6 +2,11 @@ heat_template_version: rocky
2 2
 
3 3
 description: Create networks to split out Overcloud traffic
4 4
 
5
+parameters:
6
+  CtlplaneNetworkCidrs:
7
+    type: json
8
+    description: Cidrs for the ctlplane network.
9
+
5 10
 resources:
6 11
   {%- for network in networks %}
7 12
   {%- set network_name = network.compat_name|default(network.name) %}
@@ -16,12 +21,14 @@ resources:
16 21
 outputs:
17 22
   net_cidr_map:
18 23
     value:
19
-      # NOTE(gfidente): we need to replace the null value with a
20
-      # string to work around https://bugs.launchpad.net/heat/+bug/1700025
24
+      # NOTE(hjensas): If a network does not have any network_cidrs, fall back
25
+      # to the ctlplane (provisioning) network.
21 26
       {%- for network in networks %}
22 27
       {%- set network_name = network.compat_name|default(network.name) %}
23 28
       {{network.name_lower}}:
24 29
         yaql:
25
-          data: {get_attr: [{{network_name}}Network, subnet_cidr]}
26
-          expression: str($.data).replace('null', 'disabled')
30
+          data:
31
+            network_cidrs: {get_attr: [{{network_name}}Network, network_cidrs]}
32
+            ctlplane_cidrs: {get_param: CtlplaneNetworkCidrs}
33
+          expression: switch(not isList($.data.network_cidrs) => $.data.ctlplane_cidrs, $.data.network_cidrs => $.data.network_cidrs)
27 34
       {%- endfor %}

+ 6
- 4
overcloud.j2.yaml View File

@@ -350,11 +350,11 @@ resources:
350 350
         map_replace:
351 351
         - map_merge:
352 352
           - {get_attr: [Networks, net_cidr_map]}
353
-          - ctlplane: {get_attr: [ControlVirtualIP, subnets, 0, cidr]}
353
+          # NOTE(hjensas): When ctlplane network and subnets are created by the
354
+          # undercloud installer, the subnet cidrs are added as tags.
355
+          - ctlplane: {get_attr: [ControlVirtualIP, network, tags]}
354 356
         - keys:
355 357
             ctlplane: {get_param: NeutronControlPlaneID}
356
-          values:
357
-            disabled: {get_attr: [ControlVirtualIP, subnets, 0, cidr]}
358 358
 
359 359
   ServiceNetMap:
360 360
     type: OS::TripleO::ServiceNetMap
@@ -811,9 +811,11 @@ resources:
811 811
   # creates the network architecture
812 812
   Networks:
813 813
     type: OS::TripleO::Network
814
+    properties:
815
+      CtlplaneNetworkCidrs: {get_attr: [ControlVirtualIP, network, tags]}
814 816
 
815 817
   ControlVirtualIP:
816
-    depends_on: [Networks, ServiceNetMap]
818
+    depends_on: ServiceNetMap
817 819
     type: OS::TripleO::Network::Ports::ControlPlaneVipPort
818 820
     properties:
819 821
       name: control_virtual_ip

+ 1
- 0
puppet/services/apache.j2.yaml View File

@@ -91,6 +91,7 @@ outputs:
91 91
             apache::server_signature: 'Off'
92 92
             apache::server_tokens: 'Prod'
93 93
             apache_remote_proxy_ips_network:
94
+              # TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, ApacheNetwork]}
94 95
               str_replace:
95 96
                 template:
96 97
                   "%{hiera('$NETWORK_subnet')}"

+ 1
- 0
puppet/services/designate-worker.yaml View File

@@ -94,6 +94,7 @@ outputs:
94 94
               params:
95 95
                 $NETWORK: {get_param: [ServiceNetMap, DesignateApiNetwork]}
96 96
           tripleo::profile::base::designate::rndc_allowed_addresses:
97
+            # TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, DesignateApiNetwork]}
97 98
             - str_replace:
98 99
                 template:
99 100
                   "%{hiera('$NETWORK_subnet')}"

+ 29
- 0
releasenotes/notes/make-NetCidrMapValue-contain-lists-of-cidrs-19bc98dc9bc6b819.yaml View File

@@ -0,0 +1,29 @@
1
+---
2
+upgrade:
3
+  - |
4
+    Tags are now used on the ``ctlplane`` network to store the list of cidrs
5
+    associated with the subnets on the ``ctlplane`` network. Users of
6
+    Deployed Server (pre-provisioned servers) need to update the port map
7
+    (``DeployedServerPortMap``) to include the required data. For example::
8
+
9
+      parameter_defaults:
10
+        DeployedServerPortMap:
11
+          controller0-ctlplane:
12
+            fixed_ips:
13
+              - ip_address: 192.168.24.9
14
+            subnets:
15
+              - cidr: 192.168.24.0/24
16
+            network:
17
+              tags:
18
+                - 192.168.24.0/24
19
+                - 192.168.25.0/24
20
+          compute0-ctlplane:
21
+            fixed_ips:
22
+              - ip_address: 192.168.25.8
23
+            subnets:
24
+              - cidr: 192.168.25.0/24
25
+            network:
26
+              tags:
27
+                - 192.168.24.0/24
28
+                - 192.168.25.0/24
29
+

Loading…
Cancel
Save