Compare commits

..

2 Commits

Author SHA1 Message Date
6414b290fa Update README 2023-05-06 22:06:56 +00:00
ba4a3e9fef Move the lock check until after the arg parser 2023-05-06 22:04:30 +00:00
2 changed files with 10 additions and 9 deletions

View File

@ -114,7 +114,7 @@ clones are destroyed. Obviously this is the most dangerous operation of the bunc
of the lab is that the VMs can be re-created off of a stable base image and a generated build.
```
lab:~/src/lab$ LAB=0 ./destroy ## remove VMs and ZFS clones on hvn0.lab.ipng.ch
lab:~/src/lab$ LAB=0 ./command destroy ## remove VMs and ZFS clones on hvn0.lab.ipng.ch
```
### Create
@ -129,7 +129,7 @@ Typically, it's necessary to destroy/create, only when the build or the base ima
the lab can be brought back into a _factory default_ state by rolling back to the `pristine` snapshot.
```
lab:~/src/lab$ LAB=0 ./create ## create ZFS 'pristine' snapshots and start VMs
lab:~/src/lab$ LAB=0 ./create ## create ZFS clones, copy in the build
```
### Pristine
@ -140,6 +140,7 @@ brought back into a default state by rolling back the disks to the `pristine` sn
the virtual machines.
```
lab:~/src/lab$ LAB=0 ./pristine ## return the lab to the latest 'pristine' snapshot
lab:~/src/lab$ LAB=0 ./vishall start ## Start the VMs
lab:~/src/lab$ LAB=0 ./command start ## Start the VMs
lab:~/src/lab$ LAB=0 ./command shutdown ## Start the VMs
lab:~/src/lab$ LAB=0 ./command pristine ## return the lab to the latest 'pristine' snapshot
```

10
command
View File

@ -2,11 +2,6 @@
BUILD=${BUILD:=default}
LAB=${LAB:=0}
[ -r .lock${LAB} ] && {
echo "Lock file for LAB${LAB}, bailing"
exit
}
## Do not touch below this line
LABDIR=/var/lab
STAGING=$LABDIR/staging
@ -18,6 +13,11 @@ CMD=$1
exit
}
[ -r .lock${LAB} ] && {
echo "Lock file for LAB${LAB}, bailing"
exit
}
VMS=$(ls -1 build/${BUILD}/${HVN}/)
for VM in $VMS; do