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 Windows HyperV container mode #1848

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

dardelean
Copy link

Signed-off-by: Dan Ardelean dardelean@cloudbasesolutions.com

Implements 519

@AkihiroSuda AkihiroSuda added this to the v1.2.0 milestone Jan 13, 2023
@AkihiroSuda AkihiroSuda added the platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2) label Jan 13, 2023
@jsturtevant
Copy link
Contributor

Code changes look fine to me.

I was expecting we would need to turn on nested_virtualization in the cirrus configuration to get this to work (#795 (comment)) as well as bump containerd version to 1.7+ (

ctrdVersion: 1.6.12
) as hyper-v support was only recently enabled in containerd.

@dcantah could you take a look at the test to see if that is the right check?

README.md Outdated Show resolved Hide resolved
cmd/nerdctl/run_windows.go Outdated Show resolved Hide resolved
@dcantah
Copy link
Member

dcantah commented Jan 14, 2023

as well as bump containerd version to 1.7+ (

We should be fine without 1.7 as we're manually toggling the hyper-v field. You'd need 1.7 for Hyper-V through CRI however 😬

@dcantah
Copy link
Member

dcantah commented Jan 16, 2023

Cc @kevpar

cmd/nerdctl/run_windows.go Outdated Show resolved Hide resolved
cmd/nerdctl/run_windows.go Outdated Show resolved Hide resolved
cmd/nerdctl/run_windows.go Outdated Show resolved Hide resolved
cmd/nerdctl/run_windows_test.go Outdated Show resolved Hide resolved
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

Signed-off-by: Dan Ardelean <dardelean@cloudbasesolutions.com>
@dardelean
Copy link
Author

I had a merge conflict with #1880 and I had to rebase.

isolation, err := cmd.Flags().GetString("isolation")
if err != nil {
return nil, err
}
switch isolation {
case "hyperv":
if memStr != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there defaults (are those in the runtime config?)

Copy link
Member

Choose a reason for hiding this comment

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

Related, if no default was supplied I'm forgetting if the HCS v1 behavior was to expose the hosts cpu and memory size to the VM (if anyone wants to try this, otherwise I can report back tonight). With this change if you didn't supply any values the VM would have 2 cores and a similar low amount of ram. Could change this in a follow up though

@jsturtevant
Copy link
Contributor

lgtm

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 81247aa into containerd:main Jan 19, 2023
@dardelean dardelean deleted the feature/hyperv-containers branch January 19, 2023 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants