From: John Griffith Date: Wed, 16 Oct 2013 01:39:22 +0000 (-0600) Subject: Don't zero out thin provisioned LV's on delete X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=de4392314f9b0def8fab65679ec5668aec98fbee;p=openstack-build%2Fcinder-build.git Don't zero out thin provisioned LV's on delete Thin provisioned LV's don't need secure delete to protect from data leakage. Also, zeroing these out kinda defeats the purpose of using thing provisioning. This patch add a check for the lvm type and if it's thin simply returns from the lvm.clear_volume() method. Change-Id: Ie6764209018152565295291efc6fbba553698ae6 Closes-Bug: #1240299 --- diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 3b48840c3..75b0d3b4a 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -197,10 +197,13 @@ class LVMVolumeDriver(driver.VolumeDriver): def clear_volume(self, volume, is_snapshot=False): """unprovision old volumes to prevent data leaking between users.""" - if self.configuration.volume_clear == 'none': + # NOTE(jdg): Don't write the blocks of thin provisioned + # volumes + if self.configuration.volume_clear == 'none' or \ + self.configuration.lvm_type == 'thin': return - if is_snapshot and not self.configuration.lvm_type == 'thin': + if is_snapshot: # if the volume to be cleared is a snapshot of another volume # we need to clear out the volume using the -cow instead of the # directly volume path. We need to skip this if we are using