diff --git a/src/tm_mad/fs_lvm/clone b/src/tm_mad/fs_lvm/clone index 65057d44cc..55a86dabe1 100755 --- a/src/tm_mad/fs_lvm/clone +++ b/src/tm_mad/fs_lvm/clone @@ -130,7 +130,7 @@ CLONE_CMD=$(cat <"${DST_DIR}/.host" || : # zero trailing space - if [ -n "${ZERO_LVM}" ]; then + if [ -n "${ZERO_LVM_ON_CREATE}" ]; then LVSIZE=\$(${SUDO} ${LVS} --nosuffix --noheadings --units B -o lv_size "${DEV}" | tr -d '[:blank:]') ${DD} if=/dev/zero of="${DEV}" bs=64k \ oflag=seek_bytes iflag=count_bytes \ diff --git a/src/tm_mad/fs_lvm/delete b/src/tm_mad/fs_lvm/delete index bce7467588..d0d1918899 100755 --- a/src/tm_mad/fs_lvm/delete +++ b/src/tm_mad/fs_lvm/delete @@ -78,7 +78,7 @@ EOF if [ -n "${DS_SYS_ID}" ]; then - if [ -n "${ZERO_LVM}" ]; then + if [ -n "${ZERO_LVM_ON_DELETE}" ]; then ssh_exec_and_log "$DST_HOST" "$ZERO_CMD" "Error cleaning $DST_PATH" fi diff --git a/src/tm_mad/fs_lvm/fs_lvm.conf b/src/tm_mad/fs_lvm/fs_lvm.conf index 545ef474e4..1ebab245e1 100644 --- a/src/tm_mad/fs_lvm/fs_lvm.conf +++ b/src/tm_mad/fs_lvm/fs_lvm.conf @@ -14,8 +14,12 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -# Default ZERO'ing behavior for the driver. When this variable is set the driver -# will zero LVM space when volumes are allocated or resizes. This prevents data -# from previous allocation to be exposed in new volumes. However this will -# increase the VM allocation time. -ZERO_LVM= +# Default ZERO'ing behavior for the driver. When these variables are set the driver +# will zero LVM space. This prevents data from a previous allocation to be exposed +# in new volumes. However this will increase the VM allocation time. +# +# Zero LVM volumes on creation or resizing +ZERO_LVM_ON_CREATE=yes + +# Zero LVM volumes on delete, when the VM disks are disposed +ZERO_LVM_ON_DELETE=yes diff --git a/src/tm_mad/fs_lvm/resize b/src/tm_mad/fs_lvm/resize index a07cbf2b3e..b152cdfb37 100755 --- a/src/tm_mad/fs_lvm/resize +++ b/src/tm_mad/fs_lvm/resize @@ -59,7 +59,7 @@ VG_NAME="vg-one-$DS_SYS_ID" DEV="/dev/${VG_NAME}/${LV_NAME}" # Get current LV size -if [ -n "${ZERO_LVM}" ]; then +if [ -n "${ZERO_LVM_ON_CREATE}" ]; then LVSIZE_CMD=$(cat <