Browse Source

Add `default` to network segment range resource

This patch is a follow-up to [1] to propose adding a new `read-only`
attribute `default` to the network segment range resource. It tracks
whether this is a range that is managed/loaded from the host ML2 config
file [2].

The attribute is proposed based on the following considerations:
1. We prefer the underlying network segment ranges to be exposed so that
   an admin can base on the info to make per-tenant range assignment;
2. We want the backward compatibility to be maintained, i.e. no work
   flow change with and without the extension is loaded;
3. We need to handle the range DB refresh/config repopulation when a
   Neutron server starts/restarts.

[1] https://review.openstack.org/599980
[2] /etc/neutron/plugins/ml2/ml2_conf.ini

Co-Authored-By: Matt Peters <matt.peters@windriver.com>

Partially-implements: blueprint network-segment-range-management
Change-Id: I8cc0ed77603a5d430c6d7b2b503c7b5a80ed0051
Kailun Qin 3 months ago
parent
commit
629248149d
1 changed files with 23 additions and 5 deletions
  1. 23
    5
      specs/stein/network-segment-range-management.rst

+ 23
- 5
specs/stein/network-segment-range-management.rst View File

@@ -185,6 +185,7 @@ feature::
185 185
     CREATE TABLE network_segment_ranges (
186 186
       id CHAR(36) NOT NULL PRI KEY,
187 187
       name VARCHAR(255),
188
+      default BOOL NOT NULL,
188 189
       shared BOOL NOT NULL,
189 190
       project_id VARCHAR(255) NOT NULL,
190 191
       network_type ENUM('vlan', 'vxlan', 'gre', 'geneve') NOT NULL,
@@ -212,8 +213,9 @@ Mixin classes to add the network segment range management extension should be
212 213
 provided. The DB operation logic should be handled by the ML2 type manager and
213 214
 the type drivers. For the values present in the existing ML2 configuration
214 215
 options [1]_ (e.g. ml2_type_vlan, ml2_type_vxlan etc.), they will be loaded as
215
-`shared` segment ranges into segment_range DB in order to provide backward
216
-compatibility for initial deployment when this extension is present.
216
+`shared` and `default` segment ranges into network_segment_ranges DB in order
217
+to provide backward compatibility for initial deployment when this extension is
218
+present.
217 219
 
218 220
 Resource Extension
219 221
 ------------------
@@ -236,6 +238,10 @@ like:
236 238
                  'type:string': db_const.NAME_FIELD_SIZE},
237 239
                'default': '', 'is_visible': True, 'is_filter': True,
238 240
                'is_sort_key': True},
241
+      'default': {'allow_post': False, 'allow_put': False,
242
+                  'convert_to': converters.convert_to_boolean,
243
+                  'default': False,
244
+                  'is_visible': True},
239 245
       'shared': {'allow_post': True, 'allow_put': False,
240 246
                  'convert_to': converters.convert_to_boolean,
241 247
                  'is_visible': True, 'default': True},
@@ -285,6 +291,11 @@ Resource extension network_segment_ranges:
285 291
 | name            | String | No  |  CRU   | ''        | Name of network       |
286 292
 |                 |        |     |        |           | segment range         |
287 293
 +-----------------+--------+-----+--------+-----------+-----------------------+
294
+| default         | Bool   | No  |  R     | False     | Default network       |
295
+|                 |        |     |        |           | segment range that is |
296
+|                 |        |     |        |           | loaded from the host  |
297
+|                 |        |     |        |           | ML2 config file [1]_  |
298
++-----------------+--------+-----+--------+-----------+-----------------------+
288 299
 | shared          | Bool   | Yes |  CR    | False     | Shared with other     |
289 300
 |                 |        |     |        |           | projects              |
290 301
 +-----------------+--------+-----+--------+-----------+-----------------------+
@@ -333,6 +344,7 @@ line with the new resources previously introduced:
333 344
         {
334 345
           "id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f",
335 346
           "name": "network_segment_range_physnet1",
347
+          "default": False,
336 348
           "shared": False,
337 349
           "project_id": "45977fa2dbd7482098dd68d0d8970117",
338 350
           "network_type": "vlan",
@@ -357,6 +369,7 @@ line with the new resources previously introduced:
357 369
       "network_segment_range": {
358 370
         "id": "d23abc8d-2991-4a55-ba98-2aaea84cc72f",
359 371
         "name": "network_segment_range_physnet1",
372
+        "default": False,
360 373
         "shared": False,
361 374
         "project_id": "45977fa2dbd7482098dd68d0d8970117",
362 375
         "network_type": "vlan",
@@ -460,9 +473,14 @@ Other Impact
460 473
 * ML2 plugin, plugin manager and type drivers will need to be refined and added
461 474
   with several new methods correspondingly in order to support this feature.
462 475
 
463
-* The existing ML2 configuration will populate the proposed
464
-  network_segment_ranges as a shared range. When this extension is loaded, a
465
-  change is expected in the processing of the ML2 configuration.
476
+* When this extension is loaded, the Neutron server will populate the proposed
477
+  network_segment_ranges DB table with the ranges defined within the existing
478
+  ML2 configuration as `default` and `shared` ranges. These `default` ranges
479
+  are read-only and an administrator can make per-tenant segment range
480
+  assignment based on this information. When a Neutron server starts/restarts,
481
+  the `default` segment ranges will be reloaded and be visible to all servers.
482
+  Interactions from the REST APIs will always operate based on the segment
483
+  ranges defined within the database.
466 484
 
467 485
 * Validation work is needed for quite a few cases, including but not limited
468 486
   to:

Loading…
Cancel
Save