Fix interaction between feature 11003 and volume multiattach 81/14081/2
authorLuis Vega <lvega@whitestack.com>
Fri, 1 Dec 2023 01:02:12 +0000 (01:02 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 4 Dec 2023 08:36:28 +0000 (09:36 +0100)
Change-Id: I6de2fbbbb81d7e16749e93ccef6d35c528ea5eaf
Signed-off-by: Luis Vega <lvega@whitestack.com>
RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
releasenotes/notes/fix_bug_feature-11003_and_multiattach-2e1fe2557283e628.yaml [new file with mode: 0644]

index 4a70f55..bf5a0fa 100644 (file)
@@ -187,6 +187,7 @@ class vimconnector(vimconn.VimConnector):
         self.persistent_info = persistent_info
         self.availability_zone = persistent_info.get("availability_zone", None)
         self.storage_availability_zone = None
+        self.vm_av_zone = None
         self.session = persistent_info.get("session", {"reload_client": True})
         self.my_tenant_id = self.session.get("my_tenant_id")
         self.nova = self.session.get("nova")
@@ -2201,7 +2202,7 @@ class vimconnector(vimconn.VimConnector):
         availability_zone = (
             self.storage_availability_zone
             if self.storage_availability_zone
-            else self._get_vm_availability_zone
+            else self.vm_av_zone
         )
         volume = self.cinder.volumes.create(
             size=shared_volume_data["size"],
@@ -2819,14 +2820,14 @@ class vimconnector(vimconn.VimConnector):
             config_drive, userdata = self._create_user_data(cloud_config)
 
             # Get availability Zone
-            vm_av_zone = self._get_vm_availability_zone(
+            self.vm_av_zone = self._get_vm_availability_zone(
                 availability_zone_index, availability_zone_list
             )
 
             storage_av_zone = (
                 self.storage_availability_zone
                 if self.storage_availability_zone
-                else vm_av_zone
+                else self.vm_av_zone
             )
 
             if disk_list:
@@ -2854,7 +2855,7 @@ class vimconnector(vimconn.VimConnector):
                     flavor_id,
                     net_list_vim,
                     self.config.get("security_groups"),
-                    vm_av_zone,
+                    self.vm_av_zone,
                     self.config.get("keypair"),
                     userdata,
                     config_drive,
@@ -2870,7 +2871,7 @@ class vimconnector(vimconn.VimConnector):
                 nics=net_list_vim,
                 security_groups=self.config.get("security_groups"),
                 # TODO remove security_groups in future versions. Already at neutron port
-                availability_zone=vm_av_zone,
+                availability_zone=self.vm_av_zone,
                 key_name=self.config.get("keypair"),
                 userdata=userdata,
                 config_drive=config_drive,
diff --git a/releasenotes/notes/fix_bug_feature-11003_and_multiattach-2e1fe2557283e628.yaml b/releasenotes/notes/fix_bug_feature-11003_and_multiattach-2e1fe2557283e628.yaml
new file mode 100644 (file)
index 0000000..0c3a107
--- /dev/null
@@ -0,0 +1,21 @@
+#######################################################################################
+# 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.
+#######################################################################################
+---
+fixes:
+  - |
+    Feature 11003 breaks volume multiattach due to how the AZ is handled in the case of share
+    volumes. This change fixes that problem, allowing the basic31 daily test to work as intended.