Skip to content

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

Open
stevefulme1 wants to merge 1 commit intoredhat-cop:mainfrom
stevefulme1:feat/post-migration-validation
Open

feat(validate-migration): add post-migration checks#17
stevefulme1 wants to merge 1 commit intoredhat-cop:mainfrom
stevefulme1:feat/post-migration-validation

Conversation

@stevefulme1
Copy link
Copy Markdown

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

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

1 participant