Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HyperV2012R2+] Fix Job Loss During Disk Manipulation by Transitioning to WMI-Based Implementation #221

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

berkut1
Copy link
Contributor

@berkut1 berkut1 commented Jan 10, 2025

Description

This PR fix this issue #146
After extensive testing, I discovered that we cannot guarantee that the Job ID created via PowerShell will be preserved. However, during these tests, it was confirmed that WMI always detects these Jobs, regardless of which PowerShell session created them. The issue was that PowerShell would assign different identification values to tasks than those seen by WMI. As a result, the only solution was to rewrite the problematic commands using a native WMI implementation.

I kept the option to execute tasks (for example, for custom scripts) asynchronously via PowerShell, but I strongly advise against using it (especially for heavy tasks) unless it cannot be implemented through WMI. This ensures that the issue described in #146 does not occur again.

The code has been tested, but additional verification is needed to ensure that Remote Hyper-V works correctly. It's enough to try creating or reinstalling a server.

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