crc
crc copied to clipboard
Add libhvee as alternative Hyper-V driver on Windows
Fixes #3811
Basic functionality for:
- create
- start
- stop
- delete
[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.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
rebase broke the build:
Error: pkg\crc\preflight\preflight_checks_windows.go:14:2: cannot find package "." in:
D:\a\crc\crc\vendor\github.com\crc-org\crc\pkg\crc\constants
Error: pkg\crc\machine\driver_windows.go:7:2: cannot find package "." in:
D:\a\crc\crc\vendor\github.com\crc-org\crc\pkg\crc\machine\config
Error: pkg\crc\machine\driver_windows.go:8:2: cannot find package "." in:
D:\a\crc\crc\vendor\github.com\crc-org\crc\pkg\crc\machine\libhvee
Error: pkg\crc\machine\driver_windows.go:9:2: cannot find package "." in:
D:\a\crc\crc\vendor\github.com\crc-org\crc\pkg\drivers\libhvee
Error: pkg\crc\machine\driver_windows.go:10:2: cannot find package "." in:
D:\a\crc\crc\vendor\github.com\crc-org\crc\pkg\libmachine
Error: pkg\crc\machine\driver_windows.go:11:2: cannot find package "." in:
D:\a\crc\crc\vendor\github.com\crc-org\crc\pkg\libmachine\host
and for my local build I get:
go: finding module for package github.com/crc-org/crc/pkg/crc/constants
go: finding module for package github.com/crc-org/crc/pkg/crc/machine/config
go: finding module for package github.com/crc-org/crc/pkg/libmachine
go: finding module for package github.com/crc-org/crc/pkg/drivers/libhvee
go: finding module for package github.com/crc-org/crc/pkg/libmachine/host
go: finding module for package github.com/crc-org/crc/pkg/crc/machine/libhvee
pkg/crc/preflight/preflight_checks_windows.go:14:2: cannot query module due to -mod=vendor
(Go version in go.mod is at least 1.14 and vendor directory exists.)
pkg/crc/machine/driver_windows.go:7:2: cannot query module due to -mod=vendor
(Go version in go.mod is at least 1.14 and vendor directory exists.)
pkg/crc/machine/driver_windows.go:8:2: cannot query module due to -mod=vendor
(Go version in go.mod is at least 1.14 and vendor directory exists.)
pkg/crc/machine/driver_windows.go:9:2: cannot query module due to -mod=vendor
(Go version in go.mod is at least 1.14 and vendor directory exists.)
pkg/crc/machine/driver_windows.go:10:2: cannot query module due to -mod=vendor
(Go version in go.mod is at least 1.14 and vendor directory exists.)
pkg/crc/machine/driver_windows.go:11:2: cannot query module due to -mod=vendor
(Go version in go.mod is at least 1.14 and vendor directory exists.)
make: *** [Makefile:105: out/windows-amd64/crc.exe] Error 1
Not sure what the problem is
$ make vendor
go: github.com/crc-org/crc/v2/pkg/crc/machine imports
github.com/crc-org/crc/pkg/crc/machine/config: github.com/crc-org/[email protected]: parsing go.mod:
module declares its path as: github.com/code-ready/crc
but was required as: github.com/crc-org/crc
make: *** [Makefile:79: vendor] Error 1
???
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
Want to incorporate 9P, but the current codebase for this lives in the PR https://github.com/containers/gvisor-tap-vsock/pull/280
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 https://github.com/mheon/libpod/commit/334e213662adcd71097df07e1090db53c03d15f7
@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?
ref: #3870
This PR needs https://github.com/containers/libhvee/pull/66
Rebased again, and added support for disk resize in https://github.com/cfergeau/crc/tree/libhvee (untested) Seeing that the branch is in github.com/crc-org, I'll just force push to it instead of keeping my own branch.
Rebasing... (experienced weird issues with branch but should be resolved now)
This is still WIP, but I've tested that this works, including disk resize. The 9p code needs more work which is described in the relevant commit log.
Given https://github.com/crc-org/crc/issues/3870#issuecomment-2074870282 , I'd punt 9p support for now and work on merging the libhvee code with no changes to the file sharing code.
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.
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)
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?
Originally the PR removed it, but part of it is there... just never tested. Note: we have no automated tests for this :-s.
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
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..
from hyperv driver
@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?
/me tested and concludes: "works as expected"
Everlasting rebasing
Everlasting rebasing
Rebase done.
@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 | 3def9609c0d728890e5c1367cbdf1a3ccf5aa9de | link | false | /test security |
| ci/prow/integration-crc | 3def9609c0d728890e5c1367cbdf1a3ccf5aa9de | link | true | /test integration-crc |
| ci/prow/e2e-crc | 3def9609c0d728890e5c1367cbdf1a3ccf5aa9de | link | true | /test e2e-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.