From: elumalai Date: Tue, 14 Nov 2023 17:19:08 +0000 (+0530) Subject: Bug 2316: Fix for Unable to do vertical scaling when VM is in Shutdown state X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F14019%2F4;p=osm%2FRO.git Bug 2316: Fix for Unable to do vertical scaling when VM is in Shutdown state Change-Id: I141db0fa789daa966283a99f01c6693b0ab4d363 Signed-off-by: elumalai --- diff --git a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py index 9d474371..2017d563 100644 --- a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py +++ b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py @@ -3902,7 +3902,9 @@ class vimconnector(vimconn.VimConnector): self.nova.servers.resize(server=vm_id, flavor=new_flavor_id) vm_state = self.__wait_for_vm(vm_id, "VERIFY_RESIZE") if vm_state: - instance_resized_status = self.confirm_resize(vm_id) + instance_resized_status = self.confirm_resize( + vm_id, instance_status + ) return instance_resized_status else: raise nvExceptions.BadRequest( @@ -3923,7 +3925,7 @@ class vimconnector(vimconn.VimConnector): ) as e: self._format_exception(e) - def confirm_resize(self, vm_id): + def confirm_resize(self, vm_id, instance_state): """ Confirm the resize of an instance param: @@ -3932,7 +3934,7 @@ class vimconnector(vimconn.VimConnector): self._reload_connection() self.nova.servers.confirm_resize(server=vm_id) if self.get_vdu_state(vm_id)[0] == "VERIFY_RESIZE": - self.__wait_for_vm(vm_id, "ACTIVE") + self.__wait_for_vm(vm_id, instance_state) instance_status = self.get_vdu_state(vm_id)[0] return instance_status diff --git a/releasenotes/notes/bug_fix_2316-94732548c63aea74.yaml b/releasenotes/notes/bug_fix_2316-94732548c63aea74.yaml new file mode 100644 index 00000000..cdc420dc --- /dev/null +++ b/releasenotes/notes/bug_fix_2316-94732548c63aea74.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: + - | + Fix for bug 2316 Unable to do vertical scaling when VM is in shutdown + state.