Updated on 2022-02-22 GMT+08:00

node_templates

The node_templates section is mandatory. It defines the set of objects, which are all elements, to be orchestrated in a template. An element can be an application or a cloud service resource.

Format of the node_templates section:

<Element name>:
  type: <Element type>
  properties: <Element properties>
  requirements: <Element dependency>
  condition: <Condition name>
Table 1 Parameter property description

Property

Mandatory

Type

Value Constraint

Description

Element name

Yes

String

Enter 1 to 48 characters. Only lowercase letters, digits, and hyphens (-) are allowed.

Each element name must be unique.

Element type

Yes

Cloud.*** (*** indicates an element names in Resource Indexes)

-

This parameter is used to specify the type of an orchestration object.

Element property

No

-

Property information is expanded based on element types. Each element type has its properties. For more information, see Resource Indexes.

The variable of a property can be obtained from the inputs section or by using the get_attribute function. If an element does not require a special property, you do not need to define properties.

Element dependency

No

-

This parameter is used to specify the name of another element that has a dependency with the current element.

If there is no relationship between elements, you do not need to define this parameter. The dependency between elements is based on the defined element type. Related dependencies can be defined for specific types.

NOTE:

For example, when a subnet depends on a VPC, define the VPC as a dependent node in the requirements of the subnet.

requirements:  
  - vpcId:        
      node: myvpc

Condition name

No

String

Enter 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed.

If a condition is defined, the element is deployed only when the condition is met. For more information, see conditions.

Sample node_templates:

# Definitions of element objects
node_templates:
  myecs:
    type: Cloud.ECS.CloudServer
    properties:
      availabilityZone: ae-ad-1a
      flavor: c1.medium
      imageId: a3934478-bfeb-4a02-b257-9089779f0380
      instances: 1
      name: my-ecs
      nics:
        - subnetId:
            get_input: subnet
      rootVolume:
        size: 40
        volumeType: SATA
      vpcId:
        get_input: vpc