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
15 :introduced: casablanca
17 A VNF's Heat Orchestration Template **MUST** be compliant with the
18 OpenStack Template Guide.
20 The OpenStack Template Guide is defined at
21 https://docs.openstack.org/heat/latest/template_guide/index.html#top.
23 Heat Orchestration Template Structure
24 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26 Heat Orchestration template structure follows the following format, as
27 defined by OpenStack at
28 https://docs.openstack.org/developer/heat/template_guide/hot_spec.html.
32 heat_template_version: <date>
35 # a description of the template
38 # a declaration of input parameter groups and order
41 # declaration of input parameters
44 # declaration of template resources
47 # declaration of output parameters
50 # declaration of conditions
54 ~~~~~~~~~~~~~~~~~~~~~~~
61 :validation_mode: static
63 A VNF's Heat Orchestration template **MUST** contain the
64 section ``heat_template_version:``.
66 The section ``heat_template_version:`` must be set to a date that
67 is supported by the OpenStack environment.
76 :validation_mode: static
78 A VNF's Heat Orchestration Template **MUST** contain the
79 section ``description:``.
82 ~~~~~~~~~~~~~~~~~~~~~~
84 A VNF Heat Orchestration template may
85 contain the section "parameter_groups:".
88 ~~~~~~~~~~~~~~~~~~~~~~
94 :validation_mode: static
96 A VNF Heat Orchestration's template **MUST** contain the
97 section ``parameters:``.
106 type: <string | number | json | comma_delimited_list | boolean>
108 label: <human-readable name of the parameter>
110 description: <description of the parameter>
112 default: <default value for parameter>
114 hidden: <true | false>
118 <parameter constraints>
120 immutable: <true | false>
122 This section allows for
123 specifying input parameters that have to be provided when instantiating
124 the template. Each parameter is specified in a separate nested block
125 with the name of the parameters defined in the first line and additional
126 attributes (e.g., type, label) defined as nested elements.
133 :validation_mode: static
136 A VNF Heat Orchestration's template's parameter **MUST** be used
137 in a resource with the exception of the parameters for the
138 ``OS::Nova::Server`` resource property ``availability_zone``.
146 A VNF Heat Orchestration's template's parameter for the
147 ``OS::Nova::Server`` resource property ``availability_zone``
148 **MAY NOT** be used in any ``OS::Nova::Server``.
150 That is, the parameter associated with the property ``availability_zone``
151 maybe declared but not used in a resource.
156 The name of the parameter.
163 :validation_mode: static
165 A VNF's Heat Orchestration Template's parameter name
166 (i.e., <param name>) **MUST** contain only alphanumeric
167 characters and underscores ('_').
177 :validation_mode: static
179 A VNF's Heat Orchestration Template's parameter **MUST** include the
186 :validation_mode: static
189 A VNF's Heat Orchestration Template's parameter type **MUST** be one of
190 the following values:
195 * ``comma_delimited_list``
207 A VNF's Heat Orchestration Template parameter declaration **MAY**
208 contain the attribute ``label:``.
218 :validation_mode: static
220 A VNF's Heat Orchestration Template parameter declaration **MUST**
221 contain the attribute ``description``.
223 Note that the parameter attribute ``description:`` is an OpenStack optional
224 attribute that provides a description of the parameter.
225 ONAP implementation requires this attribute.
235 :validation_mode: static
237 A VNF Heat Orchestration Template parameter declaration **MUST NOT**
238 contain the ``default`` attribute.
244 :validation_mode: static
247 If a VNF Heat Orchestration Template parameter has a default value,
248 it **MUST** be enumerated in the environment file.
250 Note that the parameter attribute ``default:`` is an OpenStack optional
251 attribute that declares the default value of the parameter.
252 ONAP implementation prohibits the use of this attribute.
263 A VNF's Heat Orchestration Template parameter declaration **MAY**
264 contain the attribute ``hidden:``.
266 The parameter attribute ``hidden:`` is an OpenStack optional attribute that
267 defines whether the parameters should be hidden when a user requests
268 information about a stack created from the template.
269 This attribute can be used to hide passwords specified as parameters.
274 The parameter attribute ``constraints:`` is an OpenStack optional attribute
275 that defines a list of constraints to apply to the parameter.
282 :validation_mode: static
285 A VNF's Heat Orchestration Template's parameter defined
286 in a non-nested YAML file as type
287 ``number`` **MUST** have a parameter constraint of ``range`` or
288 ``allowed_values`` defined.
296 A VNF's Heat Orchestration Template's parameter defined
297 in a non-nested YAML file as type
298 ``string`` **MAY** have a parameter constraint defined.
306 A VNF's Heat Orchestration Template's parameter defined
307 in a non-nested YAML file as type
308 ``json`` **MAY** have a parameter constraint defined.
316 A VNF's Heat Orchestration Template's parameter defined
317 in a non-nested YAML file as
318 type ``comma_delimited_list`` **MAY** have a parameter constraint defined.
326 A VNF's Heat Orchestration Template's parameter defined
327 in a non-nested YAML file as type
328 ``boolean`` **MAY** have a parameter constraint defined.
334 :validation_mode: static
337 A VNF's Heat Orchestration Template's parameter defined
338 in a nested YAML file
339 **MUST NOT** have a parameter constraint defined.
341 The constraints block of a parameter definition defines additional
342 validation constraints that apply to the value of the parameter.
343 The parameter values provided in the VNF Heat Orchestration Template are
344 validated against the constraints at instantiation time.
345 The stack creation fails if the parameter value doesn't comply to
348 The constraints are defined as a list with the following syntax
354 <constraint type>: <constraint definition>
356 description: <constraint description>
360 **<constraint type>** Provides the type of constraint to apply.
361 The list of OpenStack supported constraints can be found at
362 https://docs.openstack.org/heat/latest/template_guide/hot_spec.html .
364 **<constraint definition>** provides the actual constraint.
365 The syntax and constraint is dependent of the <constraint type> used.
367 **description:** is an optional attribute that provides a description of
368 the constraint. The text is presented to the user when the value the user
369 defines violates the constraint. If omitted, a default validation message is
370 presented to the user.
374 Below is a brief overview of the ``range`` and ``allowed values`` constraints.
375 For complete details on constraints, see
376 https://docs.openstack.org/heat/latest/template_guide/hot_spec.html#parameter-constraints
381 ``range``: The ``range`` constraint applies to parameters of ``type: number``.
382 It defines a lower and upper limit for the numeric value of the parameter.
383 The syntax of the ``range`` constraint is
387 range: { min: <lower limit>, max: <upper limit> }
391 It is possible to define a range constraint with only a lower limit or an
396 ``allowed_values``: The ``allowed_values`` constraint applies to parameters of
397 type ``string`` or type ``number``. It specifies a set of possible values
398 for a parameter. At deployment time, the user-provided value for the
399 respective parameter must match one of the elements of the list.
400 The syntax of the ``allowed_values`` constraint is
404 allowed_values: [ <value>, <value>, ... ]
406 Alternatively, the following YAML list notation can be used
425 A VNF's Heat Orchestration Template parameter declaration
426 **MAY** contain the attribute ``immutable:``.
428 The parameter attribute ``immutable`` is an OpenStack optional attribute
429 that defines whether the parameter is updatable. A Heat Orchestration Template
430 stack update fails if ``immutable`` is set to ``true`` and the parameter
431 value is changed. This attribute ``immutable`` defaults to ``false``.
443 :validation_mode: static
445 A VNF's Heat Orchestration template **MUST**
446 contain the section ``resources:``.
452 :validation_mode: static
454 A VNF's Heat Orchestration Template's
455 ``resources:`` section **MUST** contain the declaration of at
464 A VNF's Heat Orchestration Template's Nested YAML files **MAY**
465 (or **MAY NOT**) contain the section ``resources:``.
467 Each resource is defined as a
468 separate block in the resources section with the following syntax.
476 type: <resource type>
480 <property name>: <property value>
484 <resource specific metadata>
486 depends_on: <resource ID or list of ID>
488 update_policy: <update policy>
490 deletion_policy: <deletion policy>
492 external_id: <external resource ID>
494 condition: <condition name or expression or boolean>
504 :validation_mode: static
506 A VNF's Heat Orchestration Template's resource name
507 (i.e., <resource ID>) **MUST** only contain alphanumeric
508 characters and underscores ('_').
514 :validation_mode: static
516 A VNF's <resource ID> **MUST** be unique across all Heat
517 Orchestration Templates and all HEAT Orchestration Template
518 Nested YAML files that are used to create the VNF.
520 Note that a VNF can be composed of one or more Heat Orchestration Templates.
522 Note that OpenStack requires the <resource ID> to be unique to the
523 Heat Orchestration Template and not unique across all Heat
524 Orchestration Templates the compose the VNF.
529 The resource attribute ``type`` is an OpenStack required attribute that
530 defines the resource type, such as ``OS::Nova::Server`` or
531 ``OS::Neutron::Port``.
533 The resource attribute ``type`` may specify a VNF HEAT
534 Orchestration Template Nested YAML file.
541 :validation_mode: static
543 A VNF's Heat Orchestration Template's Resource
544 **MUST NOT** reference a HTTP-based resource definitions.
550 :validation_mode: static
552 A VNF's Heat Orchestration Template's Resource
553 **MUST NOT** reference a HTTP-based Nested YAML file.
558 The resource attribute ``properties`` is an OpenStack optional attribute that
559 provides a list of resource-specific properties. The property value can
560 be provided in place, or via a function
561 (e.g., `Intrinsic functions <https://docs.openstack.org/developer/heat/template_guide/hot_spec.html#hot-spec-intrinsic-functions>`__).
568 :validation_mode: static
571 If a VNF's Heat Orchestration Template resource attribute
572 ``property:`` uses a nested ``get_param``, the nested
573 ``get_param`` **MUST** reference an index.
578 The resource attribute ``metadata`` is an OpenStack optional attribute.
584 :validation_mode: static
585 :introduced: casablanca
587 A VNF's Heat Orchestration Template's Resource **MAY** declare the
588 attribute ``metadata``.
593 The resource attribute ``depends_on`` is an OpenStack optional attribute.
594 See `Section <https://docs.openstack.org/developer/heat/template_guide/hot_spec.html#hot-spec-resources-dependencies>`__ 9.7 for additional details.
601 VNF's Heat Orchestration Template's Resource **MAY** declare the
602 attribute ``depends_on:``.
613 VNF's Heat Orchestration Template's Resource **MAY** declare the
614 attribute ``update_policy:``.
626 VNF's Heat Orchestration Template's Resource **MAY** declare the
627 attribute ``deletion_policy:``.
629 If specified, the ``deletion_policy`` attribute for resources allows
630 values ``Delete``, ``Retain``, and ``Snapshot``.
631 Starting with heat_template_version 2016-10-14,
632 lowercase equivalents are also allowed.
634 The default policy is to delete the physical resource when
635 deleting a resource from the stack.
647 VNF's Heat Orchestration Template's Resource **MAY** declare the
648 attribute ``external_id:``.
650 This attribute allows for specifying the resource_id for an existing external
651 (to the stack) resource. External resources cannot depend on other resources,
652 but we allow other resources to depend on external resource. This attribute
653 is optional. Note: when this is specified, properties will not be used for
654 building the resource and the resource is not managed by Heat. This is not
655 possible to update that attribute. Also, resource won't be deleted by
656 heat when stack is deleted.
662 The resource attribute ``condition`` is an OpenStack optional attribute.
673 A VNF's Heat Orchestration template **MAY** contain the ``outputs:``
676 This section allows for specifying output parameters
677 available to users once the template has been instantiated. If the
678 section is specified, it will need to adhere to specific requirements.
679 See :ref:`Output Parameters` and
680 :ref:`ONAP Output Parameter Names` for additional details.
682 Environment File Format
683 ^^^^^^^^^^^^^^^^^^^^^^^^^^
685 A VNF's Heat Orchestration Template's environment file is a yaml text file.
686 (https://docs.openstack.org/developer/heat/template_guide/environment.html)
693 :validation_mode: static
696 A VNF's Heat Orchestration template **MUST** have a
697 corresponding environment file.
699 The use of an environment file in OpenStack is optional. In ONAP, it is
700 mandatory. A Heat Orchestration Template uploaded to ONAP must have a
701 corresponding environment file, even if no parameters are enumerated in
702 the mandatory parameter section.
709 :validation_mode: static
712 A VNF's Heat Orchestration template's Environment File **MUST**
713 contain the ``parameters:`` section.
721 A VNF's Heat Orchestration template's Environment File's
722 ``parameters:`` section **MAY** (or **MAY NOT**) enumerate parameters.
724 ONAP implementation requires the parameters section in the environmental
725 file to be declared. The parameters section contains a list of key/value
734 A VNF's Heat Orchestration template's Environment File's
735 **MAY** contain the ``parameter_defaults:`` section.
737 The ``parameter_defaults:`` section contains default parameters that are
738 passed to all template resources.
746 A VNF's Heat Orchestration template's Environment File's
747 **MAY** contain the ``encrypted_parameters:`` section.
749 The ``encrypted_parameters:`` section contains a list of encrypted parameters.
757 A VNF's Heat Orchestration template's Environment File's
758 **MAY** contain the ``event_sinks:`` section.
760 The ``event_sinks:`` section contains the list of endpoints that would receive
769 A VNF's Heat Orchestration template's Environment File's
770 **MAY** contain the ``parameter_merge_strategies:`` section.
772 The ``parameter_merge_strategies:`` section provides the merge strategies for
773 merging parameters and parameter defaults from the environment file.
780 :validation_mode: static
782 A VNF's Heat Orchestration template's Environment File's
783 **MUST NOT** contain the ``resource_registry:`` section.
785 ONAP implementation does not support the Environment File resource_registry
786 section. The resource_registry section allows for the definition of custom
789 SDC Treatment of Environment Files
790 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
792 Parameter values enumerated in the environment file are used by SDC as
793 the default value. However, the SDC user may use the SDC GUI to
794 overwrite the default values in the environment file.
796 SDC generates a new environment file for distribution to MSO based on
797 the uploaded environment file and the user provided GUI updates. The
798 user uploaded environment file is discarded when the new file is
801 ONAP has requirements for what parameters must be enumerated in the
802 environment file and what parameter must not be enumerated in the
803 environment file. See :ref:`Output Parameters` and
804 :ref:`ONAP Heat Resource ID and Parameter Naming Convention` for more details.