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

Using Get-CmiInstance to detect Hyper-V availability #13596

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

NikhilSharmaWe
Copy link
Member

@NikhilSharmaWe NikhilSharmaWe commented Feb 10, 2022

Replacing deprecated Get-Wmiobject with Get-CimInstance to detect Hyper-V availability.
Fixes #13571

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 10, 2022
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@medyagh
Copy link
Member

medyagh commented Feb 10, 2022

@spowelljr review plz

@@ -91,7 +91,7 @@ func status() registry.State {
ctx, cancel := context.WithTimeout(context.Background(), 8*time.Second)
defer cancel()

cmd := exec.CommandContext(ctx, path, "-NoProfile", "-NonInteractive", "@(Get-Wmiobject Win32_ComputerSystem).HypervisorPresent")
cmd := exec.CommandContext(ctx, path, "-NoProfile", "-NonInteractive", "@(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")
Copy link
Member

Choose a reason for hiding this comment

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

will this work on Old windows versions ?

how about we put the old way as Fail Over option ? if this fails lets try the old way (maybe someone with old windows) ?

Copy link
Member Author

@NikhilSharmaWe NikhilSharmaWe Feb 10, 2022

Choose a reason for hiding this comment

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

I think that will be a nice addition
Should add it and you can review the changes for further improvements ?

Copy link
Member

Choose a reason for hiding this comment

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

Any computer running Windows 7 or greater and Server 2008 SP2 and greater can AND should use PSRemoting instead of WMI. Cim has been supported for a very long time so I don't think we have to worry too much about having a fail over option. But I'm not against it either.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 10, 2022
@spowelljr
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 14, 2022
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13596) |
+----------------+----------+---------------------+
| minikube start | 45.2s    | 44.7s               |
| enable ingress | 29.5s    | 28.8s               |
+----------------+----------+---------------------+

Times for minikube start: 47.0s 44.7s 44.1s 44.9s 45.5s
Times for minikube (PR 13596) start: 43.9s 44.7s 44.5s 45.0s 45.5s

Times for minikube (PR 13596) ingress: 29.6s 26.1s 26.2s 31.6s 30.6s
Times for minikube ingress: 29.7s 30.6s 26.6s 31.1s 29.6s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13596) |
+----------------+----------+---------------------+
| minikube start | 27.2s    | 26.8s               |
| enable ingress | 24.7s    | 22.9s               |
+----------------+----------+---------------------+

Times for minikube start: 30.2s 26.6s 26.8s 26.1s 26.4s
Times for minikube (PR 13596) start: 26.4s 27.4s 26.1s 26.4s 27.7s

Times for minikube ingress: 22.9s 26.9s 24.4s 22.9s 26.4s
Times for minikube (PR 13596) ingress: 22.4s 22.4s 23.9s 22.9s 23.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13596) |
+----------------+----------+---------------------+
| minikube start | 42.6s    | 44.0s               |
| enable ingress | 26.3s    | 31.5s               |
+----------------+----------+---------------------+

Times for minikube start: 34.2s 45.2s 41.3s 46.1s 46.4s
Times for minikube (PR 13596) start: 42.0s 45.2s 41.9s 45.1s 45.5s

Times for minikube ingress: 20.9s 28.9s 33.9s 18.9s 28.9s
Times for minikube (PR 13596) ingress: 23.9s 20.9s 33.4s 49.9s 29.4s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
KVM_Linux TestPause/serial/Pause (gopogh) 3.85 (chart)
Docker_Windows TestStartStop/group/newest-cni/serial/EnableAddonAfterStop (gopogh) 5.06 (chart)
Docker_Windows TestStartStop/group/newest-cni/serial/Stop (gopogh) 5.06 (chart)
Docker_Windows TestStartStop/group/newest-cni/serial/FirstStart (gopogh) 6.33 (chart)
Hyperkit_macOS TestFunctional/serial/ComponentHealth (gopogh) 9.23 (chart)
Docker_Windows TestPause/serial/Pause (gopogh) 29.17 (chart)
Docker_Windows TestNetworkPlugins/group/enable-default-cni/Start (gopogh) 31.71 (chart)
Docker_Windows TestStartStop/group/embed-certs/serial/Pause (gopogh) 37.50 (chart)
Docker_Windows TestStartStop/group/newest-cni/serial/Pause (gopogh) 37.97 (chart)
Docker_Windows TestStartStop/group/old-k8s-version/serial/Pause (gopogh) 44.87 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/kindnet/DNS (gopogh) 48.84 (chart)
Docker_Windows TestNetworkPlugins/group/kindnet/Start (gopogh) 51.22 (chart)
Docker_macOS TestNetworkPlugins/group/custom-weave/Start (gopogh) 52.63 (chart)
Docker_Linux TestNetworkPlugins/group/kindnet/Start (gopogh) 57.98 (chart)
Docker_Windows TestNetworkPlugins/group/bridge/Start (gopogh) 59.76 (chart)
Docker_Linux TestNetworkPlugins/group/false/DNS (gopogh) 63.03 (chart)
Docker_Linux TestNetworkPlugins/group/calico/Start (gopogh) 64.71 (chart)
Docker_Windows TestNoKubernetes/serial/StartWithStopK8s (gopogh) 65.00 (chart)
Docker_Windows TestNetworkPlugins/group/kubenet/Start (gopogh) 67.07 (chart)
Docker_Windows TestNetworkPlugins/group/custom-weave/Start (gopogh) 69.51 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/calico/Start (gopogh) 72.83 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/enable-default-cni/DNS (gopogh) 74.16 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/bridge/DNS (gopogh) 76.67 (chart)
Docker_Windows TestNetworkPlugins/group/calico/Start (gopogh) 76.83 (chart)
Docker_Linux TestNetworkPlugins/group/enable-default-cni/DNS (gopogh) 84.87 (chart)
Docker_Windows TestAddons/parallel/MetricsServer (gopogh) 86.59 (chart)
Docker_Linux TestNetworkPlugins/group/bridge/DNS (gopogh) 88.24 (chart)
Docker_Linux TestNetworkPlugins/group/kubenet/DNS (gopogh) 88.24 (chart)
Docker_macOS TestDownloadOnly/v1.16.0/preload-exists (gopogh) 98.32 (chart)
Docker_Windows TestFunctional/parallel/TunnelCmd/serial/WaitService/IngressIP (gopogh) 100.00 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@sharifelgamal sharifelgamal merged commit 2222dd6 into kubernetes:master Feb 23, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: NikhilSharmaWe, sharifelgamal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Get-CimInstance to detect Hyper-V availability
7 participants