members: [ apache, server ] policies: - my_scaling_policy: # Specific policy definitions are considered domain specific and # are not included here The example first of all uses the concept of grouping to express which components (node templates) need to be scaled as a unit i.e. the compute nodes and the software on-top of each compute node. This is done by – defining the in the section of the template and by adding both the node webserver_group groups apache template and the node template as a member to the group. server Furthermore, a scaling policy is defined for the group to express that the group as a whole (i.e. pairs of server node and the component installed on top) should scale up or down under certain conditions. apache In where no explicit binding between software components and their hosting compute resources is defined in a template, but only requirements are defined as has been shown in section 11, a provider could decide to place software components on the same host if their hosting requirements match, or to place them onto different hosts. It is often desired, though, to influence placement at deployment time to make sure components get collocation or anti-collocated. This can be expressed via grouping and policies as shown in the example below. tosca_definitions_version: tosca_simple_yaml_1_0_0 description: Template hosting requirements and placement policy. inputs: # omitted here for sake of brevity node_templates: wordpress: type: properties: # omitted here for sake of brevity requirements: - host: tosca.nodes.Compute constraints: mem_size: { greater_or_equal: 2 } os_arch: x86_64 os_type: type:
members: [ apache, server ] policies: - my_scaling_policy: # Specific policy definitions are considered domain specific and # are not included here The example first of all uses the concept of grouping to express which components (node templates) need to be scaled as a unit – i.e. the compute nodes and the software on-top of each compute node. This is done by defining the webserver_group in the groups section of the template and by adding both the apache node template and the server node template as a member to the group. Furthermore, a scaling policy is defined for the group to express that the group as a whole (i.e. pairs of server node and the apache component installed on top) should scale up or down under certain conditions. In where no explicit binding between software components and their hosting compute resources is defined in a template, but only requirements are defined as has been shown in section 11, a provider could decide to place software components on the same host if their hosting requirements match, or to place them onto different hosts. It is often desired, though, to influence placement at deployment time to make sure components get collocation or anti-collocated. This can be expressed via grouping and policies as shown in the example below. tosca_definitions_version: tosca_simple_yaml_1_0_0 description: Template hosting requirements and placement policy. inputs: # omitted here for sake of brevity node_templates: wordpress: type: properties: # omitted here for sake of brevity requirements: - host: tosca.nodes.Compute constraints: mem_size: { greater_or_equal: 2 } os_arch: x86_64 os_type: type:
TOSCA-Simple-Profile-YAML-v1.0-wd02-Rev-20.docx