Set the Icon for a Type of Virtual Machine or vApp That an Extension Manages

You can provide an icon for each type of virtual machine or vApp that an extension manages by setting the
ExtManagedEntityInfo
smallIconUrl
property.
The EAM Sample Solution uses ESX Agent Manager to deploy ESX agent virtual machines. ESX Agent Manager sets the
ManagedByInfo
properties on these virtual machines to mark them as belonging to ESX Agent Manager. The EAM Sample Solution does not set the
ManagedByInfo
properties itself. The code extracts in this procedure are not taken from the source files of the EAM Sample Solution.
The icon that you set in the
ExtManagedEntityInfo
smallIconUrl
property allows you to identify the types of virtual machines or vApps that your extension deploys. If an extension deploys different types of virtual machines, you can create several
ExtManagedEntityInfo
instances, with a different icon for each type. The virtual machines that the extension deploys appear in the
inventory with the icons that you set.
The icon image must be in the PNG format and must measure 16 by 16 pixels. You must save the icon image to an appropriate location in the Web application that defines the extension. You provide a URL or path to the image to the
ExtManagedEntityInfo
instance for the type of virtual machine or vApp that this icon represents. Extensions access the icon image by using HTTP. Extensions do not support HTTPS URLs to icon images.
  1. Create an icon image of type
    PNG
    and of dimensions 16 by 16 pixels.
  2. Save the icon image to an appropriate location in the Web application that defines your an extension.
  3. Call
    ExtManagedEntityInfo.setSmallIconUrl()
    to set the
    ExtManagedEntityInfo
    smallIconUrl
    property for a type of virtual machine or vApp that the extension deploys.
    Extension extension = new Extension(); ExtManagedEntityInfo extManagedEntityInfo = new ExtManagedEntityInfo(); extManagedEntityInfo.setType("
    your_vm_type
    "); extManagedEntityInfo.setDescription("
    Description of this type of virtual machine or vApp.
    "); extManagedEntityInfo.setSmallIconUrl("
    path_to_PNG_image
    "); extension.getManagedEntityInfo().add(extManagedEntityInfo);
Virtual machines and vApps that the an extension deploys appear in the
inventory with the icon that you set.