How to copy a VM host to host without vCenter


Login to both ESXi hosts that you are copying from and copying to and make sure SSH is enabled.

Make sure the SSH service is started and allowed in ESXi Firewall on both the hosts.

Now ssh into the esxi host 1 which has the VM that needs to be transferred.

Lets give that host ip 10.1.1.1 and the Host 2 that’s going to receive the file will be 10.2.2.2.

You can SSH into the host 1 using putty(win) or terminal (mac)

#ssh root@10.1.1.1
The authenticity of host '10.1.1.1 (10.1.1.1)' can't be established.
RSA key fingerprint is b2:d6:00:34:aa:cc:62:95:8f:d7:f3:1d:59:1e:c3:54.
Are you sure you want to continue connecting (yes/no)? yes

then it will prompt for Password: so enter that.

Start transferring folder:

nohup scp -rv /vmfs/volumes/data-store1/vm-folder-name root@10.2.2.2:/vmfs/volumes/data-store2/

For Multiple VMs (Folders)

First change directory to the Datastore folder

cd /vmfs/volumes/data-store1/

nohup scp -rv vm-folder-1 vm-folder-2 root@10.2.2.2:/vmfs/volumes/data-store2/

Then it’s better to enter multiple VMs leave just a single space between the VM folder name. No quotes or commas.
Now you will be prompted for “host 2” password. enter that and the file transfer will start. The flags used here are -rv, where r is for folder tranfer and v for verbos to watch the progress.

Note: Adding nohup before scp will allow the command to run in background even if you close Terminal/Putty window.

No comments:

Post a Comment