Sep 7, 2015

VMWare - Moving/Copying VM(s) to another host server.

These few days I have received an order to upgrade an existing VM with higher memory capacity in order to cope with workload.

Sadly the host (eg. ESXi-1) which the VM is running on have used all the maximum available memory thus a new server must be acquired.

Now the problems arises where the client didn't have any vCenter server thus there's vMotion was not available for the task. After some studies in VMware's KB articles, there is a way to move a VM from 1 host to another host regardless of the hardware specifications.

But for me to play it at a safe side, I ensure the new server is installed with the same ESXi version and the VM must be shutdown for this process (yes, there is downtime on this).

So I get a temporary desktop (Windows 7) & install vSphere Client and an extra 1TB of HDD, what VMware recommended in their website is to use vSphere Client to perform the migration and the following steps was done by myself.

  1. Run defragment on that VM.
  2. Ensure no one is using that VM anymore (a scheduled downtime required) & shutdown the VM.
  3. Browse to that particular "Datastore" where the VM is located and download the entire folder into the extra 1TB HDD with the same folder structure.
* Proper & good downtime management is required here as the process took around 6-12 hours to complete.

Now once the download complete, I perform the following :-

  1. Ensuring the VM is no longer power on automatically on ESXi-1 server & stays shutdown.
  2. Comparing the file sizes on ESXi-1 server & the downloaded copy.
  3. Now ensure the new server is ready (eg. ESXi-2) with sufficient storage space for the "Datastore".
  4. Start uploading the entire folder from the local copy to ESXi-2 datastore.
* This process will also take similar times to complete, so be patient.

Once the upload is complete you need to "add into inventory" in order for the ESXi-2 server to recognised it as a VM.

  1. At ESXi-2 server, browse to the "Datastore" where the new VM has uploaded.
  2. Select the VM's folder and search for "xxx.vmx" file.
  3. Right-click the "xxx.vmx" file --> Select "Add to inventory" option and wait for it to complete.
  4. Open the VM Console and you will receive a prompt message, select --> "I move it" option.
  5. Once completed, you may now startup that VM.
Overall, this process took me almost 2 days to complete. So please do plan the downtime correctly and sufficiently.

2 comments:

  1. May i know that vm you move to another host consist of how many virtual machine?

    ReplyDelete
    Replies
    1. Sorry for the super late reply, total VMs moved to the new ESXi server is 2 VMs.

      Delete