Skip to content

feat(mtv-warm-cutover): add warm migration cutover#19

Open
stevefulme1 wants to merge 7 commits into
redhat-cop:mainfrom
stevefulme1:feat/warm-migration-cutover
Open

feat(mtv-warm-cutover): add warm migration cutover#19
stevefulme1 wants to merge 7 commits into
redhat-cop:mainfrom
stevefulme1:feat/warm-migration-cutover

Conversation

@stevefulme1

Copy link
Copy Markdown
Contributor

Summary

  • Adds new mtv_warm_cutover role and playbook to finish warm migrations by triggering the cutover phase
  • Patches the Forklift Migration resource's spec.cutover with a timestamp to initiate the final CBT sync, source VM shutdown, and target VM boot
  • Supports targeting migrations by name, label selector, or plan name
  • Optional wait-for-completion with configurable retries/delay
  • Verifies migration succeeded after cutover completes
  • Companion to MFG-214 (PR feat(mtv-migrate): add warm migration plan support #18) which creates the warm migration plan

Resolves

MFG-216 — Finish warm migration step

Usage

mtv_warm_cutover_request:
  # By plan name
  - namespace: openshift-mtv
    plan_name: vmware-host-20260407-0800

  # By specific migration names with scheduled cutover
  - namespace: openshift-mtv
    names:
      - vmware-host-20260407-abc12
    cutover: "2026-04-07T02:00:00Z"

  # By label selector - immediate cutover
  - namespace: openshift-mtv
    label_selectors:
      - migration-batch=wave-1

Test plan

  • Verify yamllint passes (confirmed)
  • Verify ansible-lint --offline passes production profile (confirmed — 0 failures)
  • Integration: trigger cutover on an active warm migration by name
  • Integration: trigger cutover by plan name
  • Integration: verify cutover with scheduled timestamp
  • Integration: verify wait-for-completion detects success/failure
  • Verify already-cutover migrations are rejected gracefully

🤖 Generated with Claude Code

Add a new role and playbook to trigger cutover on active warm
migrations. Patches the Migration resource with a cutover timestamp
to initiate the final CBT sync, source VM shutdown, and target VM
boot. Supports targeting by migration name, label selector, or
plan name, with optional wait-for-completion verification.

Resolves: MFG-216

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@spyrexd spyrexd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My review is only on the code. I have not tested functionality.

Comment thread roles/mtv_warm_cutover/meta/main.yml Outdated
Comment thread roles/mtv_warm_cutover/tasks/_apply_cutover.yml Outdated
Comment thread roles/mtv_warm_cutover/tasks/_apply_cutover.yml
- Update min_ansible_version to 2.16.0
- Skip migrations that already have a cutover timestamp instead of failing
- Add argument_specs.yml declaring all role inputs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
spyrexd
spyrexd previously approved these changes Apr 29, 2026

@sabre1041 sabre1041 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments after review

@@ -0,0 +1,77 @@
---

- name: _apply_cutover | Check if Cutover Already Defined

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be a situation where the user might want to adjust the cutover time. Lets just say that they set it for time A in the future and want to bring forward the time to an earlier time to start the migration early.

Maybe we keep the existing logic on by default but allow an overview (globally + at a migration level?)

- name: _apply_cutover | Wait for Migration to Complete
when:
- not (mtv_warm_cutover_already_set | bool)
- mtv_warm_cutover_verify_complete | bool

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently a global variable. Within the mtv_migrate role, the decision to wait at different phases is on each plan. Move to support at the Migration level?

- Fail on existing cutover instead of silently skipping; add
  force_cutover option (global + per-migration) to allow override
  with op:replace patch
- Move verify_complete to per-migration level (mirrors mtv_migrate
  pattern), falling back to global default
- Add force_cutover and verify_complete to argument_specs and
  defaults with full descriptions
- Remove already_set guard from wait/verify tasks so forced
  cutovers also get verified
Run docsible to sync generated documentation with current
argument_specs and role metadata after adding force_cutover
and per-migration verify_complete options.
Merge main into feat/warm-migration-cutover, resolving conflicts in
11 role READMEs by accepting main's docsible templates and regenerating
documentation via docsible + md_toc.
Add top-level heading before docsible-generated content to satisfy
MD041/first-line-heading rule.
Match CI docsible output which does not insert a blank line between
the H1 heading and the DOCSIBLE START comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants