While finishing the setup of my VMWare ESX infrastructure, I needed to move a couple of virtual machines from a VMWare Server (running on Windows XP) to my ESX server. Migrating most of those machines was relatively easy : I booted the virtual machine using the VMWare convertor cd and used the convertor to move that virtual machine to ESX. However, this technique did not work for my Longhorn beta 3 server. That machine was created as a "Vista (experimental)", and apparently the vmware convertor doesn’t recognize it (yet). Result : the vmware convertor died with a "Unable to determine Guest OS" error message.

I used the following technique to move the vmdk files to ESX manually :

First of all, Download FastSCP from http://www.veeam.com/veeam_fast_scp.asp and install it (in my case, I installed it on my Windows XP machine)

Next, I set up a connecting to the esx server using FastSCP. Navigate to /vmfs/volumes/<id> and create a new folder. I created a folder called "hercules"

The virtual machine I want to migrate is called "Hercules" and contains of a couple of files :

 091107_1722_MovingVMWar1

Select the two vmdk files (Hercules.vmdk and Hercules-flat.vmdk) and use FastSCP to copy them the esx server, in the newly created folder. Since we are working with big files, the copy process may take a while…

After copying the files, log on to the esx server using ssh and go to that folder.

[root@esx01 root]# cd /vmfs/volumes/46e65002-47bafdb7-c511-000423df90e4/
[root@esx01 46e65002-47bafdb7-c511-000423df90e4]# cd hercules/
[root@esx01 hercules]# ls
Hercules-flat.vmdk Hercules.vmdk

    

Now use the vmkfstools utility to clone the vmdk file (use the filename of the ‘small’ file). Note : this process will take a little while…

[root@esx01 hercules]# vmkfstools -i Hercules.vmdk Hercules-new.vmdk
Destination disk format: VMFS thick
Cloning disk ‘Hercules.vmdk’…
Clone: 100% done.

When the conversion is completed, you can delete the 2 old files

[root@esx01 hercules]# ls -al
total 31458496
drwxr-xr-x 1 root root 840 Sep 11 17:57 .
drwxrwxrwt 1 root root 1540 Sep 11 18:14 ..
-rw-r–r– 1 root root 16106127360 Sep 11 17:38 Hercules-flat.vmdk
-rw——- 1 root root 16106127360 Sep 11 18:13 Hercules-new-flat.vmdk
-rw——- 1 root root 344 Sep 11 18:13 Hercules-new.vmdk
-rw-r–r– 1 root root 352 Sep 11 17:38 Hercules.vmdk

[root@esx01 hercules]# rm Hercules.vmdk
rm: remove regular file `Hercules.vmdk’? y

[root@esx01 hercules]# rm Hercules-flat.vmdk
rm: remove regular file `Hercules-flat.vmdk’? y

[root@esx01 hercules]# ls -al
total 15729792
drwxr-xr-x 1 root root 560 Sep 11 18:15 .
drwxrwxrwt 1 root root 1540 Sep 11 18:14 ..
-rw——- 1 root root 16106127360 Sep 11 18:17 Hercules-new-flat.vmdk
-rw——- 1 root root 344 Sep 11 18:17 Hercules-new.vmdk

    

Now create a new virtual machine in ESX, use Custom configuration. When you’re at the disk configuration window, select "use an existing virtual disk" and select the newly created vmdk file. Complete the wizard.

Check if all properties (network interface, …) are correct and boot up the machine.

Useful link : http://vmware-land.com/Vmware_Tips.html#VM1

© 2007, Peter Van Eeckhoutte. All rights reserved. Terms of use are applicable to this document.



Related Posts:

Comments are closed.


Meet me at Brucon 2010
Meet me at Brucon 2010 !

Corelan Team Merchandise
You can support Corelan Team by donating or purchasing items from the official Corelan Team merchandising store.

Peter says:
« All of the info and all tools on this blog are free. Keeping this blog in the air is quite expensive.
So if you like what I do and want to show your respect for my work, please consider donating (use the Donate link above)

There is no way I can keep this site up and running without your help.


»     ...     « If you have enjoyed a certain post or like one of my tools, don't forget to vote/rate it !

»     ...     « If you have questions about certain posts, content or tools published on this website, then please use the forums to post questions. Don't write your questions in the Comments section.

»     ...     « If you want to be the first to know about new posts/tools/tutorials on this blog, then subscribe to the mailinglist. Use the 'Subscribe to updates via email' link below (in the Stay posted section)

»
Categories