Copy Register and Restart a VMWare instance

The scenario:  we have two separate VMWare servers version 4.1.0 (260247) 192.168.210.20(server1)  and 192.168.210.21 (server2)

We have copied a vmware guest from server1 datastore to server2 datastore.  it shows when we browse the datastore, but it will not show in the inventory in vSphere,   here is how to address this.

First lets get connected to the command line console on server2.

Enable the local or remote ESXi Shell from the vSphere Client

  1. Select the host, click the Configuration tab, and click Security Profile in the Software panel.
  2. In the Services section, click Properties.
  3. Select ESXi Shell and click Options.
  4. Temporarily Start the service by clicking the Start button.
  5. Click OK.

Login to the Console

  1. Download or start putty.exe,
  2. Enter the IP address of the VMWare host
  3. Enter the same username and password you use to login to VSphere.

Register the VM

Find the datastore and vmx file you want to registered

  1. cd into /vmfs/volumes/
  2. list the contents to find the datastore your vm is located in
  3. cd in that directory [#cd datastore1]
  4. explore the directories to find the .vmx file you want
  5. Or youcould have just run this command and picked the file you want
    # find / -name ‘*.vmx’

Run the Register Command

  • vim-cmd /solo/register /vmfs/volumes/datastore1/vm.server.name/vm.server.name.vmx
error registering an instance that has already been registered
error registering an instance that has already been registered

If you receive a message “(vim.fault.AlreadyExists)”,  this means you will just need to remove the previous registration that you already copied over from the other location by moving the vmxf file to a backup location

 

 

  • mv /vmfs/volumes/datastore1/vm.server.name/vm.server.name.vmxf /vmfs/volumes/datastore1/vm.server.name/vm.server.name.BAK.vmxf

And rerun the register command.