From: deepika.e Date: Mon, 3 Jun 2024 08:42:50 +0000 (+0530) Subject: Bug 2316: Fix for Unable to do vertical scaling when VM is in Shutdown state X-Git-Tag: release-v16.0-start~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F14405%2F2;p=osm%2FRO.git Bug 2316: Fix for Unable to do vertical scaling when VM is in Shutdown state Change-Id: Ie096ed7ecb14d542c68122b1e188f7c8534b91ec Signed-off-by: deepika.e --- diff --git a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py index 221fc241..85ef2ca1 100644 --- a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py +++ b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py @@ -4532,7 +4532,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( @@ -4547,7 +4549,7 @@ class vimconnector(vimconn.VimConnector): message="Cannot 'resize' instance while it is in vm_state resized", ) - def confirm_resize(self, vm_id): + def confirm_resize(self, vm_id, instance_state): """ Confirm the resize of an instance param: @@ -4556,7 +4558,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