Ensure deleted instances' status is always DELETED

Currently when deleting failed instances that were never assigned a
host, their vm_state is left in 'error' instead of 'deleted'. This is a
problem when invoking the Index Instances REST API with a Changes-Since
query parameter since that API returns both deleted and non-deleted
instances, but currently the failed deleted instances are incorrectly
marked as status:ERROR instead of status:DELETED.

This patch modifies the server ViewBuilder to ensure the status is
correctly set.

Change-Id: I614714676bab4986564b236d74f2c0d77400e48c
Closes-bug: #1243301
(cherry picked from commit 38018d32f9db5b9222436d0f860244ce38ba97fb)
Fix bug detach volume fails with "KeyError" in EC2

Modified volume['instance_uuid'] to volume.get('instance_uuid'),
to avoid "KeyError", when detach a volume with "attaching" status.

Change-Id: Ic1aacab212c2a2026d18ef57ad9d77fdc6d86b47
Closes-Bug: #1280532
(cherry picked from commit fa72e49845179e29cf918e0742ef735ae868bb4c)
Remove unnecessary steps for cold snapshots

Up until now when we created cold snapshots we were stopping the
instance, create an internal snapshot, extract the snapshot to a file
and then delete the internal snapshot before bringing up the instance.

If the instance is shut down, there's no concurrent writer, so the image
can be directly extracted without taking an internal snapshot first,
because the snapshot and the current state are the same.

In this patch the creation and deletion of the internal snapshot are
removed to eliminate the extra steps and optimize the creation of
snapshots a bit.

Closes-Bug: #1242819
Closes-Bug: #1247185

Change-Id: I429fa2e1e26aea321eecbf14edd11263fff525ae
(cherry picked from commit 8c985874c7885f31871204d3f83ce547fefc5fb6)
Use the mangle checksum fill rule regardless to the multi_host

The checksum-fill is required even when you are running devstack,
in a nested kvm guest.
Always using the checksum-fill on all dhcp responses is safe, and does
not have significant impact.

The situation is similar when the checksum-fill first introduced to
nova.

See Also:
https://bugzilla.redhat.com/show_bug.cgi?id=910619#c6

Change-Id: I8a34d5f815f6bfef6d683965ed51a77e82af8834
(cherry picked from commit a6dd0cdf0a444e2f28528ef8e8a8d3f3b845b5d8)
Qpid: advance thru the list of brokers on reconnect

Sync 877f1cab328fe8a9f8214687ea7e1287862de87d from oslo-incubator's
stable/havana branch.

In Qpid implementation, when using multiple qpid_hosts, we don't want to
immediately retry failed connection for the same failed broker. This was not
the case in existing implementation though, where we've always attempted to
reconnect starting from the first broker in the list of candidates. So if the
first broker failed, we initiated reconnect to the same failed broker.

This change makes reconnect() implementation to select the next broker in the
list. This also means that non-failure reconnect attempts will also switch the
current broker. All in all, users should not rely on any particular order to
use brokers from the list, so this should not constitute an issue.

Change-Id: Ia148baa6e1ec632789ac3621c85173c2c16f3918
Partial-Bug: 1261631
Require admin context for interfaces on ext network

Currently any user can attach an interface to a neutron
external network, if the neutron plugin supports the port
binding extension.
In this case, nova will create neutron ports using the admin
client, thus bypassing neutron authZ checks for creating ports
on external networks.

This patch adds a check in nova to verify the API request has an
admin context when a request for an interface is made on a
neutron external network.

Conflicts:
	nova/exception.py

Change-Id: I5fb0bdcbf19eb82746ea3b192c1f65899bfb3c0b
Closes-Bug: 1284718
(cherry picked from commit 7d1b4117fda7709307a35e56625cfa7709a6b795)
Merge "Qpid: advance thru the list of brokers on reconnect" into stable/havana
Merge "Remove unnecessary steps for cold snapshots" into stable/havana
Merge "Use the mangle checksum fill rule regardless to the multi_host" into stable/havana
Merge "Ensure deleted instances' status is always DELETED" into stable/havana
Merge "Fix bug detach volume fails with "KeyError" in EC2" into stable/havana