]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add ability to disable secure volume delete.
authorjohn-griffith <john.griffith@solidfire.com>
Tue, 6 Nov 2012 06:26:07 +0000 (23:26 -0700)
committerJames E. Blair <jeblair@hp.com>
Tue, 6 Nov 2012 15:52:08 +0000 (16:52 +0100)
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
cinder/volume/driver.py

index 6c418399ad88a0ed7c60493245a08768cf1d546d..b1a37b2abd9ef285126bfffaaba79b977f34cd3a 100644 (file)
@@ -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)
index e703d2ab441647d2c558e81befbf24d0d29bff19..db0ea5bc373a04c379187a79e39bef12ae9fadb0 100644 (file)
@@ -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" %