Assume vol0 on the hypervisors, not ssd-vol0

This commit is contained in:
Pim van Pelt
2023-11-19 17:06:49 +00:00
parent 37b4b725d9
commit 4ca17edf61
3 changed files with 8 additions and 8 deletions

View File

@ -36,11 +36,11 @@ will watch this replication endpoint, and if they see new snapshots arrive, they
do an incremental pull of the data to their own ZFS filesystem as a snapshot. Old/current do an incremental pull of the data to their own ZFS filesystem as a snapshot. Old/current
running labs will not be disrupted, as they will be cloned off of old snapshots. running labs will not be disrupted, as they will be cloned off of old snapshots.
You will find the image as `ssd-vol0/hvn0.chbtl0.ipng.ch/ssd-vol0/vpp-proto-disk0`: You will find the image as `vol0/hvn0.chbtl0.ipng.ch/ssd-vol0/vpp-proto-disk0`:
``` ```
lab:~$ ssh -A root@hvn0.lab.ipng.ch 'zfs list -t snap' lab:~$ ssh -A root@hvn0.lab.ipng.ch 'zfs list -t snap'
NAME USED AVAIL REFER MOUNTPOINT NAME USED AVAIL REFER MOUNTPOINT
ssd-vol0/hvn0.chbtl0.ipng.ch/ssd-vol0/vpp-proto-disk0@20221013-release 0B - 6.04G - vol0/hvn0.chbtl0.ipng.ch/ssd-vol0/vpp-proto-disk0@20221013-release 0B - 6.04G -
``` ```
## Install ## Install

View File

@ -27,7 +27,7 @@ for VM in $VMS; do
echo "[$VM] Destroying VM" echo "[$VM] Destroying VM"
ssh root@$HVN "/usr/bin/virsh list --all | grep $VM.*running >/dev/null && virsh destroy $VM" ssh root@$HVN "/usr/bin/virsh list --all | grep $VM.*running >/dev/null && virsh destroy $VM"
echo "[$VM] Rolling VM back to pristine snapshot" echo "[$VM] Rolling VM back to pristine snapshot"
ssh root@$HVN "zfs rollback ssd-vol0/${VM}@pristine" ssh root@$HVN "zfs rollback vol0/${VM}@pristine"
;; ;;
start|shutdown) start|shutdown)
echo "[$VM] Sending $CMD to VM" echo "[$VM] Sending $CMD to VM"
@ -37,7 +37,7 @@ for VM in $VMS; do
echo "[$VM] Destroying VM" echo "[$VM] Destroying VM"
ssh root@$HVN "/usr/bin/virsh list --all | grep $VM.*running >/dev/null && virsh destroy $VM" ssh root@$HVN "/usr/bin/virsh list --all | grep $VM.*running >/dev/null && virsh destroy $VM"
echo "[$VM] Destroying ZFS image" echo "[$VM] Destroying ZFS image"
ssh root@$HVN "zfs destroy -r ssd-vol0/$VM" ssh root@$HVN "zfs destroy -r vol0/$VM"
;; ;;
esac esac
done done

8
create
View File

@ -15,7 +15,7 @@
## * Unmount the staging directories ## * Unmount the staging directories
## * Start the VMs ## * Start the VMs
BASE=${BASE:=ssd-vol0/hvn0.chbtl0.ipng.ch/ssd-vol0/vpp-proto-bookworm-disk0@20231015-release} BASE=${BASE:=vol0/hvn0.chbtl0.ipng.ch/ssd-vol0/vpp-proto-bookworm-disk0@20231015-release}
BUILD=${BUILD:=frr} BUILD=${BUILD:=frr}
LAB=${LAB:=0} LAB=${LAB:=0}
@ -33,13 +33,13 @@ VMS=$(ls -1 build/${BUILD}/${HVN}/)
for VM in $VMS; do for VM in $VMS; do
echo "[$VM] Cloning base" echo "[$VM] Cloning base"
ssh root@$HVN "mkdir -p $STAGING/$VM; zfs clone $BASE ssd-vol0/$VM" ssh root@$HVN "mkdir -p $STAGING/$VM; zfs clone $BASE vol0/$VM"
echo "[$VM] Mounting in staging" echo "[$VM] Mounting in staging"
ssh root@$HVN "mount /dev/zvol/ssd-vol0/$VM-part1 $STAGING/$VM" ssh root@$HVN "mount /dev/zvol/vol0/$VM-part1 $STAGING/$VM"
echo "[$VM] Rsyncing build" echo "[$VM] Rsyncing build"
rsync -aIcg build/$BUILD/$HVN/$VM/ root@${HVN}:$STAGING/$VM/ rsync -aIcg build/$BUILD/$HVN/$VM/ root@${HVN}:$STAGING/$VM/
echo "[$VM] Running lab-build snippets" echo "[$VM] Running lab-build snippets"
ssh root@$HVN "cd $STAGING/$VM; for s in root/lab-build/*; do chroot $STAGING/$VM /bin/bash /\$s; done" ssh root@$HVN "cd $STAGING/$VM; for s in root/lab-build/*; do chroot $STAGING/$VM /bin/bash /\$s; done"
echo "[$VM] Unmounting and snapshotting pristine state" echo "[$VM] Unmounting and snapshotting pristine state"
ssh root@$HVN "umount $STAGING/$VM; zfs snapshot ssd-vol0/${VM}@pristine" ssh root@$HVN "umount $STAGING/$VM; zfs snapshot vol0/${VM}@pristine"
done done