vCenter Server Appliance: how to register a vCenter in vSphere Web Client by command line
With vSphere 5 there is a new web-oriented client to manage vSphere: the vSphere Web Client.
You can register multiple vCenter Server systems with a single vSphere Web Client. However, the vSphere Web Client can connect only to one vCenter Server system at a time, unless those vCenter Server systems are joined together in Linked Mode.
To register a vCenter you just need to open a Web browser and enter the URL for the administration tool: https://localhost:port/admin-app
But what if you want to register another vCenter Server with the vSphere Web Client installed as part of a vCenter Server Appliance? You cannot register a vCenter Server system with the client from a remote system and no web browser (neither graphical nor textual) is installed in the vCSA.
To register the vCenter Server you must use a command-line script, well hidden in the vCSA…
Here it is the procedure:
- Access the vcsa via ssh as root user (the ssh service is enabled by default on vCSA)
- Go to the directory /usr/lib/vmware-vsphere-client/scripts:
- Use the admin-cmd.sh script to register the vcenter:
./admin-cmd.sh register https://localhost:9433/vsphere-client https://localhost root <password>
The same command can also be used to unregister a vCenter Server.
For the sake of completeness the full usage is:
admin-cmd <register|unregister> <vSphere-web-client-url> <vCenter-server-url> <username> <password>
register|unregister - Operation type. If the type is register, this tool will register the specified vCenter Server with the vSphere Web Client. If the type is unregister, this tool will unregister the specified vCenter Server.
vSphere-web-client-url – vSphere Client URL. Example: https://clientIP:port/vsphere-client
vCenter-server-url – vCenter Server system which is being registered or unregistered.
For more info about the vSphere Web Client: