1 .. Licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2017 AT&T Intellectual Property. All rights reserved.
5 .. _ONAP Heat Orchestration Template Format:
7 ONAP Heat Orchestration Template Format
8 ------------------------------------------------
9 As stated above, Heat Orchestration templates must be defined in YAML.
14 :validation_mode: static
16 A VNF's Heat Orchestration Template **MUST** be compliant with the
17 OpenStack Template Guide.
19 The OpenStack Template Guide is defined at
20 https://docs.openstack.org/heat/latest/template_guide/index.html#top.
22 Heat Orchestration Template Structure
23 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 Heat Orchestration template structure follows the following format, as
26 defined by OpenStack at
27 https://docs.openstack.org/developer/heat/template_guide/hot_spec.html.
31 heat_template_version: <date>
34 # a description of the template
37 # a declaration of input parameter groups and order
40 # declaration of input parameters
43 # declaration of template resources
46 # declaration of output parameters
49 # declaration of conditions
53 ~~~~~~~~~~~~~~~~~~~~~~~
60 :validation_mode: static
62 A VNF's Heat Orchestration template **MUST** contain the
63 section ``heat_template_version:``.
65 The section ``heat_template_version:`` must be set to a date that
66 is supported by the OpenStack environment.
75 :validation_mode: static
77 A VNF's Heat Orchestration Template **MUST** contain the
78 section ``description:``.
81 ~~~~~~~~~~~~~~~~~~~~~~
83 A VNF Heat Orchestration template may
84 contain the section "parameter_groups:".
87 ~~~~~~~~~~~~~~~~~~~~~~
93 :validation_mode: static
95 A VNF Heat Orchestration's template **MUST** contain the
96 section ``parameters:``.
105 type: <string | number | json | comma_delimited_list | boolean>
107 label: <human-readable name of the parameter>
109 description: <description of the parameter>
111 default: <default value for parameter>
113 hidden: <true | false>
117 <parameter constraints>
119 immutable: <true | false>
121 This section allows for
122 specifying input parameters that have to be provided when instantiating
123 the template. Each parameter is specified in a separate nested block
124 with the name of the parameters defined in the first line and additional
125 attributes (e.g., type, label) defined as nested elements.
132 :validation_mode: static
134 A VNF Heat Orchestration's template's parameter **MUST** be used
135 in a resource with the exception of the parameters for the
136 ``OS::Nova::Server`` resource property ``availability_zone``.
143 A VNF Heat Orchestration's template's parameter for the
144 ``OS::Nova::Server`` resource property ``availability_zone``
145 **MAY NOT** be used in any ``OS::Nova::Server``.
147 That is, the parameter associated with the property ``availability_zone``
148 maybe declared but not used in a resource.
153 The name of the parameter.
160 :validation_mode: static
162 A VNF's Heat Orchestration Template's parameter name
163 (i.e., <param name>) **MUST** contain only alphanumeric
164 characters and underscores ('_').
174 :validation_mode: static
176 A VNF's Heat Orchestration Template's parameter **MUST** include the
183 :validation_mode: static
185 A VNF's Heat Orchestration Template's parameter type **MUST** be one of
186 the following values:
191 * ``comma_delimited_list``
203 A VNF's Heat Orchestration Template parameter declaration **MAY**
204 contain the attribute ``label:``.
214 :validation_mode: static
216 A VNF's Heat Orchestration Template parameter declaration **MUST**
217 contain the attribute ``description``.
219 Note that the parameter attribute ``description:`` is an OpenStack optional
220 attribute that provides a description of the parameter.
221 ONAP implementation requires this attribute.
231 :validation_mode: static
233 A VNF Heat Orchestration Template parameter declaration **MUST NOT**
234 contain the ``default`` attribute.
240 :validation_mode: static
242 If a VNF Heat Orchestration Template parameter has a default value,
243 it **MUST** be enumerated in the environment file.
245 Note that the parameter attribute ``default:`` is an OpenStack optional
246 attribute that declares the default value of the parameter.
247 ONAP implementation prohibits the use of this attribute.
258 A VNF's Heat Orchestration Template parameter declaration **MAY**
259 contain the attribute ``hidden:``.
261 The parameter attribute ``hidden:`` is an OpenStack optional attribute that
262 defines whether the parameters should be hidden when a user requests
263 information about a stack created from the template.
264 This attribute can be used to hide passwords specified as parameters.
269 The parameter attribute ``constraints:`` is an OpenStack optional attribute
270 that defines a list of constraints to apply to the parameter.
277 :validation_mode: static
279 A VNF's Heat Orchestration Template's parameter defined
280 in a non-nested YAML file as type
281 ``number`` **MUST** have a parameter constraint of ``range`` or
282 ``allowed_values`` defined.
289 A VNF's Heat Orchestration Template's parameter defined
290 in a non-nested YAML file as type
291 ``string`` **MAY** have a parameter constraint defined.
298 A VNF's Heat Orchestration Template's parameter defined
299 in a non-nested YAML file as type
300 ``json`` **MAY** have a parameter constraint defined.
307 A VNF's Heat Orchestration Template's parameter defined
308 in a non-nested YAML file as
309 type ``comma_delimited_list`` **MAY** have a parameter constraint defined.
316 A VNF's Heat Orchestration Template's parameter defined
317 in a non-nested YAML file as type
318 ``boolean`` **MAY** have a parameter constraint defined.
324 :validation_mode: static
326 A VNF's Heat Orchestration Template's parameter defined
327 in a nested YAML file
328 **MUST NOT** have a parameter constraint defined.
330 The constraints block of a parameter definition defines additional
331 validation constraints that apply to the value of the parameter.
332 The parameter values provided in the VNF Heat Orchestration Template are
333 validated against the constraints at instantiation time.
334 The stack creation fails if the parameter value doesn't comply to
337 The constraints are defined as a list with the following syntax
343 <constraint type>: <constraint definition>
345 description: <constraint description>
349 **<constraint type>** Provides the type of constraint to apply.
350 The list of OpenStack supported constraints can be found at
351 https://docs.openstack.org/heat/latest/template_guide/hot_spec.html .
353 **<constraint definition>** provides the actual constraint.
354 The syntax and constraint is dependent of the <constraint type> used.
356 **description:** is an optional attribute that provides a description of
357 the constraint. The text is presented to the user when the value the user
358 defines violates the constraint. If omitted, a default validation message is
359 presented to the user.
363 Below is a brief overview of the ``range`` and ``allowed values`` constraints.
364 For complete details on constraints, see
365 https://docs.openstack.org/heat/latest/template_guide/hot_spec.html#parameter-constraints
370 ``range``: The ``range`` constraint applies to parameters of ``type: number``.
371 It defines a lower and upper limit for the numeric value of the parameter.
372 The syntax of the ``range`` constraint is
376 range: { min: <lower limit>, max: <upper limit> }
380 It is possible to define a range constraint with only a lower limit or an
385 ``allowed_values``: The ``allowed_values`` constraint applies to parameters of
386 type ``string`` or type ``number``. It specifies a set of possible values
387 for a parameter. At deployment time, the user-provided value for the
388 respective parameter must match one of the elements of the list.
389 The syntax of the ``allowed_values`` constraint is
393 allowed_values: [ <value>, <value>, ... ]
395 Alternatively, the following YAML list notation can be used
414 A VNF's Heat Orchestration Template parameter declaration
415 **MAY** contain the attribute ``immutable:``.
417 The parameter attribute ``immutable`` is an OpenStack optional attribute
418 that defines whether the parameter is updatable. A Heat Orchestration Template
419 stack update fails if ``immutable`` is set to ``true`` and the parameter
420 value is changed. This attribute ``immutable`` defaults to ``false``.
432 :validation_mode: static
434 A VNF's Heat Orchestration template **MUST**
435 contain the section ``resources:``.
441 :validation_mode: static
443 A VNF's Heat Orchestration Template's
444 ``resources:`` section **MUST** contain the declaration of at
452 A VNF's Heat Orchestration Template's Nested YAML files **MAY**
453 (or **MAY NOT**) contain the section ``resources:``.
455 Each resource is defined as a
456 separate block in the resources section with the following syntax.
464 type: <resource type>
468 <property name>: <property value>
472 <resource specific metadata>
474 depends_on: <resource ID or list of ID>
476 update_policy: <update policy>
478 deletion_policy: <deletion policy>
480 external_id: <external resource ID>
482 condition: <condition name or expression or boolean>
492 :validation_mode: static
494 A VNF's Heat Orchestration Template's resource name
495 (i.e., <resource ID>) **MUST** only contain alphanumeric
496 characters and underscores ('_').
502 :validation_mode: static
504 A VNF's <resource ID> **MUST** be unique across all Heat
505 Orchestration Templates and all HEAT Orchestration Template
506 Nested YAML files that are used to create the VNF.
508 Note that a VNF can be composed of one or more Heat Orchestration Templates.
510 Note that OpenStack requires the <resource ID> to be unique to the
511 Heat Orchestration Template and not unique across all Heat
512 Orchestration Templates the compose the VNF.
517 The resource attribute ``type`` is an OpenStack required attribute that
518 defines the resource type, such as ``OS::Nova::Server`` or
519 ``OS::Neutron::Port``.
521 The resource attribute ``type`` may specify a VNF HEAT
522 Orchestration Template Nested YAML file.
529 :validation_mode: static
531 A VNF's Heat Orchestration Template's Resource
532 **MUST NOT** reference a HTTP-based resource definitions.
538 :validation_mode: static
540 A VNF's Heat Orchestration Template's Resource
541 **MUST NOT** reference a HTTP-based Nested YAML file.
546 The resource attribute ``properties`` is an OpenStack optional attribute that
547 provides a list of resource-specific properties. The property value can
548 be provided in place, or via a function
549 (e.g., `Intrinsic functions <https://docs.openstack.org/developer/heat/template_guide/hot_spec.html#hot-spec-intrinsic-functions>`__).
556 :validation_mode: static
558 If a VNF's Heat Orchestration Template resource attribute
559 ``property:`` uses a nested ``get_param``, the nested
560 ``get_param`` **MUST** reference an index.
565 The resource attribute ``metadata`` is an OpenStack optional attribute.
571 :validation_mode: static
573 A VNF's Heat Orchestration Template's Resource **MAY** declare the
574 attribute ``metadata``.
579 The resource attribute ``depends_on`` is an OpenStack optional attribute.
580 See `Section <https://docs.openstack.org/developer/heat/template_guide/hot_spec.html#hot-spec-resources-dependencies>`__ 9.7 for additional details.
587 VNF's Heat Orchestration Template's Resource **MAY** declare the
588 attribute ``depends_on:``.
599 VNF's Heat Orchestration Template's Resource **MAY** declare the
600 attribute ``update_policy:``.
611 VNF's Heat Orchestration Template's Resource **MAY** declare the
612 attribute ``deletion_policy:``.
614 If specified, the ``deletion_policy`` attribute for resources allows
615 values ``Delete``, ``Retain``, and ``Snapshot``.
616 Starting with heat_template_version 2016-10-14,
617 lowercase equivalents are also allowed.
619 The default policy is to delete the physical resource when
620 deleting a resource from the stack.
631 VNF's Heat Orchestration Template's Resource **MAY** declare the
632 attribute ``external_id:``.
634 This attribute allows for specifying the resource_id for an existing external
635 (to the stack) resource. External resources cannot depend on other resources,
636 but we allow other resources to depend on external resource. This attribute
637 is optional. Note: when this is specified, properties will not be used for
638 building the resource and the resource is not managed by Heat. This is not
639 possible to update that attribute. Also, resource won't be deleted by
640 heat when stack is deleted.
646 The resource attribute ``condition`` is an OpenStack optional attribute.
657 A VNF's Heat Orchestration template **MAY** contain the ``outputs:``
660 This section allows for specifying output parameters
661 available to users once the template has been instantiated. If the
662 section is specified, it will need to adhere to specific requirements.
663 See :ref:`Output Parameters` and
664 :ref:`ONAP Output Parameter Names` for additional details.
666 Environment File Format
667 ^^^^^^^^^^^^^^^^^^^^^^^^^^
669 A VNF's Heat Orchestration Template's environment file is a yaml text file.
670 (https://docs.openstack.org/developer/heat/template_guide/environment.html)
677 :validation_mode: static
679 A VNF's Heat Orchestration template **MUST** have a
680 corresponding environment file.
682 The use of an environment file in OpenStack is optional. In ONAP, it is
683 mandatory. A Heat Orchestration Template uploaded to ONAP must have a
684 corresponding environment file, even if no parameters are enumerated in
685 the mandatory parameter section.
692 :validation_mode: static
694 A VNF's Heat Orchestration template's Environment File **MUST**
695 contain the ``parameters:`` section.
702 A VNF's Heat Orchestration template's Environment File's
703 ``parameters:`` section **MAY** (or **MAY NOT**) enumerate parameters.
705 ONAP implementation requires the parameters section in the environmental
706 file to be declared. The parameters section contains a list of key/value
715 A VNF's Heat Orchestration template's Environment File's
716 **MAY** contain the ``parameter_defaults:`` section.
718 The ``parameter_defaults:`` section contains default parameters that are
719 passed to all template resources.
727 A VNF's Heat Orchestration template's Environment File's
728 **MAY** contain the ``encrypted_parameters:`` section.
730 The ``encrypted_parameters:`` section contains a list of encrypted parameters.
738 A VNF's Heat Orchestration template's Environment File's
739 **MAY** contain the ``event_sinks:`` section.
741 The ``event_sinks:`` section contains the list of endpoints that would receive
750 A VNF's Heat Orchestration template's Environment File's
751 **MAY** contain the ``parameter_merge_strategies:`` section.
753 The ``parameter_merge_strategies:`` section provides the merge strategies for
754 merging parameters and parameter defaults from the environment file.
761 :validation_mode: static
763 A VNF's Heat Orchestration template's Environment File's
764 **MUST NOT** contain the ``resource_registry:`` section.
766 ONAP implementation does not support the Environment File resource_registry
767 section. The resource_registry section allows for the definition of custom
770 SDC Treatment of Environment Files
771 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
773 Parameter values enumerated in the environment file are used by SDC as
774 the default value. However, the SDC user may use the SDC GUI to
775 overwrite the default values in the environment file.
777 SDC generates a new environment file for distribution to MSO based on
778 the uploaded environment file and the user provided GUI updates. The
779 user uploaded environment file is discarded when the new file is
782 ONAP has requirements for what parameters must be enumerated in the
783 environment file and what parameter must not be enumerated in the
784 environment file. See :ref:`Output Parameters` and
785 :ref:`ONAP Heat Resource ID and Parameter Naming Convention` for more details.