diff --git a/lib/cinder b/lib/cinder index 6439903953..eb0e1d7600 100644 --- a/lib/cinder +++ b/lib/cinder @@ -77,9 +77,20 @@ CINDER_ENABLED_BACKENDS=${CINDER_ENABLED_BACKENDS:-lvm:lvmdriver-1} # Should cinder perform secure deletion of volumes? -# Defaults to true, can be set to False to avoid this bug when testing: +# Defaults to zero. Can also be set to none or shred. +# This was previously CINDER_SECURE_DELETE (True or False). +# Equivalents using CINDER_VOLUME_CLEAR are zero and none, respectively. +# Set to none to avoid this bug when testing: # https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1023755 -CINDER_SECURE_DELETE=$(trueorfalse True CINDER_SECURE_DELETE) +if [[ -n $CINDER_SECURE_DELETE ]]; then + CINDER_SECURE_DELETE=$(trueorfalse True CINDER_SECURE_DELETE) + if [[ $CINDER_SECURE_DELETE == "False" ]]; then + CINDER_VOLUME_CLEAR_DEFAULT="none" + fi + DEPRECATED_TEXT="$DEPRECATED_TEXT\nConfigure secure Cinder volume deletion using CINDER_VOLUME_CLEAR instead of CINDER_SECURE_DELETE.\n" +fi +CINDER_VOLUME_CLEAR=${CINDER_VOLUME_CLEAR:-${CINDER_VOLUME_CLEAR_DEFAULT:-zero}} +CINDER_VOLUME_CLEAR=$(echo ${CINDER_VOLUME_CLEAR} | tr '[:upper:]' '[:lower:]') # Cinder reports allocations back to the scheduler on periodic intervals # it turns out we can get an "out of space" issue when we run tests too @@ -256,9 +267,8 @@ function configure_cinder { iniset_rpc_backend cinder $CINDER_CONF - if [[ "$CINDER_SECURE_DELETE" == "False" ]]; then - iniset $CINDER_CONF DEFAULT secure_delete False - iniset $CINDER_CONF DEFAULT volume_clear none + if [[ "$CINDER_VOLUME_CLEAR" == "none" ]] || [[ "$CINDER_VOLUME_CLEAR" == "zero" ]] || [[ "$CINDER_VOLUME_CLEAR" == "shred" ]]; then + iniset $CINDER_CONF DEFAULT volume_clear $CINDER_VOLUME_CLEAR fi # Format logging