Re: [zfs-discuss] Freeing unused space in thin provisioned zvols

2013-02-10 Thread Datnus
I run dd if=/dev/zero of=testfile bs=1024k count=5 inside the iscsi vmfs 
from ESXi and rm textfile.

However, the zpool list doesn't decrease at all. In fact, the used storage 
increase when I do dd.

FreeNas 8.0.4 and ESXi 5.0
Help.
Thanks.

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Freeing unused space in thin provisioned zvols

2013-02-10 Thread Koopmann, Jan-Peter
Why should it?

Unless you do a shrink on the vmdk and use a zfs variant with scsi unmap 
support (I believe currently only Nexenta but correct me if I am wrong) the 
blocks will not be freed, will they?

Kind regards
  JP


Sent from a mobile device.

Am 10.02.2013 um 11:01 schrieb Datnus vinhda...@yahoo.com:

 I run dd if=/dev/zero of=testfile bs=1024k count=5 inside the iscsi vmfs 
 from ESXi and rm textfile.
 
 However, the zpool list doesn't decrease at all. In fact, the used storage 
 increase when I do dd.
 
 FreeNas 8.0.4 and ESXi 5.0
 Help.
 Thanks.
 
 ___
 zfs-discuss mailing list
 zfs-discuss@opensolaris.org
 http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


smime.p7s
Description: S/MIME cryptographic signature
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Freeing unused space in thin provisioned zvols

2013-02-10 Thread Jim Klimov

On 2013-02-10 10:57, Datnus wrote:

I run dd if=/dev/zero of=testfile bs=1024k count=5 inside the iscsi vmfs
from ESXi and rm textfile.

However, the zpool list doesn't decrease at all. In fact, the used storage
increase when I do dd.

FreeNas 8.0.4 and ESXi 5.0
Help.
Thanks.


Did you also enable compression (any non-off kind) for the ZVOL
which houses your iSCSI volume?

The procedure with zero-copying does allocate (logically) the blocks
requested in the sparse volume. If this volume is stored on ZFS with
compression (active at the moment when you write these blocks), then
ZFS detects an all-zeroes blocks and uses no space to store it, only
adding a block pointer entry to reference its emptiness. This way you
get some growth in metadata, but none in userdata for the volume.
If by doing this trick you overwrite the non-empty but logically
deleted blocks in the VM's filesystem housed inside iSCSI in the
ZVOL, then the backend storage should shrink by releasing those
non-empty blocks. Ultimately, if you use snapshots - those released
blocks would be reassigned into the snapshots of the ZVOL; and so in
order to get usable free space on your pool, you'd have to destroy
all those older snapshots (between creation and deletion times of
those no-longer-useful blocks).

If you have reservations about compression for VMs (performance-wise
or somehow else), take a look at zle compression mode which should
only reduce consecutive strings of zeroes.

Also I'd reiterate - the compression mode takes effect for blocks
written after the mode was set. For example, if you prefer to store
your datasets generally uncompressed for any reason, then you can
enable a compression mode, zero-fill the VM disk's free space as
you did, and re-disable the compression for the volume for any
further writes. Also note that if you zfs send or otherwise copy
the data off the dataset into another (backup one), only the one
compression method last defined for the target dataset would be
applied to the new writes into it - regardless of absence or
presence (and type) of compression on the original dataset.

HTH,
//Jim Klimov

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Freeing unused space in thin provisioned zvols

2013-02-10 Thread Koopmann, Jan-Peter
I forgot about compression. Makes sense. As long as the zeroes find their way 
to the backend storage this should work. Thanks!



Kind regards
JP

smime.p7s
Description: S/MIME cryptographic signature
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss