bkjackson78
Contributor
Contributor

How to copy a thin vm from cluster to cluster and keep it thin via scp or powercli

I am looking for a way, if there is one, to copy a vm from one cluster to another thin provisioned via host to host cli without using vcenter.

I have root for all hosts
There is no shared storage between clusters

all hosts can communicate over 443/22/902

The below command copies the vm folder and contents from source to target datastore but ends up moving it thick provisioned.

scp -r /vmfs/volumes/Source_Cluster_Datastore/vm_folder root@Target_Host_FQDN:/vmfs/volumes/Target_Datastore/

The below command copies the file from source to target datastore folder but ends up moving it thick provisioned.

scp /vmfs/volumes/Source_Cluster_Datastore/vm_folder/file root@Target_Host_FQDN:/vmfs/volumes/Target_Datastore/folder/

I saw this link but I was unable to get vmkfstools to copy between clusters.

https://serverfault.com/questions/372526/move-vmware-esxi-vm-to-new-datastore-preserve-thin-provisio...

Any help would be appreciated

0 Kudos
5 Replies
ashishsingh1508
Enthusiast
Enthusiast

Yes, vmkfstools wont work here.

1. What happens if you copy from "SCP"? Did you try to upload the files and register the VM?

2. Even if you dont have shared storage you can still do a XVmotion between the clusters, provided they have network connectivity between them.

Try either one of them and let us know.

Step 2 is safest and supported way.

Ashish Singh VCP-6.5, VCP-NV 6, VCIX-6,VCIX-6.5, vCAP-DCV, vCAP-DCD
0 Kudos
daphnissov
Immortal
Immortal

Suggestion #2 is not going to work if you don't have vCenter

0 Kudos
bkjackson78
Contributor
Contributor

SCP command works fine except it goes across thick not thin. Even if the source is thin it moves across thick.

I don't have a stable enough vcenter which is the main reason we are doing CLI

0 Kudos
a_p_
Leadership
Leadership

"Thin provisioning" is a file system feature, and requires tools that are aware of this feature. Other tools will see the files as if they were thick provisioned.

What you can if vCenter Server features are not available, is to export/import the VM as an OVF. This will allow you to select the provisioning type on the target.


André

0 Kudos
a_p_
Leadership
Leadership

Almost forgot, you can also use "ovftool" to copy VMs directly from host to host.

see e.g. https://www.virtuallyghetto.com/2012/06/how-to-copy-vms-directly-between-esxi.html

André

0 Kudos