29 lines
832 B
Bash
Executable File
29 lines
832 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
VMID=${VMID:-990}
|
|
ISO=${ISO:-local:iso/tailrescue-headscale-test.iso}
|
|
STORAGE=${STORAGE:-local-lvm}
|
|
BRIDGE=${BRIDGE:-vmbr0}
|
|
HEADSCALE_HOST=${HEADSCALE_HOST:-root@192.168.0.100}
|
|
HEADSCALE_CONTAINER=${HEADSCALE_CONTAINER:-headscale}
|
|
|
|
qm stop "$VMID" --skiplock 1 || true
|
|
qm destroy "$VMID" --purge 1 --destroy-unreferenced-disks 1 || true
|
|
qm create "$VMID" \
|
|
--name tailrescue-test \
|
|
--memory 2048 \
|
|
--cores 2 \
|
|
--net0 virtio,bridge="$BRIDGE" \
|
|
--ostype l26 \
|
|
--scsihw virtio-scsi-single \
|
|
--vga std \
|
|
--boot order=ide2 \
|
|
--ide2 "$ISO",media=cdrom \
|
|
--agent enabled=0
|
|
qm set "$VMID" --scsi0 "$STORAGE":8
|
|
qm start "$VMID"
|
|
sleep 3
|
|
qm sendkey "$VMID" ret || true
|
|
sleep 75
|
|
ssh "$HEADSCALE_HOST" "docker exec $HEADSCALE_CONTAINER headscale nodes list | grep -i tailrescue || true"
|