Add a virshall

virshall can start, shutdown or destroy all VMs on a hypervisor LAB
so I can remove 'start' from create and pristine; sometimes it is useful
to only create (but not start) the LABs. Similarly, sometimes bringing
the LAB into pristine state, but without restarting the VMs, is useful.
This commit is contained in:
Pim van Pelt
2022-10-22 10:25:27 +02:00
parent 543074b72d
commit f1837236e2
4 changed files with 36 additions and 23 deletions

View File

@ -1,17 +1,10 @@
#!/bin/sh
BUILD=${BUILD:=default}
LAB=${LAB:=0}
## Do not touch below this line
LABDIR=/var/lab
STAGING=$LABDIR/staging
HVN="hvn${LAB}.lab.ipng.ch"
## Bring back into pristine state
## Destroy the VMs and bring them back into pristine state
echo "* Restarting VMs from pristine snapshot"
ssh root@$HVN "set -x; for node in 0 1 2 3; do VM=vpp${LAB}-\${node}; virsh destroy \$VM; zfs rollback ssd-vol0/\${VM}@pristine; virsh start \$VM; done"
echo "* Committing OVS config"
scp overlays/$BUILD/ovs-config.sh root@$HVN:$LABDIR
ssh root@$HVN "set -x; $LABDIR/ovs-config.sh"
ssh root@$HVN "set -x; for node in 0 1 2 3; do VM=vpp${LAB}-\${node}; virsh destroy \$VM; zfs rollback ssd-vol0/\${VM}@pristine; done"