From 84c9dd1ea899796793e9c9c79b0366b71e4a285a Mon Sep 17 00:00:00 2001 From: john-griffith Date: Mon, 5 Nov 2012 23:26:07 -0700 Subject: [PATCH] Add ability to disable secure volume delete. Due to gating issues caused by secure delete on LVM volumes, add the ability to disable via flag.secure_delete. Default will be set to True, but we add a way for the gate tests to disable this until we can come up with a fix for https://bugs.launchpad.net/cinder/+bug/1023755 OR implement an alternative secure delete method that doesn' suck. Change-Id: I2a06e4f0021ba1f5d5aad7d0a5997a992e268858 --- cinder/flags.py | 3 +++ cinder/volume/driver.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cinder/flags.py b/cinder/flags.py index 6c418399a..b1a37b2ab 100644 --- a/cinder/flags.py +++ b/cinder/flags.py @@ -217,6 +217,9 @@ global_opts = [ cfg.StrOpt('control_exchange', default='cinder', help='AMQP exchange to connect to if using RabbitMQ or Qpid'), + cfg.BoolOpt('secure_delete', + default=True, + help='Whether to perform secure delete'), ] FLAGS.register_opts(global_opts) diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index e703d2ab4..db0ea5bc3 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -150,7 +150,8 @@ class VolumeDriver(object): # TODO(ja): reclaiming space should be done lazy and low priority dev_path = self.local_path(volume) if os.path.exists(dev_path): - #self._copy_volume('/dev/zero', dev_path, size_in_g) + if FLAGS.secure_delete: + self._copy_volume('/dev/zero', dev_path, size_in_g) self._try_execute('dmsetup', 'remove', '-f', dev_path, run_as_root=True) self._try_execute('lvremove', '-f', "%s/%s" % -- 2.45.2