Copy sparse or thin VM disks from one ESXi host or one datastore to another

From Notes_Wiki

Home > VMWare platform > VMWare vSphere or ESXi > Copy sparse or thin VM disks from one ESXi host or one datastore to another

At times there might be need to copy VMDK or VMs from one ESXi host to another. Normally you can do scp and then register the VM. When asked question whether it was copied or moved, answer 'I Copied it'. However, if you are worried about disk space usage because source VM is thin disk and destination host may not have enough space then there are following options: Note that there is no sparse option with scp and ESXi hosts do not come with rsync. Also even cp command in ESXi does not comes with --sparse option. So copying sparse files / thin disks is a challenge.

  1. If the hosts are associated with vCenter then storage vMotion is the simplest option to migrate from one host (or one datastore) to another for thin disks.
  2. Assuming hosts are not attached to same vCenter (or linked vCenters) then easy option is to use VMWare Standalone converter. Refer Migrate machines to VMWare vCenter VMs using standalone converter
  3. If converting is also not an option then need to mount target machine datastore as NFS on source machine and use:
    vmkfstools -i "/vmfs/volumes/{local datastore}/{vm}/{vm}.vmdk" -d thin "/vmfs/volumes/{nfs datastore}/{vm}/{vm}.vmdk"
    Note that NFS share in this option is created on target ESXi host or storage used by target ESXi host


Refer:



Home > VMWare platform > VMWare vSphere or ESXi > Copy sparse or thin VM disks from one ESXi host or one datastore to another