Skip to content

feat(validate-migration): add post-migration checks#17

Merged
sabre1041 merged 3 commits into
redhat-cop:mainfrom
stevefulme1:feat/post-migration-validation
Jul 9, 2026
Merged

feat(validate-migration): add post-migration checks#17
sabre1041 merged 3 commits into
redhat-cop:mainfrom
stevefulme1:feat/post-migration-validation

Conversation

@stevefulme1

Copy link
Copy Markdown
Contributor

Summary

  • Extends the existing validate_migration role with post-migration validation tasks (gated behind validate_migration_post_enabled: true)
  • Validates VM configurations: spec fields, CPU/memory, volumes, network interfaces, VMI running status
  • Validates data volumes: DataVolume phase (Succeeded), PVC bindings (Bound), storage sizes
  • Validates network attachments: interface/network count match, NetworkAttachmentDefinitions, NetworkPolicies
  • Validates resource relationships: VM-to-DataVolume references, orphaned DataVolumes, missing PVCs
  • Adds playbooks/validate_migration.yml playbook

Resolves

MFG-423 — Migration Logic Validation and Testing

Usage

# Enable post-migration validation
validate_migration_post_enabled: true
validate_migration_post_namespace: "my-migrated-vms"

# Optional: filter VMs by label
validate_migration_post_label_selectors:
  - migration-plan=batch-01

# Optional: skip running status check
validate_migration_check_vm_running: false

Test plan

  • Verify yamllint passes (confirmed locally)
  • Verify ansible-lint --offline passes production profile (confirmed — 0 failures)
  • Pre-migration checks still run as before (no regressions)
  • Post-migration tasks skipped when validate_migration_post_enabled: false (default)
  • Integration: validate VMs exist with correct spec after migration
  • Integration: verify DataVolumes are Succeeded and PVCs are Bound
  • Integration: verify network interfaces match network definitions
  • Integration: detect orphaned DataVolumes and missing volume references

🤖 Generated with Claude Code

@spyrexd

spyrexd commented Apr 17, 2026

Copy link
Copy Markdown

This is okay as long as the goal was just to validate the configuration has value set.

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.

In addition to the comment regarding making prevalidation checks conditional, would you be able to rebase from main as there are corrections to variable names

Comment thread roles/validate_migration/tasks/main.yml
@sabre1041

Copy link
Copy Markdown
Contributor

In addition to the comment regarding making prevalidation checks conditional, would you be able to rebase from main as there are corrections to variable names

@stevefulme1 still need a rebase here to pick up the upstream variables

@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.

Content looks good. Just need to resolve the tests failure

stevefulme1 and others added 3 commits July 9, 2026 15:20
Add post-migration validation tasks to the existing validate_migration
role covering VM configurations, data volumes, network attachments, and
resource relationships. Validates migrated VirtualMachines have correct
spec fields, DataVolumes are Succeeded, PVCs are Bound, networks match,
and detects orphaned or missing DataVolumes.

Resolves: MFG-423

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add validate_migration_pre_enabled boolean (default: true) to gate
pre-migration infrastructure checks, matching the post-migration
pattern per reviewer feedback.
@stevefulme1
stevefulme1 force-pushed the feat/post-migration-validation branch from 1456003 to 9f71e5e Compare July 9, 2026 19:21
@stevefulme1

Copy link
Copy Markdown
Contributor Author

@sabre1041 Rebased on main, added pre-migration validation toggle (validate_migration_pre_enabled), and committed the auto-generated docs. Pre-commit checks pass now — CI is waiting on the external-approval environment gate to run the full test suite.

@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.

LGTM

@sabre1041

Copy link
Copy Markdown
Contributor

Merging as failing slack notification is not part of this pr

@sabre1041
sabre1041 merged commit 6b91899 into redhat-cop:main Jul 9, 2026
20 of 22 checks passed
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