Create a container Thing Template with the following system properties and metrics, using the VMware Pulse IoT Center console.

Prerequisites

You must have the CREATE DEVICE TEMPLATE permission to perform this operation.

Procedure

  1. From the VMware Pulse IoT Center console, go to Inventory > Device Templates.
  2. In the Inventory - Device Templates screen, click CREATE. The Create Device Template wizard is displayed.
  3. In the Details step, enter the template name and select the device type as Thing. You can add an optional image. Click NEXT.
  4. In the Properties step, add the following system properties and click NEXT:
    • time-since-creation: The time that has passed since the Thing is created.
    • up-time: The duration of time the Thing device is up.
    • name: The name of the Thing device.
    • command: The commands associated with the Thing device.
    • id: The Thing device id.
    • image: An image associated with the Thing device.
    • status: The status of the Thing device.
    Note: The system properties are case-sensitive.
  5. In the Metrics step, add the metrics that you want to collect for your container. For example, if you are registering an NGINX server to VMware Pulse IoT Center, you can add the network-related metrics to be collected. Click NEXT.
  6. In the Connected Devices Templates step, click NEXT.
  7. In the Commands step, add the following commands:
    • start - Start the container.
    • stop - Stop the container.
    Note: The Client Identifier must match the container client ID when a VMware Pulse IoTC Agent connection is established. The template client ID and the container client IDs are configurable, but they must be the same. The client ID can be found at the following location in your gateway:
    /opt/vmware/iotc-client/conf/plugin_conf/container-management.cfg
    For example:
    root@photon-machine [ ~ ]# cat /opt/vmware/iotc-client/conf/plugin_conf/container-management.cfg
    {
       "interface":{
          "type":"c",
          "name":"container-management",
          "init":"InitializePlugin"
       },
       "clientId": "com.vmware.containermgmt.client",
       "commandInterval":300,
       "propertyInterval":600,
       "metricInterval":300,
       "properties":[],
       "metrics" : [
         {"name": "num-containers", "type": "integer"},
         {"name": "num-running-containers", "type": "integer"},
         {"name": "num-images", "type": "integer"},
         {"name": "network-bytes-in", "type": "integer"},
         {"name": "network-bytes-out", "type": "integer"},
         {"name": "cpu", "type": "double"},
         {"name": "memory", "type": "double"}
       ]
    }

    You can configure the default values in the container-management.cfg file. Ensure that you restart the Container Management service for the changes to take effect.

  8. In the Review step, review the information that you have entered and click SAVE.

Results

You have successfully created a container Thing template.

What to do next

Create a Docker gateway template.