Commit Graph

41 Commits

Author SHA1 Message Date
Hannes Mehnert a9c32d7801 vmmd: actually, first check resources, then exec VM, then insert VM
in case the insertion fails, raise Invalid_argument

this leads to more sane failure behaviour, and also cleans up resources in case
 vmm_resources.insert_vm fails (or cpuset/open of the fifo, create_process)
2019-01-27 17:20:24 +01:00
Hannes Mehnert 131dec0cdd debug 2019-01-27 16:11:40 +01:00
Hannes Mehnert 16f06216ba vmmd: fine grained output handling, gracefully handle Failure from console 2019-01-27 16:07:53 +01:00
Hannes Mehnert e362722da5 vmmd: use mutex for write and read on client sockets, no need for a mvar 2019-01-27 14:13:29 +01:00
Hannes Mehnert c372c8405e vmmd: dump state (unikernel configurations) on create+destroy, restore from state on startup 2019-01-20 22:17:59 +01:00
Hannes Mehnert e58ab236b7 vmmd: lock self_destruct with a mutex, respect result of killall (nothing killed, nothing to do) 2019-01-20 22:09:33 +01:00
Hannes Mehnert d84013103c vmmd: revise process, write_reply, and out signatures, move process to jump 2019-01-20 22:09:33 +01:00
Hannes Mehnert d4e31da27f vmmd: setup and teardown stat by create continuation, and vmm_vmmd.handle_shutdown 2019-01-20 22:09:33 +01:00
Hannes Mehnert fdcea94a0b vmmd: store waiter, not tasks in Vmm_vmmd.t -- create task and waiter on demand (destroy / create --force), instead of at each unikernel creation 2019-01-20 22:09:33 +01:00
Hannes Mehnert 7b8f8fafbd close fd early, no need to carry file descriptors around 2019-01-20 17:43:44 +01:00
Hannes Mehnert 094922f6b0 vmmd: teardown gracefully (kill all vms), install SIGTERM handler to teardown 2019-01-18 01:14:11 +01:00
Hannes Mehnert c8f1030403 rename Vm to Unikernel 2018-11-13 01:02:05 +01:00
Hannes Mehnert dec32e6247 bump wire version 2018-11-12 22:11:06 +01:00
Hannes Mehnert 2e7f2730a2 move Vm to submodule 2018-11-11 03:24:50 +01:00
Hannes Mehnert 7c34c61d43 vmmd_tls needs looping behaviour after adding a policy to start vm 2018-10-31 23:03:30 +01:00
Hannes Mehnert c669be8e02 address most of @cfcs comments 2018-10-29 17:14:51 +01:00
Hannes Mehnert 6677e3f1cb close on exit for vmmd.sock 2018-10-28 20:49:42 +01:00
Hannes Mehnert 7bbfb2e9fa use vmm_cli 2018-10-26 22:34:43 +02:00
Hannes Mehnert a60f866f70 fewer lists, read replies (to sockets) in vmmd 2018-10-26 21:30:54 +02:00
Hannes Mehnert a064c7f58e move more stuff around 2018-10-26 21:29:59 +02:00
Hannes Mehnert d513269453 move stuff into vmm_commands 2018-10-26 21:29:59 +02:00
Hannes Mehnert 6f18f1bfff type data for streamed thingies 2018-10-26 21:29:59 +02:00
Hannes Mehnert c399501a18 get rid of vm_config.vname 2018-10-26 21:29:59 +02:00
Hannes Mehnert 1d4d7509dc remove vmm_wire, use asn.1 2018-10-26 21:29:59 +02:00
Hannes Mehnert 182e2ae10c policies:
vmmc now has more subcommands
  - policy [-n name] returns all policies in name and below
  - add_policy [-n name] [--cpu cpuid] [--mem mem] [--bridge bridge] [--block size] adds a policy
  - remove [-n name] removes policy at name

policy is just the same which is in vmm_req_delegation, and vmm_resources now check them:
- you cannot insert a subpolicy violating the prefix
- you cannot insert a policy which would forbid current resource usage
- you cannot insert a policy with which any subpolicy would be invalid
- you can adjust (increase/decrease) a policy if the above invariants are kept

implement "force create" directly in vmmd: much nicer to
 - check resource constraints,
 - kill vm potentially,
 - and create a new vm,
all as single transaction.
2018-10-26 21:29:59 +02:00
Hannes Mehnert 02f8d94db8 s/ukvm/hvt/ 2018-09-21 22:31:04 +02:00
Hannes Mehnert e7b4742964 less is more, also unify default socket paths
and vmmc console command
2018-09-19 21:53:18 +02:00
Hannes Mehnert bd10209297 wip, vmmc and vmmd talk with each other! 2018-09-09 20:52:04 +02:00
Hannes Mehnert 0583fbfaf1 stats: transmit vmid in add/remove/stats, pid only in add
don't use /tmp anymore, but /var/run/albatross for fifos + sockets + vm images,
  and /var/db/albatross for ukvm-bin and crls, and /var/log/albatross for logging

vmm_console/vmm_log/vmm_stats_lwt: delete socket on startup if it exists

vmm_influxdb_stats: connects to vmm_stats socket and pushes every interval in
 influxdb line format via tcp to specified host and port
2018-04-26 00:03:46 +02:00
Hannes Mehnert 2bb808105e vmmd: make listen port configurable 2018-04-05 02:16:41 +02:00
Hannes Mehnert d83986cab4 vmmd: initialise nocrypto 2018-04-05 02:14:49 +02:00
Hannes Mehnert 9696953cd7 revise force-restart: now with wait for kill and resource cleanup before start
allows to cleanup various hacks, such as checking for pid in vmm_resources
or removing temporarily the allocated resources from the resource map in vmm_engine

semantics is now slightly different, but for sure enhanced.
- each VM has a Lwt.wait () task attached in Vmm_engine.t (tasks : 'c String.Map.t)
- normal create shouldn't be much different, apart from memoizing the sleeper
- after waitpid is done in vmmd, and vmm_engine.shutdown succeeded, Lwt.wakeup is called for the sleeper
- force create now:
 - checks static policies
 - looks for existing VM (and task), if present: kill and wait for task in vmmd
 - continue with presence checking of vm name, dynamic policies, allocate resources (tap, img, fifo)

this means the whole randomness in filenames can be removed, and the
communication between vmm_console and vmm_client is working again (attach/detach
could not work since vmm_console knew only about "albatross.AAA.BBB.RANDOM",
whereas vmm_client insisted on "AAA.BBB"

resource overcommitment (and races in e.g. block device closing + opening) are
gone now, only if the old vm is cleanup up, resources for the new one are
allocated and it is executed
2018-04-05 01:02:45 +02:00
Hannes Mehnert 7a4661b2e1 style: require lwt 3.0.0, fix warnings, disable 4 (fragile pattern matching) and 48 (implicit elimination of optional argument) 2018-04-03 22:58:31 +02:00
Hannes Mehnert 54179f55fc vmmd: failure semantics of stats socket the same as others (raise exception), no silent dropping of statistics 2018-04-03 22:49:50 +02:00
Hannes Mehnert a0c0f39734 vmm_stats: more debug, ignore vmmapi_open failure
vmm_stats_lwt: drop all pids on socket disconnect
vmmd: setup statistics slightly later (after the chmod on FreeBSD)
2018-04-01 23:59:12 +02:00
Hannes Mehnert ceab24948d vmmd: poor mans statistics about uptime. created and destroyed vms 2018-03-22 17:00:08 +01:00
Hannes Mehnert b9d5fa94f9 call waitpid() earlier, separate freebsd kludge (chmod g+rw), fixes #9 2018-03-22 17:00:08 +01:00
Hannes Mehnert cfa7ccd1e0 safer and clearer error semantics for all processes, fixes #5 2018-03-22 17:00:08 +01:00
Hannes Mehnert 8407d13b15 port to new asn + x509 2017-12-23 15:03:56 +01:00
Hannes Mehnert bdedadf689 vmmd:
- fix fd leak (always close socket)
 - send first message (login) after renegotiation

vmm_stats:
 - remove unneeded functionality (keeping old statistics around)
 - translate internal tap names to bridge names
 - gather statistics from vmmapi as well

vmm_prometheus_stats:
 - new exporter of statistics to prometheus

*:
 - fix typo in README
 - style
2017-09-14 21:47:07 +01:00
Hannes Mehnert 02be3f4528 initial 2017-07-10 10:38:25 +01:00