-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: cloud-hypervisor support #609
feat: cloud-hypervisor support #609
Conversation
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.
First pass looks good so far.
Is you linter on? Mine lit up quite a bit on lots of little things.
You may have to wait until after xmas for a more indepth review 😉
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #609 +/- ##
==========================================
+ Coverage 56.29% 58.18% +1.89%
==========================================
Files 57 56 -1
Lines 2780 2705 -75
==========================================
+ Hits 1565 1574 +9
+ Misses 1071 985 -86
- Partials 144 146 +2
☔ View full report in Codecov by Sentry. |
41ec1d1
to
3182c97
Compare
Starting to run this myself and something is not obvious looking at the code: How do I make CH the default? Looks like providers are recognised as "supported" by the presence of their bin names in the flintlock Also do we verify that the bins exist on PATH before calling them? (I would assume we do but I cannot find it). |
Oh also should we log at start saying which providers are enabled? And which is the default? Can we also have log lines which say which provider is being used for a specific microvm? I am having a hard time seeing which is being picked up. Right now there is a field in some logs, |
Hah just spotted the |
Okay I got a mvm started, but the network is not all there:
Is there anything obvious I am missing before I start digging? I remember something about the metadata volume? I forget whether we are mounting that in by default or if I need to add it? Do you have any example config from where you tested it? |
Will try and get comments sorted today. |
I just tried it again this morning and i can create a vm that uses macvtap to connect to my network:
I use fl to make the requests, and specifically the version from this PR. The command i use is: fl microvm create --host 127.0.0.1:9090 --name chtest --kernel-image ghcr.io/weaveworks-liquidmetal/flintlock-kernel-cloudhypervisor:5.12 --kernel-filename boot/vmlinux.bin --metadata-hostname chtest --network-interface eth1:macvtap --root-image ghcr.io/weaveworks-liquidmetal/capmvm-kubernetes-cloudhypervisor:1.23.5 --metadata-ssh-key-file ./test_rsa.pub |
👀 cool, will have another crack with that |
3934047
to
b53e475
Compare
Managed to get it to work this time 🎉 (on the second attempt in which I actually installed cloudhypervisor 🤦♀️ ) For posterity here is what I did:
Last time i tried this it was using my new images, so i must have been the problem there |
@richardcase there are still a lot of
|
Tested with the new images and all good 🎉 liquidmetal-dev/image-builder#55 (turns out i was missing a mac address originally) |
arg := fmt.Sprintf("fd=%d,mac=", fd) | ||
if netInt.GuestMAC != "" { | ||
arg = arg + netInt.GuestMAC | ||
} |
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.
A thing to note here is that we are not defaulting the mac address to the host mac in the case that GuestMac
is not set. This is what we do in firecracker: https://github.com/weaveworks-liquidmetal/flintlock/blob/main/infrastructure/firecracker/config.go#L184-L192
Do we want to maintain similar behaviour here? It took me a moment or 2 to figure out what i was missing from my usual spec on a failed mvm.
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 need reacquaint myself why i did this, i vaguely remember there was a reason for changing this
Another thing which would be useful is to write the config which the CH process ends up using somewhere, if that's possible? it does end up in (could be left to follow-up pr) |
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.
overall lgtm, the only blocker I see (apart from a few string replacements from @Callisto13's review) is the --net
flag in case it goes wild.
We don't have a config file for configuring the microvm like we do for firecracker. Instead its all command line args. We do use files for cloud-init and these are in the disk. We could write a config file to disk and then create the CH args from the config file, this is what i originally did with the firecracker provider. wdyt? |
@Callisto13 @yitsushi - thanks for the reviews. I have made changes, the only outstanding comments are around defaulting the mac address and also the config file (i think we could follow up on the config file post merge). |
7500a56
to
abf8c0c
Compare
} else if iface.Type == models.IfaceTypeTap { | ||
args = append(args, fmt.Sprintf("tap=%s,mac=%s", status.HostDeviceName, iface.GuestMAC)) | ||
} else { | ||
logger.Warn("unknown network interface type", "name", iface.GuestDeviceName, "type", iface.Type) |
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.
It will still end up with a command where the outcome is not predictable as the next parameter (if there's any) will be used as "dev" argument.
cmd --api-socket /foo --log-file /bar -v --net --other baz
In this case it will just cry "--net" has no argument but it's expected OR it will try to use --other
as argument and will cry "i don't know what to do with baz".
Yeh I know, I was thinking it would just be a handy thing for us when debugging.
Yeh that might be good. Either thing can wait until another PR tho |
@Callisto13 @yitsushi - i will try to get the last of the comments sorted today on this. |
Flintlock will default to Firecracker for creating microvms but you can: - change the default to Cloud Hypervisor when starting Flintlock - specify on a per VM basis whether to use Firecracker or Cloud Hypervisor A couple of things to note: - Cloud Hypervisor supports macvtap so you don't have to use the Weaveworks fork - Cloud Hypervisor doesn't have a metadata service so you need to find another solution if you rely on this. For cloud-init we attach an additional volume. - Cloud Hypervisor supports pci-passtrhough, vDPA etc. These features aren't currently exposed via the API but they will be in the future. Signed-off-by: Richard Case <richard.case@outlook.com>
Signed-off-by: Richard Case <richard.case@outlook.com>
Signed-off-by: Richard Case <richard.case@outlook.com>
55149e5
to
af74aac
Compare
I think this is good to go, i made the change based on feedback from @yitsushi |
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.
LGTM
What this PR does / why we need it:
Flintlock will default to Firecracker for creating microvms but you can:
A couple of things to note:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #417
Special notes for your reviewer:
Checklist: