Comment 9 for bug 2025480

Revision history for this message
Pawel Koniszewski (pawel-koniszewski) wrote (last edit ):

It seems to me that it is due to this if condition racing with unshelve operation:

https://github.com/openstack/nova/blob/f0565e84ee9578d6dafd22d57fb0c95cb3984c1e/nova/compute/resource_tracker.py#L1673

When unshelving operation is on-going, the VM may be in SHELVE_OFFLOADED state, however, its task state may be already set to SPAWNING. The instance claim happens when VM is in SHELVE_OFFLOADED/SPAWNING state:

https://github.com/openstack/nova/blob/f0565e84ee9578d6dafd22d57fb0c95cb3984c1e/nova/compute/manager.py#L7075

so when update_available_resources is triggered the if condition does not take this instance usage into consideration effectively removing resources claimed by the instance.