Fix: Unshelving an instance uses original image

The driver uses the property image_ref to boot the
the instance.
This patch updates the image_ref property with the
shelved_image_id stored during the shelving.

Change-Id: I2304618bb5a995ea43f2a36069cfa0f3787c9792
Closes-Bug: #1257594
(cherry picked from commit 60455490c2c664dd41364ede29add64967a08844)
VMWare: add power off vm before detach disk during unrescue

Non Hot Plug type disk like IDE can only be detached when the VM is power off.

Close-bug: #1279199
(cherry picked from commit 1e1915aaaca38b5691794e0e052a42b9d95dd3c2)

Conflicts:

	nova/virt/vmwareapi/vmops.py

Change-Id: Ib1f387a41abe2b52357854e90c2535ebb7b43f18
VMware: ensure rescue instance is deleted when instance is deleted

If the user creates a rescue instance and then proceeded to delete
the original instance then the rescue instance would still be up
and running on the backend.

This patch ensures that the rescue instance is cleaned up if
necessary.

The vmops unrescue method has a new parameter indicating if
the original VM should be powered on.

Closes-bug: 1269418
(cherry picked from commit efb66531bc37ee416778a70d46c657608ca767af)

Conflicts:

	nova/tests/virt/vmwareapi/test_vmwareapi.py
	nova/virt/vmwareapi/vmops.py

Change-Id: I3c1d0b1d003392b306094b80ea1ac99377441fbf
Remove unnecessary call to fetch info_cache

The _heal_instance_info cache() always accesses instance['info_cache']
therefore we should always load the info_cache so we can avoid the extra
query to fetch it.

Closes-bug: #1309239

Conflicts:
	nova/compute/manager.py

(cherry picked from commit 5aa29b6b0a34d603e882a80cdc8e936f983b1892)

Change-Id: I3c2e005b98abf2a80276562cc05e88ba5ff199bc
Merge "VMWare: add power off vm before detach disk during unrescue" into stable/havana
Merge "VMware: ensure rescue instance is deleted when instance is deleted" into stable/havana
Merge "Fix: Unshelving an instance uses original image" into stable/havana
Merge "Remove unnecessary call to fetch info_cache" into stable/havana
Network: ensure that ports are 'unset' when instance is deleted

Commit a141206e9dfd31955b9b31d9e5a7f73bbd8510ca ensured that user defined
ports were not deleted when an instance is deleted or rescheduled. The
problem with this commit is that it did not reset the 'device_id' and
'device_owner' of the port. This leads to port leakage and eventually a tenant
is unable to launch any instances as their port quota has exceeded the
allocated amount.

The solution is for the deallocation to reset the 'device_id' and the
'device_owner' of the port. This is allocated when the port is actually assigned
to an instance.

In the case of minesweeper (which runs on OpenStack), the tenant was leaking ports.
The root cause was that the user defined ports were assigned to a specific instance,
which was deleted, as a result of a failed reschedule (which is legitimate).

When an instance is deleted all artificats of that instance should be reset on the
port.

Change-Id: Ie1516c299ce6d79faf2d5103a14d6d8931d3ede2
Closes-bug: #1321381
(cherry picked from commit 803d59e9f409a59403b2ce55040acc02e14eee28)