[pve-devel] [Enhancement request] Thin Provisionning problems.. need to zero LVM disks before deleting a VM

Philippe OTTIN philippe.ottin at weishardt.com
Wed Mar 7 10:02:15 CET 2012


As advised by Dietmar, I'm posting my request here.

I got a performance and disk space problem on my SAN (Datacore San 
Melody) due to the fact I've created/deleted too many VM's on the iSCSI 
LVM storage.
Datacore suggests us to zero disks before doing lvremove to tell the SAN 
the space is really available in order to allow San Melody to reclaim 
the unused space.

I explain the situation :

Each time we delete an LVM VM, the lvremove is processed. This is only a 
logical way to tell the LVM to remove the LV, but the data remains on 
the disks.
The SAN still sees this disk space as used (non-zero blocks). The only 
way to tell the SAN the data is available is to zero the LV before 
deleting it.
Then we're able, on the SAN to run a command to reclaim the unused space

It seems this problem is common on all thin-provisionning SAN's (not 
only SanMelody)

I wanted to modify Storage.pm to add a the dd command before the 
lvremove, but the problem is that is lasts from seconds to minuts... and 
the GUI session waits for the end of the dd before allowing me to do 
anything else..
Dietmar told me on the forum, that lvremove was considered as a quick 
command, and that's why it wasn't managed on a "batch" way.

So my question is : is there a way to add this feature in 2.0?
1) put a parameter (on the storage definition?) telling that we would 
like to zero the LV before lvremove
2) if this parameter is set, do the VM/disk deleteion in batch (showing 
a status in an other frame)

You'll find below the code I've tried to add in Storage.pm (I'm not a 
dev...so sorry if it's ugly... :D)


         my ($sizepo, $formatpo) = file_size_info("/dev/$vg/$volname");
         my $sizepoMo = int($sizepo/1024);
         my $cmd = ['dd', 'bs=1M', "count=$sizepoMo", 'if=/dev/zero', 
         run_command ($cmd);

             my $cmd = ['/sbin/lvremove', '-f', "$vg/$volname"];
             run_command ($cmd);

Thank you in advance for your remarks.

- Philippe
This message is protected by the secrecy of correspondence rules ; furthermore it may contain privileged or confidential information
that is protected by law,notably by the secrecy of business relations rule ; it is intended solely for the attention of the addressee.
Any disclosure, use, dissemination or reproduction (either whole or partial) of this message or the information contained herein is
strictly prohibited without prior consent.
Any electronic message is susceptible to alteration and its integrity can not be assured. 
Weishardt declines any responsibility for this message in the event of alteration or falsification.
If you are not the intended recipient, please destroy it immediately and notify the sender of the wrong delivery and the mail deletion.
For contact information see http://www.weishardt.com

More information about the pve-devel mailing list