commit f1320a7c2debf127a93773046adffb80563fd20b
Author: Stephen Finucane <email address hidden>
Date: Mon May 30 16:03:35 2016 +0100
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.
Reviewed: https:/ /review. openstack. org/323269 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=f1320a7c2de bf127a93773046a dffb80563fd20b
Committed: https:/
Submitter: Jenkins
Branch: master
commit f1320a7c2debf12 7a93773046adffb 80563fd20b
Author: Stephen Finucane <email address hidden>
Date: Mon May 30 16:03:35 2016 +0100
Evaluate 'task_state' in resource (de)allocation
There are two types of VM states associated with shelving. The first, offloaded' ,
'shelved' indicates that the VM has been powered off but the resources
remain allocated on the hypervisor. The second, 'shelved_
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 offloaded' should have resources deallocated from it, rather
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_
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: Ie2e7b91937fc3d 61bb1197fffc354 9bebc65e8aa
Signed-off-by: Stephen Finucane <email address hidden>
Resolves-bug: #1587386
Related-bug: #1545675