Skip to content

feat: add Windows shared disk migration test - #562

Merged
myakove merged 33 commits into
RedHatQE:mainfrom
MiriSafra:feat/shared-disk-windows-migration
Jul 2, 2026
Merged

myakove merged 33 commits into
RedHatQE:mainfrom
MiriSafra:feat/shared-disk-windows-migration

Conversation

@MiriSafra

@MiriSafra MiriSafra commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add Windows shared disk migration test (tier1) for MTV-4639
  • Implement dynamic NTFS labeling via VMware Guest Operations API — labels the shared disk on the source VM before migration using PowerShell commands executed through vSphere Guest Ops
  • Add post-migration verification that reads/writes marker files on the shared RWX PVC from both Windows VMs via SSH
  • 7-step incremental test pattern: label_shared_disk → storagemap → networkmap → plan → migrate → verify_shared_disk_data → check_vms

Changed Files

File Change
tests/shared_disk/test_shared_disk_windows_migration.py New test class with 7-step incremental pattern for Windows shared disk migration
utilities/shared_disk.py Add label_shared_disk_on_source_windows(), verify_shared_disk_data_windows(), and Windows-specific helpers (_win_run_powershell, _win_ensure_shared_volume_online, _win_get_shared_drive_letter, _win_write_marker, _win_read_marker, _win_refresh_shared_disk)
tests/tests_config/config.py Add test_shared_disk_windows_migration config section with VM specs and migrateSharedDisks overrides
utilities/vmware_guest_operations.py Move exit code check after output retrieval so error messages include command output
libs/providers/vmware.py Add find_shared_vmdk_paths() public method wrapping internal VMDK detection
AGENTS.md Document 7-step Windows shared-disk pattern and add migrate_shared_disks to VM config table

Summary by CodeRabbit

  • New Features
    • Added NTFS label–based, end-to-end “cold” shared-disk migration verification for Windows VMs, with marker exchange validation.
    • Expanded shared-disk migration tests to cover multiple Windows VMs with per-VM shared-disk toggling.
  • Bug Fixes
    • Improved guest command error reporting by including captured guest output.
    • Improved SSH port-forward setup failures with a dedicated setup error.
  • Refactor / Tests
    • Unified shared-disk verification flow across Linux and Windows and improved VMware detection of shared VMDKs.
    • Added a new Windows shared-disk migration test case and associated configuration/coverage.
  • Documentation
    • Updated shared-disk test guidance and added the shared_disk pytest marker in the README.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@MiriSafra, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c539dfac-6b9d-49cf-8953-a777fc37cc54

📥 Commits

Reviewing files that changed from the base of the PR and between 094b398 and d0df355.

📒 Files selected for processing (9)
  • AGENTS.md
  • README.md
  • exceptions/exceptions.py
  • libs/providers/vmware.py
  • tests/shared_disk/test_shared_disk_windows_migration.py
  • tests/tests_config/config.py
  • utilities/shared_disk.py
  • utilities/ssh_utils.py
  • utilities/vmware_guest_operations.py

Walkthrough

Adds Windows shared-disk migration coverage with source-side NTFS labeling, shared-disk verification helpers, a new migration plan test, and supporting config, error, and documentation updates.

Changes

Windows Shared Disk Migration

Layer / File(s) Summary
Test config and class declaration
AGENTS.md, README.md, tests/tests_config/config.py, tests/shared_disk/test_shared_disk_windows_migration.py
Adds the Windows shared-disk plan parameters, marker guidance, and the pytest class, imports, markers, and class-level resource storage for the migration flow.
Source labeling and guest command support
libs/providers/vmware.py, exceptions/exceptions.py, utilities/ssh_utils.py, utilities/shared_disk.py, utilities/vmware_guest_operations.py
Adds shared-VMDK path lookup, Windows shared-disk labeling, SSH setup error handling, and VMware guest command output handling used before migration.
Migration plan setup and execution
tests/shared_disk/test_shared_disk_windows_migration.py
Labels the shared disk on the source Windows VM, creates storage and network maps, builds the MTV plan with shared-disk settings, and executes the migration.
Windows verification and post-checks
tests/shared_disk/test_shared_disk_windows_migration.py, utilities/shared_disk.py
Adds shared-disk verification setup reuse, Windows volume-label discovery and marker exchange helpers, the retrying verification flow, and the final migrated-VM checks.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: krcmarik, solenoci, myakove

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: a new Windows shared disk migration test.
Docstring Coverage ✅ Passed Docstring coverage is 96.97% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@redhat-qe-bot

Copy link
Copy Markdown

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: Disabled for this repository
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: All label categories are enabled (default configuration)

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message
  • /security-override - Set security check runs to pass (maintainers only)
  • /security-override cancel - Re-run security checks

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3
  • /cherry-pick-retry <branch> - Retry a failed cherry-pick (merged PRs only)

Branch Management

  • /rebase - Rebase this PR branch onto its base branch

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. Status Checks: All required status checks must pass
  3. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  4. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • krcmarik
  • myakove
  • solenoci

Reviewers:

  • krcmarik
  • myakove
  • solenoci
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge
AI Features
  • Conventional Title: Mode: fix (claude/claude-opus-4-6[1m])
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])
  • Test Oracle: Triggers: approved (cursor/gpt-5.4-xhigh-fast); /test-oracle can be used anytime
Security Checks
  • Suspicious Path Detection: Monitors paths: .claude/, .vscode/, .cursor/, .devcontainer/, .pi/, .github/workflows/, .github/actions/
  • Committer Identity Check: Verifies last committer matches PR author
  • Mandatory: Security checks block merge (use /security-override to bypass — maintainers only)

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@utilities/shared_disk.py`:
- Around line 462-465: The PowerShell command in the `_win_run_powershell` call
uses single-quoted strings for both `path` and `content` parameters, which will
break if either value contains a single quote character. Replace the
single-quoted strings with properly escaped double-quoted strings or use
PowerShell variable substitution to safely handle special characters.
Specifically, modify the f-string passed to `_win_run_powershell` in the
Set-Content command to escape any double-quotes or single-quotes in the
`content` and `path` variables, or consider using PowerShell's `-replace`
operator to safely construct the command string.
- Line 416: The raise statement with GuestCommandError("{vm_label}: SHARED
volume not found") at line 416 is unreachable dead code. The TimeoutSampler loop
either returns successfully when a valid sample is found or raises
TimeoutExpiredError which is caught and re-raised, meaning the loop never
completes naturally. Remove this unreachable raise statement entirely to clean
up the code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 15b842be-b76a-402d-ad8d-4a3ee4d60b1a

📥 Commits

Reviewing files that changed from the base of the PR and between 9c64122 and 718fefc.

📒 Files selected for processing (3)
  • tests/shared_disk/test_shared_disk_windows_migration.py
  • tests/tests_config/config.py
  • utilities/shared_disk.py

Comment thread utilities/shared_disk.py Resolved
Comment thread utilities/shared_disk.py Resolved
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 18, 2026
@MiriSafra

Copy link
Copy Markdown
Member Author

/verified

@myakove myakove left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code Review

Found 7 issue(s) in this PR:

💡 Suggestions (7)

File Line Issue
utilities/shared_disk.py 472 [CRITICAL] AGENTS.md not updated for Windows shared-disk variant.
utilities/shared_disk.py 498 [WARNING] Significant preamble duplication with verify_shared_disk_data()
utilities/shared_disk.py 467 [WARNING] PowerShell command injection risk via single-quote breakout.
utilities/shared_disk.py 451 [WARNING] No write flush/sync after Set-Content on shared disk.
utilities/shared_disk.py 507 [WARNING] _get_shared_disk_devices() return value silently discarded.
utilities/shared_disk.py 401 [WARNING] drive_letter = "" is dead initialization.
tests/shared_disk/test_shared_disk_windows_migration.py 36 [SUGGESTION] shared_disk and vsphere markers are used here but not liste

Review generated by pi

Comment thread utilities/shared_disk.py Resolved
Comment thread utilities/shared_disk.py Resolved
Comment thread utilities/shared_disk.py Resolved
Comment thread utilities/shared_disk.py Resolved
Comment thread utilities/shared_disk.py Resolved
Comment thread utilities/shared_disk.py Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants