On 1/31/25 08:47, Enrico Weigelt, metux IT consult wrote:
since I'm running Illumos in VMs (and have to transfer images via web),
I need to keep the images (usually qcow2) small.

What happens when lots of space is used once later freed again ?
Does ZFS automatically trim or zero-out those blocks, so the host can
doesn't need to store them anymore ?
You can start a one-time trim on the pool "rpool" with:

# zpool trim rpool

This runs in background for a bit (how long depends on the size of the pool and the speed of the storage); you can check status with:

# zpool status -t rpool

You can also turn on auto-trimming:

# zpool set autotrim=on rpool

As Till said some underlying storage doesn't cope well with auto-trim so use with care. I've not seen problems with it, and I've seen space freed up by an Illumos VM guest with virtio disks (hosted on a Illumos host via bhyve).

Another area where you could potentially save some space in transit is by dropping the swap zvol in the guest prior to the transfer - stop any workload, swap -d in the guest, delete the swap zvol, trim the pool, snapshot it on the host, then bring them back.

                                               - Bill



------------------------------------------
illumos: illumos-discuss
Permalink: 
https://illumos.topicbox.com/groups/discuss/Teb0468dd89a7f69a-Mfd5a7507396e50acca798fc2
Delivery options: https://illumos.topicbox.com/groups/discuss/subscription

Reply via email to