Skip to content

Instantly share code, notes, and snippets.

@kbruner

kbruner/commands + output Secret

Created Dec 25, 2020
Embed
What would you like to do?
~ # for i in 0 1 2; do
cbsd bcreate jconf=/root/instance.jconf jname="server-$i" \
ci_ip4_addr="10.0.10.1${i}/24" ci_jname="server-$i" \
ci_fqdn="server-${i}.k3s.local" ip_addr="10.0.10.1${i}" \
imgsize="20g" vm_cpus="2" vm_ram="2g"
done
Global VM ZFS guid: 414491023960324541
To edit VM properties use: cbsd bconfig jname=server-0
To start VM use: cbsd bstart server-0
To stop VM use: cbsd bstop server-0
To remove VM use: cbsd bremove server-0
For attach VM console use: cbsd blogin server-0
Creating server-0 complete: Enjoy!
auto-generate cloud-init settings: /usr/cbsd/jails-system/server-0/cloud-init
[ similar output for server-1 and server-2 ]
~ # for i in 0 1 2; do cbsd bstart jname="server-$i"; done
cloud-init: enabled
vm_iso_path: cloud-ubuntu-x86-20.04.1
cloud init image initialization..
Clone cloud image into first/system vm disk (zfs clone method)
/sbin/zfs get -Ht snapshot userrefs zroot/ROOT/default/cbsd-cloud-cloud-Ubuntu-x86-20.04.1.raw@boot-server-0
Eject cloud source: media mode=detach name=cloud-ubuntu-x86-20.04.1 path=/usr/cbsd/src/iso/cbsd-cloud-cloud-Ubuntu-x86-20.04.1.raw type=iso jname=server-0
DELETE FROM media WHERE name="cloud-ubuntu-x86-20.04.1" AND path="/usr/cbsd/src/iso/cbsd-cloud-cloud-Ubuntu-x86-20.04.1.raw" AND jname="server-0"
vm_iso_path: changed
Detach to: server-0
All CD/ISO ejected: server-0
VRDP is enabled. VNC bind/port: 127.0.0.1:5901
For attach VM console, use: vncviewer 127.0.0.1:5901
Resolution: 1024x768.
bhyve renice: 1
Execute master script: cloud_init_set_netname.sh
:: /usr/cbsd/jails-system/server-0/master_prestart.d/cloud_init_set_netname.sh
Waiting for PID.
PID: 15858
CBSD setup: bhyve ipfw counters num: 99/100
[ similar output for server-1 and server-2 ]
[ repeat for agent VMs ]
# create server VMs
for i in 0 1 2; do
cbsd bcreate jconf=/root/instance.jconf jname="server-$i" \
ci_ip4_addr="10.0.10.1${i}/24" ci_jname="server-$i" \
ci_fqdn="server-${i}.k3s.local" ip_addr="10.0.10.1${i}" \
imgsize="20g" vm_cpus="2" vm_ram="2g"
done
# start server VMs
for i in 0 1 2; do cbsd bstart jname="server-$i"; done
# create agent VMs
for i in 0 1 2; do
cbsd bcreate jconf=/root/instance.jconf jname="agent-$i" \
ci_ip4_addr="10.0.10.2${i}/24" ci_jname="agent-$i" \
ci_fqdn="agent-${i}.k3s.local" ip_addr="10.0.10.2${i}" \
imgsize="10g" vm_cpus="2" vm_ram="2g"
done
# start agent VMs
for i in 0 1 2; do cbsd bstart jname="agent-$i"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment