Removed unused instance object helper function

Remove code that is no longer used

Change-Id: Iaf99824ad28aa03206a997e69d9f6097ba034941
handle migration errors

handle errors:
   MigrationPreCheckError, NoValidHost,
   InvalidSharedStorage and InvalidLocalStorage
in _migrate_live so that the 'reason' is passed up

Closes-Bug: 1250523

Change-Id: I3d7e0626223f2606c5e7205e5022e26585506cfb
Use of logging in native thread causes deadlock connecting to libvirtd

When connecting to libvirtd daemon we were calling the _connect
method in a native thread. The use of logging in this method hit this
bug in eventlet https://bitbucket.org/eventlet/eventlet/issue/137/
causing nova-compute to hang.

Closes-Bug: #1252409

Change-Id: I0d22c3ed1b3288aeb1afae130f11a4f38dc6440a
Remove _security_group_chain_name from nova/virt/firewall.py

The function _security_group_chain_name in nova/virt/firewall.py is
useless for now, just remove it.

Change-Id: I1ad7050115ad56ce7b152efbcfcc42aff8e6c3ed
libvirt: host update disable/enable report HTTP 400

When disable/enable host with host-update command, end user will
get HTTP 400 error even if the host was updated(disabled/enabled)
successfully.

The root cause is that after the host was disabled/enabled, nova
api need depend on host status result to check if the host was
disabled or enabled, but libvirt driver did not return host status
to nova api.

Change-Id: I0688134eecb0628b680c8ed01741f00f80eec53f
Closes-Bug: #1251589
Add status mapping for shutoff instance when resize

Current code always map instance's status into Shutoff when
getting status of resizing instance with power_state shutoff.
This isn't consistent with active instance, we should add
status mapping for power-off resizing instance.

Closes-Bug: #1247106
Co-Authored-By: chenxiao <chenxiao@cn.ibm.com>
Change-Id: Id4bff71b2c46ec9dccea6d8ac36eba273e48ea5d
Recover from IMAGE-* state on compute manager start-up

If a compute manager is stopped / fails during certain IMAGE-*
operations then the instance will be left stuck in a transitional
task_state

This change handles three possible task states IMAGE_PENDING_UPLOAD,
IMAGE_UPLOADING, and IMAGE_SNAPSHOT.

Both IMAGE_PENDING_UPLOAD and IMAGE_UPLOADING are task states set
after the request has gotten to the compute manager and so we can
clear these safely knowing the operation has ended/failed with the
restart of the compute manager.

With IMAGE-SNAPSHOT it's possible this state was set in the API so
we revert the instance to a task_state of None but the change also
makes provision to set the task_state to IMAGE-SNAPSHOT once the
request comes through to the compute manager so the current
operation is clear once it begins again after the compute manager is
back up and running.

Related to blueprint recover-stuck-state
Change-Id: I665c0ec735968aa0d7553dfc0cfb2373f93451f6
Merge "Removed unused instance object helper function"
Merge "Remove _security_group_chain_name from nova/virt/firewall.py"
Merge "Use of logging in native thread causes deadlock connecting to libvirtd"
Merge "handle migration errors"
Merge "Recover from IMAGE-* state on compute manager start-up"
Merge "libvirt: host update disable/enable report HTTP 400"
Merge "Add status mapping for shutoff instance when resize"