Skip to content

Conversation

@neerajdixit-msft2
Copy link
Member

@neerajdixit-msft2 neerajdixit-msft2 commented Dec 9, 2025

This PR addresses the following bugs:

Testing

  • Validated the scenario by reconnecting VM with checkpoint
  • MOC cicd will run the hydration specific tests

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses three bugs related to VM reconnection and disk hydration in the Hyper-V virtualization layer. The key changes improve path comparison for VHD detection and add support for reading the disk type (dynamic vs. fixed) from WMI disk settings.

  • Improved path comparison to handle case-insensitive and cross-platform path matching
  • Added ability to detect whether a disk is dynamic or fixed from WMI settings
  • Updated tests to verify the new dynamic flag functionality

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
pkg/virtualization/core/virtualsystem/virtualmachine.go Enhanced path comparison in GetVirtualHardDiskByPath to use case-insensitive matching with filepath.Clean and strings.ToLower
pkg/virtualization/core/storage/disk/virtualharddisksettingdata.go Added VirtualHardDiskTypeSetting enum and logic to parse disk Type field from XML to determine if disk is dynamic
pkg/virtualization/core/storage/service/ImageManagementService.go Updated GetVirtualHardDiskConfig signature to return the dynamic boolean flag
pkg/virtualization/core/storage/service/ImageManagementService_test.go Extended test to capture and verify the new dynamic flag return value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

yujiaucr
yujiaucr previously approved these changes Dec 9, 2025
@neerajdixit-msft2
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@neerajdixit-msft2
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yujiaucr yujiaucr merged commit 291d270 into master Dec 12, 2025
5 checks passed
@neerajdixit-msft2 neerajdixit-msft2 deleted the users/ndixit/ReconnectFixes branch December 12, 2025 22:42
neerajdixit-msft2 pushed a commit that referenced this pull request Dec 12, 2025
neerajdixit-msft2 added a commit that referenced this pull request Dec 13, 2025
)

Fixes for VM reconnect

Co-authored-by: Jia Yu <jiyu3@microsoft.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.

4 participants