KVMotion: vmware compute eph support#648
Draft
anokfireball wants to merge 2 commits into
Draft
Conversation
Power off a source VMware VM and detach its root VMDK for cross-HV
conversion (prep), and the inverse that reattaches and powers back on
(abort).
New private helpers in VMwareVMOps:
_get_root_disk_device(hardware_devices)
Finds the VirtualDisk on any SCSI controller at unit number 0.
Requires class name 'VirtualDisk' to skip CD-ROMs and other
devices that may share the same slot. Raises DiskNotFound when
absent.
_derive_cinder_host()
Returns 'cinder-volume-vmware-{vc-name}@vmware_fcd', where
vc-name is the first DNS label of CONF.vmware.host_ip. Requires
FQDN vCenter addressing.
prep_cross_hv_conversion(context, instance):
- Discovers the root disk before touching power state; any
DiskNotFound is raised immediately with no side effects.
- If RUNNING, calls power_off_instance and records its boolean
return as powered_off_by_us. The helper returns False when the
VM was already off at the point the task fired.
- Accepts SHUTDOWN without re-issuing power-off (makes the call
tolerable to retry if a previous attempt got as far as power-off
but not detach).
- Rejects any other state with InstanceInvalidState.
- Detaches the root VMDK via detach_virtual_disk_spec, passed as a
single-element list to reconfigure_vm_device_change (deviceChange
is an array type in the vSphere WSDL; all existing callers pass
lists).
- On detach failure, powers the VM back on only when
powered_off_by_us is True. Pre-existing shutdown state is left
unchanged.
- Returns vmdk_path, size_bytes (derived via _get_device_capacity
for pre-vSphere-5.5 KB fallback), cinder_host, rollback dict, and
optional source_fcd_id when the disk has a vDiskId.
abort_cross_hv_conversion(context, instance, prep_data):
- Skips reattach if the backing.fileName already matches vmdk_path.
- Reattaches via get_vmdk_attach_config_spec, which sets key=-100
and fills in connectable and diskMode.
- Skips power-on if the VM is already RUNNING.
Change-Id: I5b8057f8797d714c1e33f782a3b9f72a47f50407
Add two compute RPC methods that call through to the virt driver:
prep_cross_hv_conversion and abort_cross_hv_conversion.
nova/virt/driver.py:
Base stubs raising NotImplementedError. Drivers that don't support
cross-HV conversion inherit them unchanged.
nova/virt/vmwareapi/driver.py:
Delegation to VMwareVMOps.
nova/virt/fake.py:
Stubs raising NotImplementedError. Unit tests that exercise the
manager endpoints mock the driver method directly.
nova/compute/manager.py:
ComputeManager.target bumped to '6.2.1'.
prep_cross_hv_conversion: decorated with
@messaging.expected_exceptions(DiskNotFound, InstanceInvalidState)
so those exception types survive the RPC wire as typed exceptions
rather than RemoteError. Also carries the standard
@wrap_exception / @wrap_instance_event / @wrap_instance_fault stack.
abort_cross_hv_conversion: same standard decorator stack, no
expected_exceptions (abort failure is not an expected path and
should surface as RemoteError).
nova/compute/rpcapi.py:
Both methods require version '6.2.1'; raise UnsupportedRPCVersion
when the target compute does not support it. Synchronous call()
with call_monitor_timeout=CONF.rpc_response_timeout and a 180 s
hard timeout.
nova/objects/service.py:
SERVICE_VERSION = 67, history entry {'compute_rpc': '6.2.1'}.
Change-Id: I277618423e1fe881e56a36cd277b713bcc7a6cda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.