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
- Select the host, click the Configuration tab, and click Security Profile in the Software panel.
- In the Services section, click Properties.
- Select ESXi Shell and click Options.
- Temporarily Start the service by clicking the Start button.
- Click OK.
Login to the Console
- Download or start putty.exe,
- Enter the IP address of the VMWare host
- 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
- cd into /vmfs/volumes/
- list the contents to find the datastore your vm is located in
- cd in that directory [#cd datastore1]
- explore the directories to find the .vmx file you want
- 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
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.