metal-stack / mini-lab

a small, virtual setup to locally run the metal-stack
MIT License
57 stars 13 forks source link

Probably cloud-hypervisor is more modern than qemu and is more suitable for our job #85

Open majst01 opened 2 years ago

majst01 commented 2 years ago

Especially configuring the network is much easier than with qemu: https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/networking.md

simple API is also available:

https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/api.md

curl --unix-socket /tmp/cloud-hypervisor.sock -i \
     -X PUT 'http://localhost/api/v1/vm.create'  \
     -H 'Accept: application/json'               \
     -H 'Content-Type: application/json'         \
     -d '{
         "cpus":{"boot_vcpus": 4, "max_vcpus": 4},
         "kernel":{"path":"/opt/clh/kernel/vmlinux-virtio-fs-virtio-iommu"},
         "cmdline":{"args":"console=ttyS0 console=hvc0 root=/dev/vda1 rw"},
         "disks":[{"path":"/opt/clh/images/focal-server-cloudimg-amd64.raw"}],
         "rng":{"src":"/dev/urandom"},
         "net":[{"ip":"192.168.10.10", "mask":"255.255.255.0", "mac":"12:34:56:78:90:01"}]
         }'
GrigoriyMikhalkin commented 2 years ago

@majst01 Does it support PXE booting? I didn't find any info on that.

It's built on rust-vmm, same as firecracker. So very high probability that it doesn't. Also, judging by documentation, it's indeed kind of similar to firecracker: https://github.com/cloud-hypervisor/cloud-hypervisor#custom-kernel-and-disk-image

majst01 commented 2 years ago

@majst01 Does it support PXE booting? I didn't find any info on that.

It's built on rust-vmm, same as firecracker. So very high probability that it doesn't. Also, judging by documentation, it's indeed kind of similar to firecracker: https://github.com/cloud-hypervisor/cloud-hypervisor#custom-kernel-and-disk-image

Didn't try yet, but according to https://github.com/cloud-hypervisor/cloud-hypervisor/blob/25ed8722c7b49880c25123a434837a3a92e5f2df/docs/uefi.md there is a Seabios branch. Will try !