Before you can view the remote plug-in sample in the vSphere Client, you must register it with a vCenter Server instance to which you want to connect. The vSphere Client SDK contains a vCenter Server plug-in registration tool that registers a plug-in with a vCenter Server ExtensionManager.

You have installed the SDK, built the sample, and are ready to run the remote plug-in.

Prerequisites

  • Start the server.

  • If needed, start vCenter Server.

  • If needed, change permissions on the plug-in registration tool to allow execute access.

  • Collect the following information to prepare the registration command:
    • The host name or IP address of the machine where you are running the sample plug-in server. This address must be accessible to the vCenter Server instance so that it can download the plug-in manifest file.

    • The port number where the plug-in server receives HTTPS requests. The sample serves port 8443 by default. The port must be open on the firewall of your development machine and accessible to the vCenter Server.

    • The host name or IP address of the vCenter Server where you want to register the remote plug-in sample.

    • The username and password of a vSphere user who has permission to access the ExtensionManager on the vCenter Server where you want to register the remote plug-in sample. For example, [email protected] normally has the necessary Extension.Register permission.

    • The SHA-256 thumbprint or SSL certificate of the plug-in server, so that vCenter Server can retrieve the plug-in manifest file. With a certificate, check that the host name in the plug-in server certificate is specified according to subjectAltName extension (RFC 2818, Section 3.1 Server Identity).

      Note:

      vCenter Server expects the thumbprint (fingerprint) to contain colon-separated character pairs. As of vSphere 8.0 U3, the registration script changes unseparated or space-separated character pairs into the expected format.

    • The version number of the remote plug-in sample.

    • The key of the remote plug-in sample, defined in the plug-in manifest, plugin.name by default.

    • Path from plug-in web server root to the plug-in manifest file, /sample-ui/plugin.json by default.
    • Location of JSON files for taskList, faultList, privilegeList, and resourceList.

For more information about the registration tool, see vSphere Client Plug-in Registration Tool.

Procedure

  1. In a command terminal or shell, change directory to the prebuilt folder, which contains an extension-registration.bat script for Windows, and an extension-registration.sh script for Unix or Linux.

    cd html-client-sdk/tools/*plugin*/prebuilt

  2. Run the extension-registration script appropriate for your operating system, specifying the prerequisite parameters.

    For a Unix or Linux shell, use this syntax:

    path2json=../../../samples/remote-plugin-sample/registration/resources
    ./extension-registration.sh  -action registerPlugin  -remote \
    -url https://myvcenter/sdk \
    -username [email protected]  -password 'mysecret' \
    -key com.vmware.sample.remote  -version 1.0.0 \
    -pluginUrl https://mydevbox:8443/sample-ui/plugin.json \
    -serverThumbprint 19:FD:2B:0E:62:5E:0E:10:FF:24:34:7A:81:F1:D5:33:\
    19:A7:22:A0:DA:33:27:07:90:0F:8E:8D:72:F1:BD:F1 \
    -serverCertificateFile /tmp/plugin-server.cer \
    -c 'Example, Inc.'  -n 'Remote Plug-in'  -s 'This is a sample plug-in' \
    --faultList $path2json/faultList.json --privilegeList $path2json/privilegeList.json \
    --resourceList $path2json/resourceList.json --taskList $path2json/taskList.json

    For a DOS command shell, use this syntax:

    set path2json=..\..\..\samples\remote-plugin-sample\registration\resources
    .\extension-registration.bat  -action registerPlugin -remote ^
    -url https://myvcenter/sdk ^
    -username [email protected]  -password "mysecret" ^
    -key com.vmware.sample.remote  -version 1.0.0 ^
    -pluginUrl https://mydevbox:8443/sample-ui/plugin.json ^
    -serverThumbprint 19:FD:2B:0E:62:5E:0E:10:FF:24:34:7A:81:F1:D5:33:^
    19:A7:22:A0:DA:33:27:07:90:0F:8E:8D:72:F1:BD:F1 ^
    -serverCertificateFile C:\plugin-server.cer ^
    -c "Example, Inc."  -n "Remote Plug-in"  -s "This is a sample plug-in" ^
    --faultList %path2json%\faultList.json --privilegeList %path2json%\privilegeList.json ^
    --resourceList %path2json%\resourceList.json --taskList %path2json%\taskList.json

    For a PowerShell prompt, use this syntax:

    Set-Variable path2json ..\..\..\samples\remote-plugin-sample\registration\resources
    .\extension-registration.bat  -action registerPlugin  -remote `
    -url https://myvcenter/sdk `
    -username [email protected]  -password 'mysecret' `
    -key com.vmware.sample.remote  -version 1.0.0 `
    -pluginUrl https://mydevbox:8443/sample-ui/plugin.json `
    -serverThumbprint 19:FD:2B:0E:62:5E:0E:10:FF:24:34:7A:81:F1:D5:33:`
    19:A7:22:A0:DA:33:27:07:90:0F:8E:8D:72:F1:BD:F1 `
    -serverCertificateFile C:\plugin-server.cer `
    -c 'Example, Inc.'  -n 'Remote Plug-in'  -s 'This is a sample plug-in' `
    --faultList $path2json\faultList.json --privilegeList $path2json\privilegeList.json `
    --resourceList $path2json\resourceList.json --taskList $path2json\taskList.json

    If a password contains special characters, use appropriate escape sequences for your shell.

    Note:

    When registering the plug-in, it's highly recommended to provide the SSL certificate of the plug-in server in addition to the thumbprint of the SSL certificate of the plug-in server. Performing a full SSL certificate check during SSL handshake is more secure than performing an SSL certificate thumbprint check. Furthermore, in future vSphere releases, support for SSL certificate thumbprints will be dropped and full SSL certificates will be required.

Results

The registration script displays a message that the plug-in is "successfully registered in vCenter."

An Extension record is added in the ExtensionManager of the vCenter Server instance.

What to do next

In a web browser, connect to the vCenter Server URL and verify that the remote plug-in displays a Global View.