Set the Extension Key

Every extension that you register with vCenter Server must have a unique extension key that vCenter Server uses to identify the extension.

To ensure uniqueness, you can use the Java package-naming convention for the key value, for example com.yourcompany.yourextension. Your solution can set the extension key by defining the extensionKey=com.mycompany.mysolution property in the mysolution.properties file. The MyManager.java class picks up this property by calling the Extension.setKey() method.

If you change the extension key in the extensionKey property in mysolution.properties, you can see the changed name in the vSphere Client.

You can see the extensions that you register with ExtensionManager in the vCenter Managed Object Browser at https://<vcenter_server_ip_address>/mob/?moid=ExtensionManager

Prerequisites

Download the vSphere ESX Agent Manager SDK.

Procedure

  • Call the Extension.setKey() method to set the extension key.
    MyManager.java sets the extension key to the extensionKey variable that the mysolution.properties file defines.
    public class MyManager implements InitializingBean {
      [...]
      public final String EXTENSION_KEY;
      [...]
         EXTENSION_KEY = extensionKey;
      [...]
    }
      [...]
      private Extension createExtensionObject() {
        Extension extension = new Extension();
        extension.setKey(EXTENSION_KEY);
      [...]
      }
    

Results

You set the extension key for an extension.

What to do next

Provide information about the extension to vCenter Server.