So you have been working with VMWare Server for a while and you convinced your boss to install a VMWare ESX server. How can you move your development servers to the new ESX server?

If you wanted to pay for the VMWare Converter enterprise version it could do it for you. Another way is to copy the VMWare server disk files (vmdk) to the ESX server and then import the disk into a new virtual machine.

The process is really quite easy. Depending on the size of the disk files you are copying it will take about 40 minutes. Before we start you will need to configure the ESX server.

Firstly, we are going to connect by SSH, so we need a user account created. By default root cannot logon directly. You need to create a new user account through the VMware Infrastructure client tool. You can normally download this from the web address of the VMWare server.

Also, we need to enable inbound SSH connections in the ESX firewall rules. In the Virtual Infrastructure client, select configuration and then find and modify the firewall rules. If you are proficient in Linux you can also do this fromĀ the operating system.

You may also need to logon to the server using SSH and add write permissions to a folder where you want to copy the files to. If you have plenty of disk space just copy the files to the user home folder.

Once you have a user account and inbound SSH is enabled we need to connect to the destination server from the source server.

firewall

Using either SCP or WINSCP copy the .vmdk files to the destination VMWARE server.

  • Using WinSCP is easier in terms of the user interface but can take longer
  • Download WinSCP
  • After installing WinSCP, run it
  • Set WinSCP to use explorer mode
  • Also Set WinSCP to use a Temporary location
  • Open a new Session to the destination machine (ie esxserver1)
  • Security Question about the SSH key. Click Yes to accept the new host key
  • Navigate to the desired source and destination locations
  • After navigating to the destination folder, drag the source .vmdk file to the destination and copy the file

Note: At the end of the copy An error message will occur. This is because it cannot rename the file. Disregard this as we will delete the file once we have imported it into the new machine.

Now you can create a new virtual machine and import the copied disk file.

  • Log onto the Virtual Infrastructure Client and create a new virtual machine
  • EnsureĀ it has the same number of virtual CPUs as the original
  • Only allocate a small new disk as this will be removed after creation
  • Edit the new virtual machine and remove and delete the disk that was allocated. The remove button will be available if the virtual machine is not running

VMI 2

Import the copied disks

SSH to the destination VMWARE server (esxserver1) as your user name

*Change to Super User (Root)
su -

*Change directory to where you copied the file(s)
eg. cd/vmfs/volumes/storage1

*Import the disk into the new VMWare guest machine
vmkfstools -i sourcefile sourcedestination

(ie vmkfstools -i someserver.vmdk newserver/newserver.vmdk)
Note: the filenames do not need to be specifically the same as the machine name.

Add the imported .vmdk disks

After the import has completed, in the VMware Virtual Infrastructure Client edit the settings of the new virtual machine and add the imported disk file.

Perform a Hardware Upgrade

In the Virtual Infrastructure Client right click on the new virtual machine and click Hardware Upgrade

* This is necessary when migrating from version 2.5.* of VMWARE ESX.

Issues

Things that you need to be aware of.

  • You can only import virtual SCSI disk types. IDE is not supported in VMWare ESX.
  • When creating the new virtual machine ensure that the disk controller type is the same as the original machine.
  • Sometimes the hardware upgrade might cause the network card settings to be lost as it installs the new hardware. This will depend on how old the source virtual server really is. If it is fairly current you should not have this issue.

Now you’re running

Now you are all set to start the new machine. Set your resource reservations and startup/shutdown settings and sit back.

If you have multiple VMWare Esx servers without the Vmotion licenses or a SAN this allows you to shift your workloads as required.