-
Notifications
You must be signed in to change notification settings - Fork 61
Use WMI to implement Volume API to reduce PowerShell overhead #360
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
base: master
Are you sure you want to change the base?
Conversation
Welcome @laozc! |
Hi @laozc. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
thanks for the PR. @laozc have you tested the WMI based operation manually? does it work? |
Yes. I verified it in my local environment and they work the same as PowerShell commands. |
/cc @andyzhangx @mauriciopoppe |
7ee9449
to
c55b906
Compare
The commit which contains all API changes in the same PR was 6986e59 |
I believe we could safely remove the constraint to stick with Go 1.22 with this change.
This method uses Windows API calls to determine whether the path is a mounted path instead of relying on the Go API behavior. |
3024353
to
355a96a
Compare
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments.
d878563
to
c5b7070
Compare
Hey @andyzhangx, would it be possible for you to review the PR please? Maybe you have experience with the |
"github.com/microsoft/wmi/pkg/base/query" | ||
"github.com/microsoft/wmi/pkg/errors" | ||
cim "github.com/microsoft/wmi/pkg/wmiinstance" | ||
"github.com/microsoft/wmi/server2019/root/microsoft/windows/storage" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this relies on specific server version, does it work on server 2022 and 2025?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always tested on Windows Server 22H2 with this API.
I don't think it would break as long as the new feature introduced in newer API is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
I will try this PR on Azure CSI driver first to make sure it works on common Windows server versions.
@laozc I tries to copy the cim folder into my Azure Disk CSI driver repo (for test): https://github.com/kubernetes-sigs/azuredisk-csi-driver/compare/master...andyzhangx:azuredisk-csi-driver:cim?expand=1, but I got following error, have you hit similar error in your CSI driver? https://github.com/andyzhangx/azuredisk-csi-driver/actions/runs/14463170910/job/40559504163
|
Hi, these Go files in You may either
to each file in this package so the test coverage is skipped for these files on Linux. |
I could add build constraints to these codes if the downstream projects need.
|
yes, that's necessary, and pls also add header, you could refer to |
/kind feature
What this PR does / why we need it:
This PR leverages of WMI interfaces to replace the PowerShell functions for Windows related storage operations,
which improve the overall performance of csi-proxy.
Which issue(s) this PR fixes:
Fixes #193
Special notes for your reviewer:
Does this PR introduce a user-facing change?: