Wednesday, July 25, 2012

Moving a virtual machine without vmotion in esx 3.5 and 4.x

 

When you move a virtual machine to a new datastore then the esx server shows it as inaccessible:

image

You can unregister and register the virtual machine again from the new location, but then you will need to do some other changes as fix ‘Virtual Machine Startup’ order, also Veeam backup treats this vms as new ones and backup and replica jobs will fail.

To avoid this problems you can do as follows:

If you have moved the vm to a new datastore, then you must locate the vm’s actual datastore’s UUID:

image

Edit /etc/vmware/hostd/vmInventory.xml file and replace the old UUID with the new one:

image

Run /etc/init.d/mgmt-vmware restart to apply changes, (or you can reboot your esx server).

If you have an esxi server from v4.x to 6.x you must use /etc/init.d/hostd restart to restart the management agent (source: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003490).

image

When your moved vms start you’ll receive a message like this. Choose ‘keep’ option and they’ll start:

image

To avoid this message you could delete the following keys from virtual machine’s .vmx file: uuid.location, uuid.bios and sched.swap.derivedName

Applies to: esx 3.5, esx 4.x, esxi 4.x, esxi 5.x, esxi 6.x

No comments:

Post a Comment