VMware Cloud Community
dengle
Contributor
Contributor
Jump to solution

transfer VM from one ESXi server to another

I have two ESXi servers running and I would like to move a couple VMs from one to the other.

Is the only option I have vmware converter? I know there are some command line tools, but I am familiar with them. If there exist command line options, where can I get the info to accomplish this?

Reply
0 Kudos
1 Solution

Accepted Solutions
kjb007
Immortal
Immortal
Jump to solution

It is unsupported, but is safe.

First, you need to access the unsupported shell:

press ALT-F1 to access the console window.

Enter "unsupported" in the console and then press Enter. You will not see the text you type in.

If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.

Enable SSH

vi /etc/inetd.conf

Find #ssh and remove the #, and save

kill -HUP `ps | grep inetd`

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB

View solution in original post

Reply
0 Kudos
15 Replies
kjb007
Immortal
Immortal
Jump to solution

You can also use the datastore browser to download the vm files and upload them to the new host. Converter would be the easiest method. Otherwise, you can enable ssh on the ESXi host, which is disabled by default, and then use scp/winscp to transfer files from one host to another.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
dengle
Contributor
Contributor
Jump to solution

how do you enable SSH?

Is this safe?

If I do it this way, I would have to first grab the VM and put on my machine from original ESXi server, and then put the VM from my machine to the new ESXi server. Is this correct?

How do you enable SSH?

Reply
0 Kudos
kjb007
Immortal
Immortal
Jump to solution

It is unsupported, but is safe.

First, you need to access the unsupported shell:

press ALT-F1 to access the console window.

Enter "unsupported" in the console and then press Enter. You will not see the text you type in.

If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.

Enable SSH

vi /etc/inetd.conf

Find #ssh and remove the #, and save

kill -HUP `ps | grep inetd`

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
dengle
Contributor
Contributor
Jump to solution

ok I am in!

Where are the VMs? What directory should I be looking for?

EDIT:

Never mind...I found it...it's tranferring to my machine now.

Quick question: How do I get back to the main ESXi screen on the console? I type exit and it's just showing the console screen.

Reply
0 Kudos
kjb007
Immortal
Immortal
Jump to solution

I believe the main virtual console is 7, so Alt-F7 should get you back.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
Dave_Mishchenko
Immortal
Immortal
Jump to solution

ALT-F2 will get you back to the DCUI.

dengle
Contributor
Contributor
Jump to solution

So now I am transferring the VM from my machine to the other ESXi server via WinSCP. Once I have uploaded the folder, what steps do I do to start the VM on the new ESXi box?

Reply
0 Kudos
kjb007
Immortal
Immortal
Jump to solution

Make sure to create a folder for the new vm, put the new files in. Then, browse the datastore from the new ESXi host, browse to the vm folder, right-click the vmx file, and register the vm with the new host. Then, power on and you're good to go.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
dengle
Contributor
Contributor
Jump to solution

that worked perfectly!

Another question Smiley Happy

The way I did this VM was:

ESXi -> My Machine -> ESXi

Is there a way to use WinSCP and just transfer between the two ESXi servers?

Reply
0 Kudos
kjb007
Immortal
Immortal
Jump to solution

I don't remember if ESXi has a built-in scp client. If it does, you could scp directly from the one ESXi host to the second.

-KjB

Don't forget to mark posts as helpful as well as correct.

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
JesseAFR
Contributor
Contributor
Jump to solution

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=10102&slic...

For migrating a virtual machine without VirtualCenter, use the following procedure:

  1. Power down the virtual machine you are moving.

  2. Log in to the source ESX host as root.

  3. You must have root login over SSH enabled on the destination. For this procedure, see http://kb.vmware.com/kb/8375637.

  4. For each ESX host, be sure you enable outbound SSH communication on the firewall, under **Configuration > Security Profile > Properties... and check the box for **SSH Clien.

  5. Using scp -r, copy the virtual machine from the source ESX Server host to the destination ESX Server host.

    scp -r /vmfs/volumes/<datastore name>/<VM name>/ root@<destination hostname or IP>:/vmfs/volumes/<datastore name>/

  6. Open the VI Client and log into the destination ESX Server host.

  7. Double-click the datastore icon and browse to the location of the virtual machine.

  8. Right-click the .vmx file and choose **Add to Inventor.

    It is now safe to power on the virtual machine.

Reply
0 Kudos
dengle
Contributor
Contributor
Jump to solution

That is awsome!

what about this step:

For each ESX host, be sure you enable outbound SSH communication on the firewall, under **Configuration > Security Profile > Properties... and check the box for **SSH Clien.

How would you do that step for ESXi?

Reply
0 Kudos
JesseAFR
Contributor
Contributor
Jump to solution

I don't guess you can use that step in ESX3i or at least on the free version that I have.

But you can follow the steps in and edit the /etc/ssh/sshd_config file.

Reply
0 Kudos
ITnimda
Contributor
Contributor
Jump to solution

Similar to other examples on this thread, after enabling SSH Consoles (Navigator\Host\Actions\Services\Enable Secure Shell (SSH) and Enable console shell, I had success using Putty with a SSH connection to the source ESXi v7.0.3 host server using this command syntax:

scp -r /vmfs/volumes/DATASTORENAME/VMNAME root@HOSTNAMEorIPADDRESS:/vmfs/volumes/DATASTORENAME 

You will receive a prompt for your password and the copy should start.

 

Reply
0 Kudos
HanzoL0
Contributor
Contributor
Jump to solution

Thank you for this info., did you do this from a VM controller and then copy it from ESXi 1 to the 2nd ESXi or did you log into the ESXi 1 via SSH and cd to the directory and then SCP it--> to ESXi 2 ??

Reply
0 Kudos