Do not untrack resources of a server being unshelved
This patch concerns the time when a VM is being unshelved and the
compute manager set the task_state to spawning, claimed resources of
the VM and then called driver.spawn(). So the instance is in vm_state
SHELVED_OFFLOADED, task_state spawning.
If at this point a new update_available_resource periodic job is
started that collects all the instances assigned to the node to
calculate resource usage. However the calculation assumed that a
VM in SHELVED_OFFLOADED state does not need resource allocation on
the node (probably being removed from the node as it is offloaded)
and deleted the resource claim.
Given all this we ended up with the VM spawned successfully but having
lost the resource claim on the node.
This patch changes what we do in vm_state SHELVED_OFFLOADED, task_state
spawning. We no longer delete the resource claim in this state and
keep tracking the resource in stats.
Change-Id: I8c9944810c09d501a6d3f60f095d9817b756872d
Closes-Bug: #2025480
(cherry picked from commit f1dc4ec39bcfda1bd4b97e233a9da498b6378c4f)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /904371 /opendev. org/openstack/ nova/commit/ 4239d1fec2814c0 74482b740a2fd38 a5d5ce6942
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/2023.2
commit 4239d1fec2814c0 74482b740a2fd38 a5d5ce6942
Author: Bence Romsics <email address hidden>
Date: Wed Aug 2 16:22:55 2023 +0200
Do not untrack resources of a server being unshelved
This patch concerns the time when a VM is being unshelved and the OFFLOADED, task_state spawning.
compute manager set the task_state to spawning, claimed resources of
the VM and then called driver.spawn(). So the instance is in vm_state
SHELVED_
If at this point a new update_ available_ resource periodic job is
started that collects all the instances assigned to the node to
calculate resource usage. However the calculation assumed that a
VM in SHELVED_OFFLOADED state does not need resource allocation on
the node (probably being removed from the node as it is offloaded)
and deleted the resource claim.
Given all this we ended up with the VM spawned successfully but having
lost the resource claim on the node.
This patch changes what we do in vm_state SHELVED_OFFLOADED, task_state
spawning. We no longer delete the resource claim in this state and
keep tracking the resource in stats.
Change-Id: I8c9944810c09d5 01a6d3f60f095d9 817b756872d bd4b97e233a9da4 98b6378c4f)
Closes-Bug: #2025480
(cherry picked from commit f1dc4ec39bcfda1