From 3f34df1b2d831f855b18496f264ca233b45ca588 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 27 Feb 2014 18:39:39 +0100 Subject: [PATCH 1/1] optional --wiping of volumes --- vinst | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.39.5