How to copy sparse file from ESXi quickly?

2.1k Views Asked by At

I have ESXi 6.0, from which I need to copy a sparse file of size ~900GB and its actual size 5GB to another Linux machine.

I started with SCP and it takes very longer time, as it is unware of sparse file.

Next I tried, "tar -S" to tar the sparse file, but unfortunatley -S option is unavailable on ESXi.

Ended up with another option "rsync" tool, but it is not available for ESXi by default.

Is there any way on ESXi to copy sparse file quickly to other system?

1

There are 1 best solutions below

0
On
  1. The hard way (but suitable for homemade backup scripts)

    For this, you need to export an NFS share on the target server, which has a file system capable of creating and using sparse files.

    Next, mount the NFS share in ESX and use vmkfstools:

    vmkfstools -i "/vmfs/volumes/{local datastore}/{vm}/{vm}.vmdk" -d thin "/vmfs/volumes/{nfs datastore}/{vm}/{vm}.vmdk"
    

    Also, you will need to copy the vmx file and any others you need, including snapshots (though I'd probably recommend removing all the snapshots first to make life easier).

  2. The easy way

    This is what VMWare Converter is designed for - you can try to run it in WINE (like the ESX client) locally on the server, or on a Windows PC with a share to the target server.

I hope I don't have to say that the VM must be powered off for both options...