mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-01-06 14:03:07 -06:00
Make a virtual machine disk sparse with virt-sparsify
(#1195)
After working with `virt-sysprep`, it is a good idea to make the disk image sparse with `virt-sparsify`. This reduces the size of the resulting box. See https://libguestfs.org/virt-sparsify.1.html Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
This commit is contained in:
parent
48c1a55153
commit
978e92eac5
@ -52,6 +52,7 @@ module VagrantPlugins
|
||||
options = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPTIONS', '')
|
||||
operations = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPERATIONS', 'defaults,-ssh-userdir,-customize')
|
||||
`virt-sysprep --no-logfile --operations #{operations} -a #{@tmp_img} #{options}`
|
||||
`virt-sparsify --in-place #{@tmp_img}`
|
||||
# add any user provided file
|
||||
extra = ''
|
||||
@tmp_include = @tmp_dir + '/_include'
|
||||
|
Loading…
Reference in New Issue
Block a user