Feature 10978: Add support of ipv6_address_mode and ipv6_ra_mode to openstack connector 56/13056/2
authorGabriel Cuba <gcuba@whitestack.com>
Tue, 14 Mar 2023 15:58:39 +0000 (10:58 -0500)
committeraticig <gulsum.atici@canonical.com>
Fri, 24 Mar 2023 04:05:46 +0000 (05:05 +0100)
Change-Id: I8ca741a215bd2c52999dee1ea301d4e02aafcb24
Signed-off-by: Gabriel Cuba <gcuba@whitestack.com>
RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
releasenotes/notes/feature_10978_IPv6_network_creation_with_specific_parameters-1524903ddd764e28.yaml [new file with mode: 0644]

index 621324a..e4ee15b 100644 (file)
@@ -934,6 +934,15 @@ class vimconnector(vimconn.VimConnector):
                 ip_str = str(netaddr.IPAddress(ip_int))
                 subnet["allocation_pools"][0]["end"] = ip_str
 
+            if (
+                ip_profile.get("ipv6_address_mode")
+                and ip_profile["ip_version"] != "IPv4"
+            ):
+                subnet["ipv6_address_mode"] = ip_profile["ipv6_address_mode"]
+                # ipv6_ra_mode can be set to the same value for most use cases, see documentation:
+                # https://docs.openstack.org/neutron/latest/admin/config-ipv6.html#ipv6-ra-mode-and-ipv6-address-mode-combinations
+                subnet["ipv6_ra_mode"] = ip_profile["ipv6_address_mode"]
+
             # self.logger.debug(">>>>>>>>>>>>>>>>>> Subnet: %s", str(subnet))
             self.neutron.create_subnet({"subnet": subnet})
 
diff --git a/releasenotes/notes/feature_10978_IPv6_network_creation_with_specific_parameters-1524903ddd764e28.yaml b/releasenotes/notes/feature_10978_IPv6_network_creation_with_specific_parameters-1524903ddd764e28.yaml
new file mode 100644 (file)
index 0000000..dbb5ab8
--- /dev/null
@@ -0,0 +1,20 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+features:
+  - |
+    Feature 10978: Add support of ipv6_address_mode and ipv6_ra_mode to openstack connector.
\ No newline at end of file