OndrejHome / fast-vm

'fast-vm' is a script for defining VMs from images provided in thin LVM pool.
GNU General Public License v3.0
22 stars 14 forks source link

use `virt-sparsify` to decrease the occupied size of disks #47

Closed OndrejHome closed 5 years ago

OndrejHome commented 5 years ago

IDEA: Use virt-sparsify to reduce the occupied space on disks of machines that are not active

virt-sparsify --in-place /dev/vg_data/fastvm-centos-7.6-XX

Add option that can do this cleanup. It is needed to change ownership of block device (fast-vm-helper.sh can be utilized to do this.

man virt-spartify
...
       In-place sparsification works using discard (a.k.a trim or unmap) support.
...

If implemented this might be part of periodic cron job (daily/weekly?). We need to ensure that disk will be locked while cleaning up the machine. Consider having option to either disable this or document how to add this if disabled by default.

OndrejHome commented 5 years ago

This will most probably be in separate commands for VMs and for Images. Or we will need function that can list all images+inactive_vms.

OndrejHome commented 5 years ago

implemented in develop.