Skip to content

Instantly share code, notes, and snippets.

View churchers's full-sized avatar

Matt Churchyard churchers

  • Unitron Systems
  • UK
View GitHub Profile
@churchers
churchers / agi-lib.sh
Last active August 21, 2020 13:40
Library for simple agi scripts in shell (FreeBSD)
agi::parse(){
local IFS=":"
local key val
read key val
while [ -n "${key}" ]; do
export "${key#agi_}=${val# }"
read key val
@churchers
churchers / gist:b5dc5ccb77d9096af56b84d0d1df20b9
Last active April 21, 2021 21:33
Network migration for bhyve guests using vm-bhyve

Please note this is not live migration, as that would require support in bhyve itself, which is probably still a fair way off. This powers the guest off on one host and starts it on the other, the basic process is as follows:

  • Receiver is put into receive mode
  • Sender takes a snapshot of running guest and sends it in full
  • Sender shuts down guest
  • Sender takes a second snapshot and sends incremental stream
  • Receiver powers up guest (see note 1)

Note that I haven't been able to actually try this with 2 hosts. So far I've just tried sending a guest back to localhost.

@churchers
churchers / gist:38dbe253cf649cc3b9865599a464a67e
Last active July 22, 2016 08:22
Diff for replacing "bhyve" with the VM name in VNC connection
# diff /usr/src/usr.sbin/bhyve/rfb.c rfb.c
52a53
> #include "bhyverun.h"
196c197
< sinfo.namelen = htonl(strlen("bhyve"));
---
> sinfo.namelen = htonl(strlen(vmname));
198c199
< (void)stream_write(cfd, "bhyve", strlen("bhyve"));
---