Parallel unikernel instances

Hi,

Is it possible to run multiple unikernels on the same machine and have a broadcast to all these unikernels?

One thing that I tried was to use DHCP server to allocate an IP address to unikernel. But I am not able to run more than one instance on the same host.

1 Like

Are the MAC addresses different for each unikernel?

I am not setting the mac address anywhere.

   open Dhcp_wire

let ip = Ipaddr.V4.of_string_exn
let net = Ipaddr.V4.Prefix.of_string_exn
let mac = Macaddr.of_string_exn

let hostname =           "charrua-dhcp-server"
let default_lease_time = 60 * 60 * 1 (* 1 hour *)
let max_lease_time =     60 * 60 * 24 (* A day *)
let ip_address =         ip "192.168.1.5"
let network =            net "192.168.1.5/24"
let range =              Some (ip "192.168.1.70", ip "192.168.1.100")
(* List of dhcp options to be advertised *)
let options = [
  (* Routers is a list of default routers *)
  Routers [ip "192.168.1.5"];
  (* Dns_servers is a list of dns servers *)
  Dns_servers [ip "192.168.1.5"; (* ip "192.168.1.6" *)];
  (* Ntp_servers is a list of ntp servers, Time_servers (old protocol) is also available *)
  (* Ntp_servers [ip "192.168.1.5"]; *)
  Domain_name "pampas";
  (*
   * Check dhcp_wire.mli for the other options:
   * https://github.com/haesbaert/charrua-core/blob/master/lib/dhcp_wire.mli
   *)
]

(*
 * Static hosts configuration, list options will be merged with global ones
 * while non-list options will override the global, example: options `Routers',
 * `Dns_servers', `Ntp_servers' will always be merged; `Domain_name',
 * `Time_offset', `Max_datagram; will always override the global (if present).
 *)

let hosts = []

Using the above configuration , I am running the unikernel on IP 192.168.1.5. I want to run assay 50 instances of the same unikernel code parallelly and create a broadcast from the server to all these 50 instances.

1 Like

May be you don’t know but albatross is a tool to deploy a MirageOS with Solo5/KVM (one possible target of MirageOS). From it, it’s possible to deploy several unikernels such as:

$ mirage configure -t hvt
$ mirage build
$ albatross-client-local create my-unikernel --net=service my-unikernel.hvt --arg='--ipv4=10.0.0.2/28' ...

Such way to deploy your unikernels depends on your infrastructure obviously (on my case, I have a bridge service and my TAP interfaces are bound to this bridge). However, I’m not an user of charrua, so I can not tell how to use this library to provide a DHCP service - but I suspect that it is possible.

3 Likes