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.
The EAM Sample Solution sets the extension key by defining the
extensionKey=com.vmware.eam.sample.solution
property
in the
eamri.properties
file. The
Manager.java class
picks up this property by calling the
Extension.setKey()
method.
If you change the extension key in the extensionKey property in eamri.properties, you can see the changed name in C:\Program Files\VMware\Infrastructure\VirtualCenter Server\extensions on the vCenter Server for Windows, or in /usr/lib/vmware-vpx/extensions/ in the vCenter Server Appliance.
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
-
Verify that you have set up and started the EAM Sample Solution in an application server.
-
Verify that you have opened eam_work_folder\src\com\vmware\eam\sample\solution\Manager.java in an editor.
Procedure
- ♦
Call the
Extension.setKey()
method to set the extension key.
Manager.java sets the extension key to the extensionKey variable that the eamri.properties file defines.
public class Manager 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.