Hi Alice,
On Tue, 2022-06-14 at 10:25 +0200, Alice Frosi wrote:
> Hi Sebastien,
>
> below is how I'd start
>
> On Mon, Jun 13, 2022 at 1:00 PM Boeuf, Sebastien
> <
sebasti...@intel.com> wrote:
> > Hi everyone,
> >
> > I'm reaching out because I'm looking for feedback about the best
> > approach for integrating Cloud Hypervisor (VMM written in Rust)
> > with
> > KubeVirt.
> >
> > Currently, KubeVirt supports QEMU because QEMU is integrated with
> > libvirt and KubeVirt relies on libvirt for managing VMs. But since
> > libvirt is very much QEMU oriented, and since libvirt adds yet
> > another
> > layer of indirection, I was wondering if there would be a way to
> > integrate Cloud Hypervisor directly with KubeVirt, based on an
> > existing
> > interface (or by creating a new one if needed).
> >
>
>
> It is true that libvirt adds another layer of indirection but it
> makes it easier to interact with the VM. Virt-launcher uses the
> libvirt go binding and strongly relies on this to manage the VM. Does
> cloud hypervisor support an interface that can be easily integrated
> with go?
Cloud Hypervisor can be reached through a UNIX socket, sending HTTP
requests to manage the lifecycle of the VM. It shouldn't be too hard to
implement a small package to build HTTP request and send them over
(Kata Containers already does that for instance).
>
> I'd suggest you concentrate on the virt-launcher part, especially in
> the virtwrap part [1] and a good interface to start with is
> the DomainManager [2].
Looking at the code I reached the same conclusion, except that I feel
it might be easier to replace the virt-launcher entirely. The
DomainManager interface that you're pointing at is a mirror of the
CmdServer interface being served by the gRPC server. And by replacing
the binary entirely, I will be able to prototype faster since I won't
have to deal with libvirt specific things that might get in the way.
>
> What are your bare-minimal working example and features?
I was thinking it'd be nice if I could run a VM and access it with
console access (pty). Networking is always more complicated so if I
can avoid it at first that'd be good.
>
> IMO, another important part of virt-launcher is the monitoring of the
> VM events and errors. Do you have something similar for
> cloud hypervisors? This part is covered in the send domain event [3]
> and the interfaces between virt-handler and virt-launcher is defined
> in the proto files in [4].
Cloud Hypervisor has the ability to report certain type of events,
reporting these through a file. I could have virt-launcher relying on
inotify to know when the file is being updated (therefore when new
events are received), so that we could provide a similar mechanism to
the one that exist with libvirt.
>
> The last thing, we use bazel to build the container images, but I
> don't think it is easy to quickly modify the image for experimenting.
> So. you need a way to overwrite the virt-launcher image with your
> custom one. You could overwrite the sha of the virt-launcher image in
> [5] to point to your custom virt-launcher image. If you use the
> kubevirt development k8s cluster (with make cluster-up), you can push
> your custom image in the local registry by finding the port with:
> registry_port=$(docker port k8s-1.21-dnsmasq 5000 |grep :: | sed
> 's/://g')
> and the tagging and push your custom image with:
> docker tag virt-launcher-custom localhost:$registry_port/virt-
> launcher:devel
>
> This is just one way of doing it.
Thanks for the explanation :)
Sebastien