Group and environment parameters

Add parameters to a group or an environment to control which fields appear on the order form and which values users can choose

Groups and environments have the same Parameters tab, and parameters work the same way on both. In Cloud Management Platform (CMP), a parameter on a group applies to orders in that group and its subgroups. A parameter on an environment applies to orders that deploy there. When a blueprint sets options for a parameter, the form offers only those options. Otherwise, it offers the options from both the group and the environment. See How option order is determined.

Add a parameter to a group or environment

  1. Open the group or environment:
    • For a group, go to Groups and select the group.
    • For an environment, go to Admin > Environments and select the environment.
  2. Select the Parameters tab, then select Add.
  3. Locate and select the parameter, then select Add.

Screenshot of an environment’s Parameters tab. (opens full-size image in a new tab)

The parameter now appears on the order form for that group or environment. To create a new parameter, see Adding and managing parameters. Managing a group’s parameters requires the group.manage_parameters permission.

Example: Add an expiration date to an environment

The San Jose QA Lab environment’s order form needs an Expiration Date parameter, which CMP uses to remind users to decommission their resources.

  1. Go to Admin > Environments and choose San Jose QA Lab.
  2. Select the Parameters tab.
  3. Select Add.
  4. Locate and select Expiration Date from the global parameter list.
  5. Select Add.

Set options for a parameter

  1. On the group’s or environment’s Parameters tab, find the parameter’s row.
  2. In the Options column, select the edit icon.
  3. Add the values to offer, then select Save.

The order form now shows a list of those values instead of a free-text field. To set a minimum, maximum, or regular expression instead, see Constraints. For more on fixed lists, see Static options.

Example: Limit VM memory size to specific options

In the Acme group, limit the Mem Size parameter to 512 MB, 1 GB, 2 GB, and 4 GB.

  1. Go to Groups.
  2. Select the group.
  3. Select the Parameters tab.
  4. Select Add.
  5. Locate and select Mem Size.
  6. Select Add.
  7. In that row’s Options column, select the edit icon.
  8. In the options dialog, add the values in gigabytes: 0.5, 1, 2, and 4.
  9. Select Save.

The order form now shows a dropdown for memory size instead of a free-text field.

Set a value without showing the field

If a required parameter has only one option for an order, CMP uses that value and leaves the field off the order form. An optional parameter also offers a blank choice, so it still appears as a list.

  1. Give the parameter a single option on the group or environment.
  2. Select the parameter’s name to open its global settings.
  3. Enable the Required toggle switch.

Required is a global setting, so it applies everywhere the parameter is used.

Let users order several servers at once

To let users order more than one server in a single order, add a hostname template and the Quantity parameter. With a hostname template, the Hostname field becomes a read-only Hostname Preview, and CMP generates a unique name for each server.

  1. On the Parameters tab, add the Hostname Template and Quantity parameters.
  2. Give Hostname Template a single option, such as web-00X. See Hostname specification.

The order form then shows Hostname Preview and Quantity fields.

Generate server annotations

Set the Annotation parameter to a template to record where each new server came from. See Annotations specification for the context variables and supported platforms.

  1. On the Parameters tab, add the Annotation parameter.

  2. In its Options column, select the edit icon.

  3. Enter a template, select Add option, then select Save. For example:

    Built by {{ server.owner }} using CMP ({{ portal.site_url }})
    on {{ server.add_date|date:"SHORT_DATE_FORMAT" }}
    [Job ID={{ job.id }}, Order ID={{ order.id }}]
    

To keep the field off the order form, make Annotation required. See Set a value without showing the field. To apply the template everywhere, set it as the parameter’s global default instead.