Skip to content

feat: Role for pre migration vm activities + CBT enablement - #92

Merged
tech2734 merged 1 commit into
redhat-cop:v2from
sabre1041:pre_migration_vm
Sep 17, 2026
Merged

tech2734 merged 1 commit into
redhat-cop:v2from
sabre1041:pre_migration_vm

Conversation

@sabre1041

Copy link
Copy Markdown
Contributor

Description

New role to perform pre migration activities against VM's in source targets. An initial action is available to enable Change Block Tracking (CBT) within a VM (Connects directly to VMware).

Type of Change

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation changes
  • style: Formatting, missing semi colons, etc; no code change
  • refactor: Refactoring production code
  • test: Adding missing tests, refactoring tests; no production code change
  • chore: Updating configs, etc; no production code change

Notes for testing

  • Call the playbook (or Job Template in AAP) at playbooks/vmf_pre_migration_vm.yml
  • Specify pre_migration_vm_action: enable_cbt
  • Specify VMware credential
  • Specify the VMware datacenter
  • Set the VM name, moid or UUID with optional folder

@tech2734

Copy link
Copy Markdown

Review Feedback

Nice design — the pluggable action pattern and CBT idempotency check are well done. A few items:

1. secure_logging defined but never applied

pre_migration_vm_secure_logging is configured (cascading from secure_logging) but none of the VMware module tasks use no_log. The guest_info, vm_powerstate, and vm_advanced_settings tasks all pass password as a parameter. Without no_log, the VMware password could appear in task output/logs. Should add:

no_log: "{{ pre_migration_vm_secure_logging | bool }}"

to the tasks that handle VMware credentials.

2. Default leaves VM powered off after CBT enablement

pre_migration_vm_enable_cbt_power_on_post_enable defaults to false. Since enabling CBT requires powering off the VM first, this default leaves the VM powered off after the operation completes. A default of true (power back on) would be safer for production VMs, with the option to leave it off if explicitly desired.

3. Stray quote in fail message

msg: >-
  At least one of pre_migration_vm_vmware_vm_name, pre_migration_vm_vmware_vm_moid,
  or pre_migration_vm_vmware_vm_uuid must be provided."

The trailing " is literal text in a >- block — should be removed.

4. AAP survey only prompts for action

The aap_seed template survey only has one question (pre_migration_vm_action), but the role also requires VM identifier (name/moid/uuid) and datacenter. Either the survey should include additional fields for the key VM parameters, or the template description should note that extra vars are required at launch.

5. Minor — license inconsistency

meta/main.yml uses GPL-3.0-or-later while most other roles in the collection use GPL-3.0-only.

Signed-off-by: Andrew Block <andy.block@gmail.com>

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

no_log and stray quote fixed. Approved.

@tech2734
tech2734 merged commit bd85086 into redhat-cop:v2 Sep 17, 2026
22 checks passed

This branch was successfully deployed

1 active deployment
external-ci — 8bfae4b3 Deployed Sep 17, 2026 by sabre1041 via external-approval #628
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.

2 participants