From: martin f. krafft Date: Thu, 27 Feb 2014 17:39:39 +0000 (+0100) Subject: optional --wiping of volumes X-Git-Url: https://git.madduck.net/code/vinst.git/commitdiff_plain/3f34df1b2d831f855b18496f264ca233b45ca588 optional --wiping of volumes --- diff --git a/vinst b/vinst index 8e157f1..02fcef1 100755 --- a/vinst +++ b/vinst @@ -10,6 +10,7 @@ QEMU_URI=qemu:///system SUITE=wheezy CONSOLE='console=tty0 console=ttyS0,115200n8' DEBUG=0 +WIPE=0 while [ -n "$1" ]; do case "$1" in @@ -80,6 +81,9 @@ while [ -n "$1" ]; do DEBUG=1 set -vx ;; + (--wipe) + WIPE=1 + ;; esac shift done @@ -129,6 +133,7 @@ cat >&2 <<_eof arch: $ARCH ram: $RAM MiB disk: $DISK GiB + wipe: $WIPE console: $CONSOLE net bridge: $BRIDGE _eof @@ -148,6 +153,9 @@ fi echo >&2 virsh --connect=$QEMU_URI vol-create-as $STORAGE_POOL virt-$HOSTNAME ${DISK}G +if [ $WIPE = 1 ]; then + virsh --connect=$QEMU_URI vol-wipe --pool $STORAGE_POOL --algorithm zero virt-$HOSTNAME +fi if [ $DEBUG = 1 ]; then DEBUGFLAG=--debug