nova/nova/compute
Stephen Finucane f1320a7c2d Evaluate 'task_state' in resource (de)allocation
There are two types of VM states associated with shelving. The first,
'shelved' indicates that the VM has been powered off but the resources
remain allocated on the hypervisor. The second, 'shelved_offloaded',
indicates that the VM has been powered off and the resources freed.
When "unshelving" VMs in the latter state, the VM state does not change
from 'shelved_offloaded' until some time after the VM has been
"unshelved".

Change I83a5f06 introduced a change that allowed for deallocation of
resources when they were set to the 'shelved_offloaded' state. However,
the resource (de)allocation code path assumes any VM with a state of
'shelved_offloaded' should have resources deallocated from it, rather
than allocated to it. As the VM state has not changed when this code
path is executed, resources are incorrectly deallocated from the
instance twice.

Enhance the aformentioned check to account for task state in addition to
VM state. This ensures a VM that's still in 'shelved_offloaded' state,
but is in fact being unshelved, does not trigger deallocation.

Change-Id: Ie2e7b91937fc3d61bb1197fffc3549bebc65e8aa
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Resolves-bug: #1587386
Related-bug: #1545675
2016-06-28 14:32:35 +01:00
..
monitors Allow monitor plugins to set own metric object 2016-06-27 14:38:32 +05:30
__init__.py Switch to using oslo_* instead of oslo.* 2015-02-06 06:03:10 -05:00
api.py Merge "Make instance as second arg in compute api calls" 2016-06-27 11:49:56 +00:00
arch.py Add amd64 to arch.canonicalize() 2014-09-08 08:08:00 -07:00
build_results.py Compute Add build_instance hook in compute manager 2014-12-04 10:12:00 -05:00
cells_api.py Remove policy checkpoints from ComputeAPI 2016-06-07 15:17:56 +08:00
claims.py pci: Move PCI devices and PCI requests into migration context 2016-06-03 02:09:33 +03:00
cpumodel.py Add VirtCPUModel nova objects 2015-02-09 10:26:10 +11:00
flavors.py Return 400 HTTP error for invalid flavor attributes 2016-05-26 09:49:39 +05:30
hv_type.py Add 'lxd' to the list of recognized hypervisors 2015-11-17 08:56:20 +00:00
instance_actions.py Report instance-actions for live migration force complete API 2016-03-10 15:02:35 +00:00
manager.py Improve image signature verification failure notification 2016-06-27 12:55:02 -07:00
power_state.py Remove power_state.BUILDING 2015-04-14 19:10:12 -07:00
resource_tracker.py Evaluate 'task_state' in resource (de)allocation 2016-06-28 14:32:35 +01:00
rpcapi.py Merge "Make instance as second arg in compute api calls" 2016-06-27 11:49:56 +00:00
stats.py Address nits in I83a5f06ad 2016-03-09 13:19:59 +00:00
task_states.py Remove the executable bit from several python files 2015-12-10 21:43:22 +00:00
utils.py Added instance actions for conductor 2016-06-21 21:57:35 -04:00
vm_mode.py Convert nova.compute.* to use instance dot notation 2015-02-25 17:21:36 -05:00
vm_states.py Address nits in I83a5f06ad 2016-03-09 13:19:59 +00:00