87cf1cf90a01d1486be19c3d147b5738673a05e6
4 # Assumes pxe config for dhcp has been setup.
5 # Deploy fai configuration to faiserver,
6 # then start a virtual machine to test the config.
9 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
12 if [[ $1 == -r ]]; then
18 script_dir
=$
(dirname $
(readlink
-f "$BASH_SOURCE"))
20 if [[ $script_dir == /a
/bin
/* ]]; then
23 cp -ar /a
/bin
/fai
/a
/tmp
/fai2
24 exec /a
/tmp
/fai
2/${BASH_SOURCE##*/} "$@"
31 [[ ! $1 ]] || new_disk
=true
33 if [[ $0 == *arch-revm
]]; then
34 # via osinfo-query os. guessing arch is closest to latest fedora.
49 for ((i
=1; i
<= disk_count
; i
++)); do
50 f
=/var
/lib
/libvirt
/images
/${name}$i
51 disk_arg
+=("--disk path=$f")
52 if $new_disk ||
[[ ! -e $f ]]; then
54 s qemu-img create
-o preallocation
=metadata
-f qcow2
$f 20G
58 if [[ $SSH_CLIENT ]]; then
59 console_arg
=--noautoconsole
64 # --cpu host: this causes mkfs.btrfs to fail with a stack trace which began
66 # init_module+0x108/0x1000 [raid6_pq]
67 s virt-install
--os-variant $variant -n $name --pxe -r 2048 --vcpus 1 \
68 ${disk_arg[*]} -w bridge
=br0
,mac
=52:54:00:9c
:ef
:ad \
69 --graphics spice
,listen
=0.0.0.0 $console_arg
71 if [[ ${0##*/} == arch-revm
]]; then
73 .
/arch-init-remote
$name