After versioning your cloud template, you can change the formatVersion value in your YAML to support additional deployment features.

The formatVersion appears at the top of your YAML and its value determines what you can specify in your VMware cloud template.

  • formatVersion: 1 includes template specifications for inputs and resources. It automatically applies to all basic cloud templates.

    To learn more about a basic template see Reviewable cloud template.

  • formatVersion: 2 adds template specifications for metadata, variables, and outputs. It automatically applies to the cloud templates for AI Workstation and AI Kubernetes Clusters that are deployed using Private AI Automation Services, but supports any kind of deployment.

    For information about deploying AI Workstation and AI Kubernetes Clusters see How do I deploy Private AI catalog items.

As a cloud template administrator, you can use the specifications included with formatVersion: 2 to make deployments more accessible to your users. The following code samples are pruned to show examples of how to use the formatVersion: 2 template specifications in your YAML.

How do I use the metadata template specification

Use metadata to hide or unhide the day 2 operations that appear for your users.
metadata:
  deploymentSettings:
    disableUpdateDay2Action: true
    hideDisabledDay2Actions: true
  • When disableUpdateDay2Action is true, users do not see the Update day 2 operation in the Actions menu. If the user does not have permission to update, the option appears unavailable (dimmed).
  • When hideDisabledDay2Actions is true, any day 2 operation that has been deactived for the user will not appear in the Actions menu.

The Update and Change Project day 2 actions are hidden in the following example.

Define metadata for Action menu in formatVersion2 template settings

How do I use the variables template specification

Use variables to specify values that are reused multiple times within a template, such as in dynamic configurations. A variable definition can include plain strings, inputs, and refer to other variables. You reference the variables that you define in the resources and outputs sections of the template.
variables:
  applications:
    - name: App1
      port: 3000
      showAppInfo: true
    - name: App2
      port: 4000
      showAppInfo: false

How do I use the outputs template specification

Use outputs to define the deployment information that you want to make available to your user. All outputs are displayed on the deployment details page under User Events, except for __deploymentOverview values which appear under the deployment Overview.

The outputs example includes:
  • variables defined in the variables template specification
  • resources defined in a resources section and included in the following code sample
  • __deploymentOverview written in Markdown
outputs:
  secret1name:
    value: ${resource.secret-data1.object.metadata.name}
  secret2name:
    value: ${resource.secret-data2.object.metadata.name}
  __deploymentOverview:
    value: |
      ### Deployment details
      %{if starts_with(resource.CCI_Supervisor_Namespace_1.name, 'dummy')} 
        This is a dummy namespace with name ${resource.CCI_Supervisor_Namespace_1.name}
      %{else}
        This is a real namespace with name ${resource.CCI_Supervisor_Namespace_1.name}
      %{endif}

      %{for app in variable.applications}
        ##### App details
        %{if app.showAppInfo}
          App name - ${app.name}, App port - ${app.port}
        %{else}
          App info is hidden because showAppInfo is ${app.showAppInfo} 
        %{endif}
      %{endfor}

      #### Handle bars bindings.

      The below values will update dynamically if the values change.
      Note that we use '\{\{' to indicate handle bars expressions

      secret 1 resource version - {{resource.secret-data1.object.metadata.resourceVersion}}
resources:
  CCI_Supervisor_Namespace_1:
    type: CCI.Supervisor.Namespace
    properties:
      name: ${input.namespaceName}
      regionName: private-ai-foundation-dsdunnjz
      className: vpaif-quickstart-3
  secret-data1:
    type: CCI.Supervisor.Resource
    properties:
      context: ${resource.CCI_Supervisor_Namespace_1.id}
      manifest:
        apiVersion: v1
        kind: Secret
        metadata:
          name: nvaie-apikey
        type: Opaque
        stringData:
          username: $oauthtoken
          password: ${input.ngcPortalAccessKey}
  secret-data2:
    type: CCI.Supervisor.Resource
    properties:
      context: ${resource.CCI_Supervisor_Namespace_1.id}
      manifest:
        apiVersion: v1
        kind: Secret
        metadata:
          name: nvaie-apikey1
        type: Opaque
        stringData:
          username: $oauthtoken
          password: ${input.ngcPortalAccessKey}
The following construct examples are provided in the __deploymentOverview.
  • The if construct is a conditional expression based on boolean inputs.
          %{if starts_with(resource.CCI_Supervisor_Namespace_1.name, 'dummy')} 
            This is a dummy namespace with name ${resource.CCI_Supervisor_Namespace_1.name}
          %{else}
            This is a real namespace with name ${resource.CCI_Supervisor_Namespace_1.name}
          %{endif}
  • The for loop enables iterating over arrays. For every app listed in the array, if conditions are evaluated and variable values are assigned and displayed as output.
          %{for app in variable.applications}
            ##### App details
            %{if app.showAppInfo}
              App name - ${app.name}, App port - ${app.port}
            %{else}
              App info is hidden because showAppInfo is ${app.showAppInfo} 
            %{endif}
          %{endfor}
  • In the handlebars expression, variable bindings update dynamically as the actual values change. The variable is enclosed in double curly braces {{}} and in this example, the expression is a dot-separated path.
    secret 1 name - {{resource.secret-data1.object.metadata.resourceVersion}}

Where do template specifications appear in the UI

outputs that you defined appear in your deployment.
  • __deploymentOverview is a special kind of output that appears in the deployment Overview. Output:__deploymentOverview in formatVersion2 template settings
  • All other outputs such as secret1name and secret2name appear in the deployment under the User Events tab.

    Other outputs defined in formatVersion2 template settings