5 cleanup
() { :; }; _errcatch_cleanup
=cleanup
7 x
="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace"
12 usage: ${0##*/} [-h|--help]
13 Create a vm which is a fai server.
15 This assumes you've set the dhcp server to make 52:54:00:56:09:f9 be
16 faiserver. That mac is a randomly generated one in the libvirt range.
18 WARNING: has hardcoded IP and name for for my local lan
26 cleanup
() { pxe-server
:; }
27 .
/debian-pxe-preseed
-i 10.0.0.1 -u iank
-g vda
32 f
=/var
/lib
/libvirt
/images
/${name}
33 s qemu-img create
-o preallocation
=metadata
-f qcow2
$f 30G
35 # uniq because virt-viewer spams me with pointless gtk warnings
36 s virt-install
--os-variant debian8
--cpu host -n $name --pxe -r 1024 --vcpus 1 \
37 --disk $f -w bridge
=br0
,mac
=52:54:00:56:09:f9 |
& sed "/^ *$/d" |
uniq &
39 sleep $
((60*6)) # takes like 10x as long as a fai install!
41 opts
="-oStrictHostKeyChecking=false -oUserKnownHostsFile=/dev/null"
42 while ! scp
$opts faiserver-setup root@faiserver
:; do
46 # note: with a vm, pxe boot is turned off in the bios after it's first reboot.
50 ssh $opts root@faiserver .
/faiserver-setup