Posted Nov 18, 2010 15:51 UTC (Thu) by josefwhiter (guest, #39238)
[Link]
So say you have a virt guest that sends down a discard. If the guest is on a sparse file nothing happens, you continue to have the space allocated to the sparse file, so eventually even though your guest may only be using say 4g of an 8g sparse file, it could have allocated all of that 8gig, so you are still having to deal with an 8 gig file on the host. With hole punching you can de-allocate that space, so you only ever use as much space on the host as you are using in the guest.
Punching holes in files
Posted Nov 18, 2010 16:08 UTC (Thu) by Trelane (subscriber, #56877)
[Link]
Aaah, ok. I think I can see it (I'm guessing that "sending down a discard" means deleting something on a virtual disk?) Thanks!
Punching holes in files
Posted Nov 18, 2010 16:54 UTC (Thu) by chmouel (subscriber, #6335)
[Link]
I am not sure I catch the "sending a discard" by the guest, what does it do ?
Punching holes in files
Posted Nov 18, 2010 18:40 UTC (Thu) by nix (subscriber, #2304)
[Link]
"This bit of this file is mapping a part of a virtual filesystem known to be empty. Its contents do not matter."
Currently, the backing file still takes up space on the host's filesystem when that is done. It need not. (Possible downside: files with huge numbers of holes scattered through them had a historical propensity to get enormously fragmented, but for VM filesystem images this is probably completely unimportant, as the 'fragmentation' is going to be precisely in line with actual *files* in the contained FS.)
Punching holes in files
Posted Nov 19, 2010 16:55 UTC (Fri) by ewan (subscriber, #5533)
[Link]
I suspect that this will bring us full circle to the TRIM command, and that this will actually work with the guest OS issuing a TRIM to the virtual hardware, and that being implemented on the host as 'punch hold in file', which may then also cause the host to issue a TRIM to its real underlying storage.