VMware Cloud Community
mdosystems
Contributor
Contributor

Moving VM to other ESX host

Hello,

i will move an vm from one esx 3.0.2 host to another esx 3.0.2 host. we don't can use vmotion, dmotion or san technology.

so we will copy the source vm to the other server with follow command:

gzip -1 /vmfs/volumes/ESX_DSK6/SQ01 ssh host2 ">" /vmfs/path

do we need to import the copied vm on the esx host2? or it is possible to make a new vm on esx host2 and choose the existing vmdk file?

what files do we need to copy from the source?

we have:

*.vmdk

*.vswp

*.vmxf

and so on.

0 Kudos
12 Replies
dkfbp
Expert
Expert

You have a few options. Are you running virtual infrastructure you can do a cold migration and the VIC will do everything for you. You could also just scp the .vmdk file and create a new guest and point to an existing disk file.

Best regards Frank Brix Pedersen blog: http://www.vfrank.org
0 Kudos
virtualdud3
Expert
Expert

Sure, you can absolutely import/create a VM on the new ESX host using the existing VMDK file.

Just make sure that, when creating the new VM, you select a "Custom" as opposed to a "Typical" VM. Then, when creating the VM, you'll have the option to specify "Use an existing disk". You'll then select/browse to the desired VMDK file, complete the creation process, and you'll have a new VM using the copied/existing VMDK file.

Note that using this process will create a new .vmx file, etc.

############### Under no circumstances are you to award me any points. Thanks!!!
0 Kudos
oreeh
Immortal
Immortal

gzip -1 /vmfs/volumes/ESX_DSK6/SQ01 ssh host2 ">" /vmfs/path

Don't do this.

Export the VMDK first using vmkfstools, then transfer the VMDK to the new host and import it using vmkfstools

0 Kudos
admin
Immortal
Immortal

You can use the free Converter to copy the VM over.

0 Kudos
oreeh
Immortal
Immortal

Using Converter to transfer a VM from one ESX to another???

Isn't this overkill?

0 Kudos
admin
Immortal
Immortal

It can be, but some people prefer a GUI-based tool over command lines. Especially in a Windows world.

0 Kudos
oreeh
Immortal
Immortal

but some people prefer a GUI-based tool over command lines. Especially in a Windows world.

:smileygrin:

0 Kudos
zbenga
Enthusiast
Enthusiast

why dont you use VMware Converter or you can do an nfs mount

0 Kudos
InfoStewards
Enthusiast
Enthusiast

You can remove the VM from inventory on the old server, then copy the entire folder over to the new host, and set the permissions the same as on the old server. Then register the VM on the new server with:

vmware-cmd -s register /full/path/to/file.vmx

When you start the VM after that, it will ask about the UUID changing...just tell it to create a new UUID.

0 Kudos
Rynardts
Enthusiast
Enthusiast

I would just do a scp copy of the vmkd to the new server and create a new VM and use the existing disk. I see no need for imports and exports of the vmdk.

Use:

scp -pv //

Rynardt Spies VCP | VCAP-DCA#50 | VCAP-DCD#129 www.virtualvcp.com
0 Kudos
oreeh
Immortal
Immortal

I see no need for imports and exports of the vmdk.

The need for import is the following:

When importing via vmkfstools, vmkfstools avoids fragementation of the VMDK (by allocating all the space before actually copying) which

could easily happen when using scp, cp and the like (because these tools allocate space on the fly while copying).

And since fragmentation leads to bad performance...

Another thing to consider is the size of the files you have to transfer.

Since vmkfstools skips empty space when exporting, the transfer of the disk is a lot faster.

0 Kudos
Rynardts
Enthusiast
Enthusiast

Fair enough.

BTW: Just before you do a SCP copy, make sure to open SSH on both ESX Server firewalls.

(I'm not having a good technical day today...)

Rynardt Spies VCP | VCAP-DCA#50 | VCAP-DCD#129 www.virtualvcp.com
0 Kudos