robur-coop / albatross

Albatross: orchestrate and manage MirageOS unikernels with Solo5
ISC License
142 stars 17 forks source link

support other VM types #54

Open hannesm opened 3 years ago

hannesm commented 3 years ago

the console output and statistics gathering is so useful that it'd be great (esp. with #53) to support other virtual machines to be started. for my own use, this would be: bhyve (both FreeBSD native and linux ones).

the semantics would be quite different since these virtual machines won't fit into a X.509 certificate -- instead the block device(s) should already exist and contain the operating system. some additional notes:

bhyve virtual machine:
- name
- #cpus
- #memory
- bridges
- block devices (not necessarily maintained by albatross)
- bhyveload or grub2-bhyve?
  - former: nothing more
  - latter: boot thingy (hd0, msdos1) -- and map "(hd0) /dev/zvol/data/mx"

--> cpu in bhyve now (no need for cpuset):
  -c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]
  and -p vcpu:hostcpu

exit codes:
     0       rebooted
     1       powered off
     2       halted
     3       triple fault
     4       exited due to an error
~> a bit different from solo5 (but just executing bhyve prints help and returns 1 :/)

-> generate:
bhyveload -c stdio -m <mem> -d <boot=first-block> <name>
OR
grub-bhyve -m <map> -r hd0,msdos1 -M <mem> <name>
 (with hd0 and msdos1 hardcoded, and <map> written as (hd0) <first-block-device>)

the :0 is superfluous (the default)
tapN,mac=xx:xx:xx:xx:xx:xx

bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc
  -s <n>:0,virtio-net,tapN
  -s <m>:0,virtio-blk,/dev/zvol/data/block
  -l com1,stdio -c <#cpu> -m <mem> <name>