From afe8df2878ec3367f2a0f51d159bfb562b332e9c Mon Sep 17 00:00:00 2001 From: Luis Vega Date: Fri, 1 Dec 2023 01:02:12 +0000 Subject: [PATCH] Fix interaction between feature 11003 and volume multiattach Change-Id: I6de2fbbbb81d7e16749e93ccef6d35c528ea5eaf Signed-off-by: Luis Vega --- .../osm_rovim_openstack/vimconn_openstack.py | 11 +++++----- ...1003_and_multiattach-2e1fe2557283e628.yaml | 21 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/fix_bug_feature-11003_and_multiattach-2e1fe2557283e628.yaml diff --git a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py index 4a70f55d..bf5a0fa9 100644 --- a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py +++ b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py @@ -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 index 00000000..0c3a107e --- /dev/null +++ b/releasenotes/notes/fix_bug_feature-11003_and_multiattach-2e1fe2557283e628.yaml @@ -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. -- 2.25.1