Thursday 7 March 2013

Move/copy virtual machine around VMware environment

Goal is to move/copy a virtual machine to another datastore on another VMware server for virtualization, like ESXi.
In other words, create and register in the vSphere (VMware Workstation) a new VM from existing uploaded folder with such machine.

1. Physically move the directory of the virtual machine:
a) via Browse datastore to download it on the local machine and the via the Browse datastore on the other server upload it there
b) use VMware vCenter Converter http://www.vmware.com/products/converter/overview.html , this tool will relocate any machine around, just fill in appropriate IP of the source and destination servers

2. Once the virtual machine folder is uploaded, right-click the .vmx file -> Add to inventory.
This will add the machine to the list of machines in the left pane of the vSphere or VMware Workstation

You still may experience network conflicts of IP, MAC and so on after copying/moving a VM to new datastore, because it brings along the old network data (IP, MAC and so on). So you need to get new network data for the new machine.

FORCE VMWare To Generate a New MAC Address

  1. Shut down the Guest OS.
  2. Open up the .vmx file.
  3. Delete the following lines (that begin with…):
    ethernet0.addressType
    uuid.location =
    uuid.bios =
    ethernet0.generatedAddress =
    ethernet0.generatedAddressOffset =
  4. Boot up the Guest OS again, and it should generate new details in the vmx file (I’d check afterwards to be doubly sure).

The most common scenario for wanting to do this is if you’ve used a “template” Guest OS and copied it to multiple PCs, but accidentally clicked “I moved this Virtual Machine” rather than “I copied this Virtual Machine” when first booting the Guest OS in something like VMware Player.
If you tell VMware that the Guest OS was copied, it automatically generates new UUID info and MAC addresses. If you tell VMware that you moved the Guest OS, all unique identifiers are left alone (including the MAC address). By performing the steps above, you can get VMware to generate you some new, unique identifiers, and stop weirdness on your network ;)

No comments:

Post a Comment