we are using ESXi 6.7U3 and I want simple copy 1000 VMs from our datastore a fast a possible to another datastore. I don't want "migrate" them - I want to create a copy. All VMs are using thin provisioning and this must be preserved. Therefore the "cp" command with SSH doesn't work as expected.
Can anybody give me a hint what can I do to archive my goal?
Moderator note by wila: Moved post from Skyline community discussions to VMware vSphere discussions
The 'cp' command isn't optimized for VMFS partitions, and - as you found out - isn't thin provisioning aware.
To copy the base (thin provisioned) disks use vmkfstools -i <source.vmdk> -d thin <target.vmdk>. Once the virtual disk is copied/cloned, you may want to check whether the new disk's header .vmdk file has the same "CID" (required to maintain the snapshot chain). If that's not the case, use the "cp" command to copy the header .vmdk file from the "old" datastore to the new one again.
Can you tell us more about how you used rsync? This command is not present on the command line of ESXi. Did you use it from a Linux host externally somehow? Can you provide an example?
I would suggest to
use vmkfstools -i for the flat.vmdks
use cp for all small files like vmdk-descriptor, vmx, vmsd, logs
use dd for all sesparse.vmdks or delta.vmdks
ignore all *.vswp files
You can use rsync but that requires installing a thirdparty binary to ESXi which is possible but not trivial at all.
To use rsync from a Linux LiveCD use sshfs: mount the source directory in readonly mode and the target directory in writeable mode.
I do that with ddrescue regularly while doing recovery work - BUT it is SLOW because everything goes through ssh twice.
If this is a task you have to do once I would recommend to use vmkfstools + cp + dd as described above.
Create a sh-script to automate and dont forget to adjust paths in the vmx-files if necessary.