Commander support for OVA/OVF parameters: Example
When you add an OVA/OVF template to the service catalog, any parameters and initial values that are defined by the template's descriptor file are encrypted and saved to the Commander database.
Commander allows you to add these parameters to the request form with a combination of custom attributes and variables.
Custom attributes allow:
- requesters to select parameter values on the form.
- requesters to specify a regular expression value for a parameter on the form.
- administrators to select parameter values during manual deployment.
- administrators to specify a regular expression value for a parameter during manual deployment.
Variables allow you to access information about the deployment destination and the request form.
When you create a custom attribute for a parameter, you can use a substitution variable to map specific values or an input type to a parameter. In this way, you can customize the input choices on the form that's provided to users making a request or a manual deployment.
To allow Service Portal users to request a deployment size when requesting the service, you'll create a custom attribute that will provide the possible values for the template's DeploymentConfiguration parameter.
- Add an OVA or OVF template to the catalog as described in Add vCenter Services to the Catalog.
- On the Attributes tab, click Add Attributes.
- In the Add Attributes dialog, click Create Attribute.
- In the Configure Custom Attribute dialog, type a name for the attribute, for example "DeploymentConfigurationValues", for the Name, and add a description.
- For Type, select List (to allow users to select from a list of key pairs).
- For Applies To, select All Types.
- Clear Edit in Service Portal and click Next.
- On the Configure Attribute page of the wizard, enter the allowed values for attribute.
Note that the custom attribute's values must be exact, case-sensitive matches for the parameters provided in the template's descriptor file.
- Enter "small" and click Add.
- Enter "medium" and click Add.
- Enter "large" and click Add.
- Click Finish.
- Click OK.
- On the Attributes tab, the DeploymentConfigurationValues attribute appears. Select a default size if you want.
- On the Form tab, in the Attributes list, click DeploymentConfigurationValues to add it to the form that users see when they request the OVA/OVF component.
- Click Edit, enable the Required option, then click OK to save the form element.
- Back on the Parameters tab, in the DeploymentConfiguration field, click at the right of the field.
- Select the DeploymentConfigurationValues attribute, click Insert, then click OK.
This adds the variable
#{form.customAttribute['DeploymentConfigurationValues']
. The variable will also include the default size, if you added it earlier (for example,#{form.customAttribute['DeploymentConfigurationValues']}small
. - Click Finish to save the service in the catalog.
To allow users to specify a regular expression instead, select Text. See Work with Custom Attributes for more information.
The DeploymentConfigurationValues attribute is now selected in the Add Attributes dialog.
Now, users must select a deployment configuration size when requesting this OVA template from the service catalog. Their selection will be passed to vCenter as a parameter through the Commander variable, unless an administrator overrides the requester's selection during manual deployment of the service request.