VMware Cloud Community

how to clone vmdk file from local datastore to vSAN datastore(single node) by vmkfstools

I want to create same VMs by cloning MDK from local datastore to vSAN datastore without vCenter.

I tried vmkfstools to clone the VMDK but it is failed.

I did successfully create a new VM on the VSAN datastore by vSphere Web console(GUI).

How to clone the VMDK file without vCenter?



[root@esxi01:~] esxcli system version get
Product: VMware ESXi
Version: 7.0.2
Build: Releasebuild-17867351
Update: 2
Patch: 0

[root@esxi01:~] esxcli vsan cluster get
Cluster Information
Enabled: true
Current Local Time: 2022-03-15T12:43:51Z
Local Node UUID: 61d5c602-98c7-0a59-e071-3a68dd61989b
Local Node Type: NORMAL
Local Node State: MASTER
Local Node Health State: HEALTHY
Sub-Cluster Master UUID: 61d5c602-98c7-0a59-e071-3a68dd61989b
Sub-Cluster Backup UUID:
Sub-Cluster UUID: 520546e6-27f2-d4de-f210-3b7b76cd5058
Sub-Cluster Membership Entry Revision: 0
Sub-Cluster Member Count: 1
Sub-Cluster Member UUIDs: 61d5c602-98c7-0a59-e071-3a68dd61989b
Sub-Cluster Member HostNames: esxi01.vmware
Sub-Cluster Membership UUID: 60882f62-7efa-ac14-0bcb-3a68dd61989b
Unicast Mode Enabled: true
Maintenance Mode State: OFF
Config Generation: None 0 0.0

[root@esxi01:~] esxcli vsan policy getdefault
Policy Class Policy Value
------------ ------------
cluster (("stripeWidth" i1) ("hostFailuresToTolerate" i0) ("forceProvisioning" i1))
vdisk (("stripeWidth" i1) ("hostFailuresToTolerate" i0) ("forceProvisioning" i1))
vmnamespace (("stripeWidth" i1) ("hostFailuresToTolerate" i0) ("forceProvisioning" i1))
vmswap (("stripeWidth" i1) ("hostFailuresToTolerate" i0) ("forceProvisioning" i1))
vmem (("stripeWidth" i1) ("hostFailuresToTolerate" i0) ("forceProvisioning" i1))


[root@esxi01:~] vmkfstools -i "/vmfs/volumes/nfs/RHEL7_64bit.vmdk" "/vmfs/volumes/vsanDatastore/RHEL7_new.vmdk" -d zeroedthick -W vsan
Destination disk format: VMFS zeroedthick
vsanSpbm: No default policy found for ds:///vmfs/volumes/vsan:520546e627f2d4de-f2103b7b76cd5058/
Cloning disk '/vmfs/volumes/nfs/RHEL76_64bit_8G.vmdk'...
Clone: 9% done.Failed to clone disk: Function not implemented (2490377).

0 Kudos
1 Reply

I'm trying a similar thing on ESXi, backing up a VM to AWS and getting 

Clone: 5% done.Failed to clone disk: Function not implemented (2490377).

Using strace it looks like its failing here

strace -s 300 -f /sbin/vmkfstools -i "/vmfs/volumes/datastore1/TEST Linux1/TEST Linux1.vmdk" -d zeroedthick "TEST_Linux1_1.vmdk" 2>/tmp/strace.log

[pid 274071] open("TEST_Linux1_1.vmdk", O_RDWR|0x10000000) = -1 ENOSYS (Function not implemented)

It seems vmkfstools is trying to set flag 0x10000000, if this is linux like it is O_PATH or its some internal vmware flag.

All a bit speculative as I know nothing how the ESXi kernel is implemented but it looks to me like this would require a change to vmkfstools to work in this case.

I think I am going to have to try Plan B and copy to a local disk first!


0 Kudos