Support VMware-to-KVM Migrations for BFV-Only Instances via OpenStack Resize#627
Open
anokfireball wants to merge 5 commits into
Open
Support VMware-to-KVM Migrations for BFV-Only Instances via OpenStack Resize#627anokfireball wants to merge 5 commits into
anokfireball wants to merge 5 commits into
Conversation
7de8abf to
fa741a2
Compare
bb2df8b to
bd4f689
Compare
BzzyBriel
reviewed
Jun 16, 2026
| compute_utils.heal_reqspec_is_bfv( | ||
| self.context, self.request_spec, self.instance) | ||
| self._old_image_properties = {} | ||
| src_hv = self._source_cn.hypervisor_type if self._source_cn else None |
There was a problem hiding this comment.
self._source_cn can not only be None in tests but also from this (obsolete) codepath. Should I go fix the tests but leave the check in or just leave the check in without fixing the tests?
bd4f689 to
074afbd
Compare
anokfireball
commented
Jun 17, 2026
anokfireball
commented
Jun 17, 2026
anokfireball
commented
Jun 17, 2026
BzzyBriel
reviewed
Jun 18, 2026
anokfireball
commented
Jun 18, 2026
8dc1531 to
5ce32e2
Compare
5ce32e2 to
3d4db3a
Compare
|
i've squashed & reordered the commits a bit |
3d4db3a to
4fb113c
Compare
anokfireball
commented
Jun 29, 2026
anokfireball
commented
Jun 29, 2026
anokfireball
commented
Jun 29, 2026
e681d24 to
2c92e16
Compare
fwiesel
reviewed
Jun 30, 2026
Problem Cross-HV resize sanitizes VMware image properties before scheduling, but revert needs the original values in both the RequestSpec and instance system_metadata. Solution Add the RequestSpec sanitizer and MigrationContext.old_image_properties journal. Preserve that journal when MoveClaim rebuilds the migration context, then use it to restore RequestSpec image properties and system_metadata image_* keys during revert. Introduce the field as MigrationContext VERSION 1.2.1 to avoid colliding with a future upstream 1.3. Change-Id: I56271a118ec3785eb5ba81a6f648e58d18169e73
Allow VMware vCenter Server to CH resize for running BFV instances only. Add shared cross-hypervisor resize detection and API/conductor guardrails so unsupported directions are rejected before scheduling. The conductor sanitizes image properties and writes cross-HV system_metadata intent markers before dispatching resize work. Co-authored-by: Jakob Karge <jakob.karge@sap.com> Co-authored-by: Fabian Koller <github@kthxbye.cyou> Change-Id: I50dedca220e70f51811c0f9b9327ca3ae7ea9e12
Problem The VMware driver needs source-side shell handling for cross-HV BFV resize. The source VM must stay available as a recoverable shell so confirm and revert can complete safely. Solution Add cross-HV branches to migrate_disk_and_power_off, confirm_migration, and finish_revert_migration. The source VM is powered off, volumes and NICs are detached, instanceUuid is swapped to migration.uuid, and the shell is retained for confirm or revert. Use the shared supported-transition helper for detection, mark source preparation only after shell creation completes, and keep rollback UUID-aware when the VM has already been renamed to migration.uuid. Change-Id: I3db51a7dc0cb1dfc1592959d9823250a93fd3358
2c92e16 to
e444104
Compare
Problem Cross-HV resize depends on every service in the resize path understanding the new MigrationContext journal and driver state. During rolling upgrades, activating the feature before all services are updated can cause RPC object backport timeouts. Solution Add [workarounds] enable_cross_hv_resize, defaulting to False, and reject cross-HV resize at the API/conductor validation boundary until operators explicitly enable it after rollout. Change-Id: I2ec2513dbad1caeea7e6d99368bd4789f1ecb388
Problem VMware reports volume BDM device names as sd*, while KVM/CH presents virtio disks as vd*. After cross-HV resize, BDMs and instance.root_device_name otherwise keep the VMware-era names, and Cinder receives stale mountpoints during attachment update. Solution When cross_hv_resize is set, translate BDM device_name values and instance.root_device_name from sd* to vd* in _finish_resize before _update_volume_attachments. Translate back from vd* to sd* in _finish_revert_resize before the same attachment update path. This keeps Cinder mountpoints synchronized without extra Cinder calls. Change-Id: I66742bfac43541cdafe8f43bde751394
e444104 to
1713ae5
Compare
fwiesel
approved these changes
Jul 2, 2026
grandchild
reviewed
Jul 2, 2026
Comment on lines
+309
to
+317
| CROSS_HV_SANITIZE_PROPS = ( | ||
| ('img_hv_type', None), | ||
| ('hw_disk_bus', 'virtio'), | ||
| ('hw_cdrom_bus', 'virtio'), | ||
| ('hw_scsi_model', None), | ||
| ('hw_vif_model', 'virtio'), | ||
| ('hw_video_model', 'virtio'), | ||
| ('img_hv_requested_version', None), | ||
| ) |
There was a problem hiding this comment.
making this a dict will prevent the (admittedly unlikely) error of listing a field twice, thus overwriting the true old value in the old return value of sanitize_image_props_for_kvm().
BzzyBriel
approved these changes
Jul 2, 2026
Comment on lines
+5516
to
+5520
| restore = ( | ||
| compute_utils.restore_image_props_from_cross_hv_journal) | ||
| changed = restore(sysmeta=instance.system_metadata, | ||
| old_image_properties=( | ||
| mig_ctx.old_image_properties)) |
There was a problem hiding this comment.
Suggested change
| restore = ( | |
| compute_utils.restore_image_props_from_cross_hv_journal) | |
| changed = restore(sysmeta=instance.system_metadata, | |
| old_image_properties=( | |
| mig_ctx.old_image_properties)) | |
| changed = \ | |
| compute_utils.restore_image_props_from_cross_hv_journal( | |
| sysmeta=instance.system_metadata, | |
| old_image_properties=mig_ctx.old_image_properties) |
I think it's clearer to call the function directly instead of assigning it to a variable to reduce line length.
grandchild
approved these changes
Jul 3, 2026
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.
Implements the VMware-to-KVM Cross-Hypervisor Instance Migration for boot-from-volume instances (only!) based on the ADR decision by adding (1) the conductor sanitization of image properties that would pin the instance to VMware HVs, (2) the required source-side VMware driver control flow, (3) the confirm/revert control flow that commits/puts those properties back, and (4) an operator-visible rollout gate so activation is decoupled from deployment.
The cross-HV branches are guarded by
_is_cross_hv_resizewhich delegates to a sharedis_supported_cross_hypervisor_resizehelper. Currently the only allowlisted transition is VMware vCenter Server -> CH. The API and conductor both useraise_on_unsupported_cross_hypervisor_resizeto enforce preconditions (BFV-only, instance must be RUNNING) and reject unsupported directions at the request API level.The commits map to the ADR's Resize Orchestration choice:
compute: add cross-HV image property journal. Sanitizesimg_hv_typeand the VMware bus/vif/scsi/video model fields fromrequest_spec.image.propertiesbefore_schedule(), so the scheduler can pick a KVM/CH host. Originals go into a newMigrationContext.old_image_propertiesfield (versioned object v1.2.1) for revert._move_claimcarries the journal across the destination claim. Revert restoration lives here too:request_spec.image.propertiesandsystem_metadata['image_*']are restored from the journal before_update_volume_attachmentsand the driver call so the FCD driver receives VMware-era connection semantics again.compute: Allow VMware-to-CloudHypervisor resize. Adds the shared detection helper (is_supported_cross_hypervisor_resize) and the API-level precondition gate (raise_on_unsupported_cross_hypervisor_resize). The conductor'sMigrationTask._prep_cross_hv_resizesetscross_hv_resizeandcross_hv_source_preparedmarkers insystem_metadatabefore dispatching to the VMware driver.vmware: enable cross-HV BFV resize in VMware driver. Adds branches tomigrate_disk_and_power_off,confirm_migration, andfinish_revert_migration. Source-side power-off and volume/NIC detach useReconfigVMonly: no file deletion, no Cinder calls. The "shell" VM stays registered in vCenter undermigration.uuidso confirm and revert can find it. Source preparation is only marked complete after the shell is fully created, and confirm/revert skip shell operations when the source was never prepared. Revert restoresinstanceUuidbefore re-attaching volumes, since the volume attach paths look up the VM byinstance.uuid.compute: gate cross-HV resize behind feature flag. Adds[workarounds] enable_cross_hv_resize(defaultFalse) and rejects cross-HV resize at the API/conductor validation boundary until operators explicitly enable it after rollout. Together with the v1.2.1 OVO patch bump, this lets us ship the code without activating the feature until every service in the resize path has been rolled out.compute: translate device names for cross-HV resize. VMware reports volume BDM device names assd*while KVM/CH presents virtio disks asvd*. Whencross_hv_resizeis set, BDMdevice_namevalues andinstance.root_device_nameare translated fromsd*tovd*in_finish_resizebefore_update_volume_attachments, and back fromvd*tosd*in_finish_revert_resizeon the same boundary. Cinder mountpoints stay synchronized with no extra Cinder API calls.Also as per ADR, there is no Cinder retype during resize. The FCD driver keeps serving NFS connection_info to KVM connectors, and volumes stay typed
vstorageobject. Customers run a standardos-retypewhen they are ready to change the volume type.