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

Add libhvee as alternative Hyper-V driver on Windows #3824

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gbraad
Copy link
Contributor

@gbraad gbraad commented Sep 6, 2023

Fixes #3811

Basic functionality for:

  • create
  • start
  • stop
  • delete

@openshift-ci
Copy link

openshift-ci bot commented Sep 6, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from gbraad. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@gbraad gbraad force-pushed the gbraad/spike-add-libhvee-as-alternative-3811 branch 6 times, most recently from 9c10def to 2e72ce2 Compare September 11, 2023 06:51
@gbraad gbraad changed the title [WIP] fixes #3811 add libhvee as alternative Hyper-V driver on Windows Add libhvee as alternative Hyper-V driver on Windows Sep 11, 2023
@gbraad gbraad force-pushed the gbraad/spike-add-libhvee-as-alternative-3811 branch from 0a919ec to 6013d5f Compare September 13, 2023 06:54
@gbraad

This comment was marked as outdated.

@adrianriobo
Copy link
Contributor

adrianriobo commented Oct 5, 2023

These are the results for this PR on windows https://crcqe-asia.s3.amazonaws.com/nightly/ocp/4.13.12/20231005/11-pro/qe-results/e2e-non-ux.xml all green except the known issue with the latest version for the pipelines operator

@gbraad
Copy link
Contributor Author

gbraad commented Oct 6, 2023

Want to incorporate 9P, but the current codebase for this lives in the PR containers/gvisor-tap-vsock#280

@cfergeau
Copy link
Contributor

cfergeau commented Oct 6, 2023

Want to incorporate 9P, but the current codebase for this lives in the PR containers/gvisor-tap-vsock#280

The code from this gvisor-tap-vsock PR is short, and thus easy to add to the daemon when we need it. But there's also some guest code involved, which might be trickier mheon/libpod@334e213

@gbraad
Copy link
Contributor Author

gbraad commented Oct 6, 2023

@cfergeau it basically is the same/similar code as the 9p-ufs that I tested with earlier, so I am not so concerned. I am more curious if this will therefore be part of a library, or the changes for libpod remain seperate?

@gbraad
Copy link
Contributor Author

gbraad commented Oct 17, 2023

ref: #3870

Copy link
Contributor

@cfergeau cfergeau left a comment

Choose a reason for hiding this comment

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

I've rebased this and squashed the commits in https://github.com/cfergeau/crc/tree/libhvee
This looks like a fairly straightforward change, though I haven't tried running it on a Windows machine :)

@@ -166,19 +165,6 @@ func fixUserPartOfCrcUsersAndHypervAdminsGroup() error {
return errReboot
}

func checkIfHyperVVirtualSwitchExists() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Fwiw, it would be good to split the system mode networking removal on Windows in its own preparatory commit, this would make it easier to focus on/review the config/preflight changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly, I do not even know if this functionality still works. I'll consider, but these checks are also performed when not even necessary (like the existence of the virtual switch) and therefore actually wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've done this in https://github.com/cfergeau/crc/tree/libhvee, this removes even more code

pkg/drivers/libhvee/libhvee_windows.go Show resolved Hide resolved
pkg/drivers/libhvee/libhvee_windows.go Show resolved Hide resolved
pkg/drivers/libhvee/libhvee_windows.go Outdated Show resolved Hide resolved
pkg/drivers/libhvee/libhvee_windows.go Show resolved Hide resolved
pkg/drivers/libhvee/libhvee_windows.go Outdated Show resolved Hide resolved
pkg/drivers/libhvee/libhvee_windows.go Outdated Show resolved Hide resolved
@cfergeau cfergeau closed this May 15, 2024
@cfergeau cfergeau deleted the gbraad/spike-add-libhvee-as-alternative-3811 branch May 15, 2024 08:28
@cfergeau cfergeau restored the gbraad/spike-add-libhvee-as-alternative-3811 branch May 15, 2024 08:29
@cfergeau cfergeau reopened this May 15, 2024
@cfergeau cfergeau force-pushed the gbraad/spike-add-libhvee-as-alternative-3811 branch from a9c936a to 6321f26 Compare May 15, 2024 08:29
@cfergeau
Copy link
Contributor

Given #3870 (comment) , I'd punt 9p support for now and work on merging the libhvee code with no changes to the file sharing code.

Maybe we need to use https://github.com/aperezdc/9pfuse?tab=readme-ov-file or something similar.

@gbraad
Copy link
Contributor Author

gbraad commented May 15, 2024

work on merging the libhvee code with no changes to the file sharing code.

Do you mean to target SMB or leave as in the current PR (no support)

@cfergeau
Copy link
Contributor

work on merging the libhvee code with no changes to the file sharing code.

Do you mean to target SMB or leave as in the current PR (no support)

Ideally, use the same SMB support as what we have now. I haven't checked if this PR removes some SMB support, but hopefully it's still there?

@gbraad
Copy link
Contributor Author

gbraad commented May 15, 2024

Originally the PR removed it, but part of it is there... just never tested. Note: we have no automated tests for this :-s.

@anjannath
Copy link
Member

Tested this PR on windows and the SMB based file sharing and it is working as expected, have to use the windows MSI installer, then the following config options needs to be set before crc start

$ crc config set host-network-access true
$ crc config set shared-dir-password <login_user_pass>
$ crc config set enable-shared-dir true

@anjannath
Copy link
Member

While testing i also noticed that error messages from the libhvee driver is a bit concise than the older hyperv driver, e.g

from libhvee..

Screenshot_win11_2024-05-21_14:26:15


from hyperv driver

Screenshot_win11_2024-05-21_14:44:07

@gbraad
Copy link
Contributor Author

gbraad commented May 29, 2024

@anjannath this is a side effect of the WMI use. The powershell interface is more verbose, though also not always right. When WMI is used, you only get return codes back from the 'queries' and 'requests' that are performed. This would need to be a refinement in the libhvee library. Perhaps file an issue upstream for this?

@gbraad
Copy link
Contributor Author

gbraad commented May 29, 2024

/me tested and concludes: "works as expected"

Should return an error when trying to set the "system networking"
option. But I think this is already the case, or it's not possible to
choose this option in release builds?

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
@gbraad gbraad force-pushed the gbraad/spike-add-libhvee-as-alternative-3811 branch from 6321f26 to 394e34e Compare May 29, 2024 04:56
@gbraad gbraad changed the title [WIP] Add libhvee as alternative Hyper-V driver on Windows Add libhvee as alternative Hyper-V driver on Windows May 29, 2024
gbraad and others added 2 commits May 29, 2024 11:47
This replaces the interaction of Hyper-V from our machine-drivers based
driver as used in Minikube/minishift to the libhvee library as used by
podman machine.
Disk handling API was added to libhvee since the first iteration of the
libhvee support, we can now make use of it.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
@cfergeau cfergeau force-pushed the gbraad/spike-add-libhvee-as-alternative-3811 branch from 394e34e to 0a0ad63 Compare May 29, 2024 10:36
Copy link

openshift-ci bot commented May 29, 2024

@gbraad: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security 0a0ad63 link false /test security
ci/prow/integration-crc 0a0ad63 link true /test integration-crc

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

[Spike] Add libhvee as alternative driver for accessing Hyper-V
5 participants