Use WMI/MI to interact with Hyper-V instead of PowerShell #2958
Labels
Area-Environments
Area-Environments-Hyper-V-Extension
For issues, features requests and bugs related to the Hyper-V Extension in Dev Home
Issue-Feature
New feature or request
Needs-Triage
New issue that the core contributors need to triage
Type-Performance
Related to performance
Suggested new feature or improvement
Currently the Hyper-V extension uses PowerShell under the hood to interact with Hyper-V functionality. When using Hyper-V the time it takes to load the Hyper-V module on first load of environments isn't deterministic and can be affected by the users profile. In addition to this, we run into issues like: #2955 which is hard to repro and also after investigation looks to be user profile related and not machine related. Switching to WMI/MI will remove this issue and decrease the abstraction between the extension and the Hyper-V service by one level.
The Hyper-V manager in Windows for example also uses WMI under the hood. This will allow us to also be closer to on par with the Hyper-V manager. I've tested retrieving VMs using WMI and it is a lot faster. The only negative of WMI is that it takes more code, however our goal of increasing speed is more important.
Scenario
The retrieval of Hyper-V VMs is faster when navigating to the environments page or the setup environment page. Decreasing the time it takes to load Hyper-V VMs on those pages.
Additional details
No response
The text was updated successfully, but these errors were encountered: