VMware Cloud Community
TomSCL
Contributor
Contributor

Copying a virtual machine

I've got to copy a virtual machine from 1 esx server to another, I could do this by plugging in my laptop and using vmware convertor however that seems somewhat slow and my assumption is that this is because it's got to take a bit of a detour by going through the laptop (am I right?). What I would feel more comfortable doing would be to log into to console and use netcat or scp to copy the diskimages over however I suspect there maybe problems doing this?

So my questions are is there a more direct way then using vmware convertor to move copy the machine and can it be done without shutting down the source virtual machine?

Many thanks,

Tom

PS, I don't have vMotion

0 Kudos
14 Replies
Troy_Clavell
Immortal
Immortal

install and run VMware Converter on the VM in which you want to "move". Converter will be your safest way of getting the VM from one destination to the next.

If you are using shared storage you can also shutdown the VM in question, remove it from inventory and then add it back to inventory on the destination host.

Finally you could SCP the files using FastSCP or WinSCP

Hope this helps.

weinstein5
Immortal
Immortal

Yes it is slow because the copy occurs over the network - it all depends on how your virtual infrastructure i set up - Are you using shared storage - FC SAN, iSCSI SAN or NAS/NFS? If you are then it is rather easy - unregister the Vm from first VM and re-registering it on the second ESX Server using the datastore browser - or if you have vCenter vmotion if you are licensesd for it and have shared storage - or cold migrate with the VM powered off which will allow you to move the vm between the two hosts - and this does not require shared storage - but it will still require going over the network

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
TomSCL
Contributor
Contributor

These are 2 seperate systems, no shared storage. Also the virtual machines I'm trying to move are linux so I can't install the converter within the virtual machine. As far as I can see this only leaves me with the option to run the converter on a 3rd machine?

0 Kudos
AndreTheGiant
Immortal
Immortal

You can use converter also to do a V2V, for example to copy a VM from one ESX to another ESX (without shared storage).

Converter must be the Enterprise version (integrated into VC as a plugin)

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
AndreTheGiant
Immortal
Immortal

Another solution is (with VM powerd off) using scp or Veem FastSCP to transfer the VM folder from one ESX to the destination one.

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
harryc
Enthusiast
Enthusiast

I tar up the directory and use scp to copy it over, does anyone know how I could rename the files ?

If I leave them all with the origional name everythng works fine, but if I change the name of the directory, .vmdk, .nvram, .vmsd, .vmdk, vmsd, vmx, and vmxf files then it is not seen in the file browser when I go to specify an existing vmdk file.

0 Kudos
AndreTheGiant
Immortal
Immortal

To rename file names is better use VMware Converter.

Or you you have to change several file for each name reference (particullary vmx and vmdk files).

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
Wimo
Hot Shot
Hot Shot

the only important files are the disk files. Just create a whole new VM with the same CPU and memory settings, and then connect the .vmdk file(s) to it. If it's important that your disk file names match the new name of the VM, do a vmkfstools -i to import them with the new name, then delete the originals.

0 Kudos
TomSCL
Contributor
Contributor

Thanks for all your replies, I've not discovered that vmware converter doesn't support some of the operating systems running which I need to move. For me I'd be by far the happiest shutting down the virtual machines and using scp to copy them over, can I just reconfirm that this is possilble, the reason I ask is because I know that you should've copy virtual disk images using cp and you have to use the vmkfstools instead which makes me worry that there may be issues using scp to copy them from one machine to another...I'd be very pleased if someone could eas my mind here.

Many thanks,

Tom

0 Kudos
AndreTheGiant
Immortal
Immortal

You're welcome.

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
TomSCL
Contributor
Contributor

Thanks Andre but I think you may have missed my last post, I was asking if it really is safe to scp virtual disks? The reason I ask is because I know you shouldn't use cp when copying disk and should use vmkfstools instead which makes me worry that scp isn't safe?

0 Kudos
AndreTheGiant
Immortal
Immortal

I was asking if it really is safe to scp virtual disks? The reason I ask is because I know you shouldn't use cp when copying disk and should use vmkfstools instead which makes me worry that scp isn't safe?

cp is only for copy inside a single ESX. It is safe, cause it is local Smiley Happy

scp is for copy between two ESX. It is safe cause use SSH for secure comunications.

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
TomSCL
Contributor
Contributor

Yes I understand the difference between cp and scp but from what I've read you're not supposed to use cp on a virtual disk and that you're supposed to use vmkfstools -i instead (am I wrong?) which makes me think that there is something special about the way the file is saved to disk and makes me worry that using scp might corrupt the disk?

I hope I wrong because it will make my life much easier but I really need to make sure I get this right. Thanks again for your time and patience.

0 Kudos
AndreTheGiant
Immortal
Immortal

If you use scp or cp (or similar) to a powered-off VM and you do not change the name inside the folder, then this operation is safe.

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos