VMware: prevent race condition with VNC port allocation

When spawning some instances, nova VMware driver could have a race condition
in VNC port allocation. This fix ensures that the lock is done on the
actual setting in the VM configuration spec.

Co-authored-by: Marcio Roberto Starke <marcio.starke@serpro.gov.br>

Change-Id: I70fab021bbf2df418df53e5f47e19cf16dbe45ac
Closes-bug: #1357372
Fix creating bdm for failed volume attachment

This commit modifies the reserve_block_device_name method to return the
bdm object, when the corresponding keyword argument is True. This
ensures the correct bdm is destroyed if the attach fails. Currently the
code assumes only one bdm per volume and so retrieving it can cause the
incorrect db entry to be returned.

Change-Id: I22a6db76d2044331d1a846eb4b6d7338c50270e2
Closes-Bug: #1349888
console: make websocketproxy handles token from path

As part of the blueprint serial-ports when connecting to
the proxy with a plain websocket, make Nova able to retrieve
the token from the request path.

Closes-Bug: #1373950
Change-Id: I0b0b23c954dbb812acfa7616696445c0e167d2c8
VMWare: Fix VM leak when deletion of VM during resizing

During the VM resizing, before VM arrive RESIZED state, driver
migrate_disk_and_power_off will initially rename orginal vm
'uuid' to be 'uuid-orig' and clone a new vm with 'uuid' name.
When deletion VM is triggered at this time window, it wouldn't
be able to delete the VM uuid-orig in VCenter and so cause VM leak.
As VM task state will be set to 'deleting' and it can not be used to
determine the resize migrating/migrated state, this fix will
attempt to delete orig VM within destroy phase.

Change-Id: I7598afbf0dc3c527471af34224003d28e64daaff
Closes-Bug: #1359138
Merge "console: make websocketproxy handles token from path"
Merge "Fix creating bdm for failed volume attachment"
Merge "VMware: prevent race condition with VNC port allocation"
Merge "VMWare: Fix VM leak when deletion of VM during resizing"