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 .. _Nova Server - Metadata Parameters:
 
   7 Resource: OS::Nova::Server Metadata Parameters
 
   8 --------------------------------------------------------------------------------
 
  10 The ``OS::Nova::Server`` resource property ``metadata`` is an optional
 
  12 Table 2 summarizes the mandatory and optional ``metadata`` supported by ONAP.
 
  13 The sections that follow provides the requirements associated with each
 
  14 ``metadata`` parameter.
 
  17 .. csv-table:: **Table 2 OS::Nova::Server Mandatory and Optional Metadata**
 
  18    :header: Resource, Property, Parameter Name, Parameter Type, Required, Parameter Value Provided to Heat
 
  22    OS::Nova::Server, metadata, vnf_id, string, **MUST**, ONAP
 
  23    OS::Nova::Server, metadata, vf_module_id, string, **MUST**, ONAP
 
  24    OS::Nova::Server, metadata, vnf_name, string, **MUST**, ONAP
 
  25    OS::Nova::Server, metadata, vf_module_name, string, **SHOULD**, ONAP
 
  26    OS::Nova::Server, metadata, vm_role, string, **MAY**, YAML or Environment File
 
  27    OS::Nova::Server, metadata, vf_module_index, number, **MAY**, ONAP
 
  28    OS::Nova::Server, metadata, workload_context, string, **MUST**, ONAP
 
  29    OS::Nova::Server, metadata, environment_context, string, **MUST**, ONAP
 
  34 The ``OS::Nova::Server`` resource property ``metadata`` key/value pair
 
  35 ``vnf_id`` is an ONAP generated UUID that identifies the VNF.  The value
 
  36 is provided by ONAP to the VNF's Heat Orchestration
 
  37 Template at orchestration time.
 
  43     :validation_mode: static
 
  46     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  47     resource property ``metadata`` **MUST**
 
  48     contain the  key/value pair ``vnf_id``
 
  49     and the value **MUST** be obtained via a ``get_param``.
 
  55     :validation_mode: static
 
  58     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  60     ``metadata`` key/value pair ``vnf_id`` parameter
 
  61     **MUST** be declared as ``vnf_id`` and the parameter **MUST**
 
  62     be defined as type: ``string``.
 
  68     :validation_mode: static
 
  71     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  73     ``metadata`` key/value pair ``vnf_id`` parameter ``vnf_id`` **MUST NOT**
 
  74     have parameter constraints defined.
 
  80     :validation_mode: static
 
  83     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  85     ``metadata`` key/value pair ``vnf_id`` parameter ``vnf_id`` **MUST NOT**
 
  86     be enumerated in the Heat Orchestration Template's environment file.
 
  88 *Example 'vnf_id' Parameter Definition*
 
  96       description: Unique ID for this VNF instance
 
 101 The OS::Nova::Server Resource ``metadata`` map value parameter ``vf_module_id``
 
 102 is an ONAP generated UUID that identifies the VF Module (e.g., Heat
 
 103 Orchestration Template).  The value
 
 104 is provided by ONAP to the VNF's Heat Orchestration
 
 105 Template at orchestration time.
 
 111     :validation_mode: static
 
 114     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 115     property ``metadata`` **MUST**
 
 116     contain the key/value pair ``vf_module_id``
 
 117     and the value MUST be obtained via a ``get_param``.
 
 123     :validation_mode: static
 
 126     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 127     ``metadata`` key/value pair ``vf_module_id`` parameter **MUST**
 
 128     be declared as ``vf_module_id`` and the parameter **MUST**
 
 129     be defined as type: ``string``.
 
 135     :validation_mode: static
 
 138     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 139     ``metadata`` key/value pair ``vf_module_id`` parameter ``vf_module_id``
 
 141     have parameter constraints defined.
 
 147     :validation_mode: static
 
 150     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 151     ``metadata`` key/value pair ``vf_module_id`` parameter ``vf_module_id``
 
 153     be enumerated in the Heat Orchestration Template's environment file.
 
 155 *Example 'vf_module_id' Parameter Definition*
 
 163       description: Unique ID for this VNF module instance
 
 169 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter ``vnf_name``
 
 170 is the ONAP (SDN-C) generated alphanumeric name of the deployed VNF instance.
 
 172 is provided by ONAP to the VNF's Heat Orchestration
 
 173 Template at orchestration time.
 
 179     :validation_mode: static
 
 182     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 183     ``metadata`` **MUST** contain the key/value pair ``vnf_name`` and the
 
 184     value **MUST** be obtained via a ``get_param``.
 
 190     :validation_mode: static
 
 193     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 194     property ``metadata`` key/value pair ``vnf_name`` parameter **MUST**
 
 195     be declared as ``vnf_name`` and the parameter **MUST** be defined as
 
 202     :validation_mode: static
 
 205     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 206     property ``metadata`` key/value pair ``vnf_name``
 
 207     parameter ``vnf_name`` **MUST NOT**
 
 208     have parameter constraints defined.
 
 214     :validation_mode: static
 
 217     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 218     property ``metadata`` key/value pair ``vnf_name`` parameter
 
 219     ``vnf_name`` **MUST NOT**
 
 220     be enumerated in the Heat Orchestration Template's environment file.
 
 223 *Example 'vnf_name' Parameter Definition*
 
 231       description: Unique name for this VNF instance
 
 236 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter
 
 238 is the deployment name of the heat stack created (e.g., ``<STACK_NAME>``)
 
 240 VNF's Heat Orchestration template
 
 241 in the command ``Heat stack-create``
 
 242 (e.g., ``Heat stack-create [-f <FILE>] [-e <FILE>] <STACK_NAME>``).
 
 243 The ``vf_module_name`` (e.g., ``<STACK_NAME>`` is specified as
 
 244 part of the orchestration process.
 
 252     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 253     property metadata **SHOULD** contain the key/value pair ``vf_module_name``.
 
 259     :validation_mode: static
 
 263     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 264     property ``metadata`` key/value pair ``vf_module_name``
 
 266     be obtained via a ``get_param``.
 
 272     :validation_mode: static
 
 275     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 277     ``metadata`` key/value pair ``vf_module_name`` parameter **MUST** be
 
 278     declared as ``vf_module_name`` and the parameter **MUST**
 
 279     be defined as type: ``string``.
 
 285     :validation_mode: static
 
 288     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 290     ``metadata`` key/value pair ``vf_module_name`` parameter ``vf_module_name``
 
 291     **MUST NOT** have parameter constraints defined.
 
 297     :validation_mode: static
 
 301     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 302     property ``metadata`` key/value pair ``vf_module_name``
 
 303     parameter ``vf_module_name`` **MUST NOT**
 
 304     be enumerated in the Heat Orchestration Template's environment file.
 
 307 *Example 'vf_module_name' Parameter Definition*
 
 315       description: Unique name for this VNF Module instance
 
 320 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter ``vm_role``
 
 321 is a ``metadata`` tag that describes the role of the Virtual Machine.
 
 329     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 331     contain the key/value pair ``vm_role`` and the value **MUST** be
 
 335     - hard coded in the key/value pair ``vm_role``.
 
 341     :validation_mode: none
 
 344     If a VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
 346     ``metadata`` key/value pair ``vm_role`` value is obtained via
 
 347     ``get_param``, the parameter **MAY** be declared as
 
 349     * ``vm_role`` and the parameter defined as ``type: string``.
 
 350     * ``vm_roles`` and the parameter defined as ``type: comma_delimited_list``.
 
 351     * ``{vm-type}_vm_role`` and the parameter defined as ``type: string``.
 
 357     :validation_mode: static
 
 360     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 361     property ``metadata`` key/value pair ``vm_role`` parameter ``vm_role``
 
 362     **MUST NOT** have parameter constraints defined.
 
 364 Defining the ``vm_role`` as the ``{vm-type}`` is a recommended convention
 
 371     :validation_mode: static
 
 374     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 375     property ``metadata`` key/value pair ``vm_role`` value **MUST**
 
 376     only contain alphanumeric characters and underscores (i.e., '_').
 
 379 *Example 'vm_role' Parameter Definition*
 
 387       description: Unique role for this VM
 
 389 *Example: 'vm_role' Definition: Hard Coded in
 
 390 OS::Nova::Resource metadata property*
 
 397       type: OS::Nova::Server
 
 403 *Example 'vm_role' Definition: Defined in Environment file
 
 404 and retrieved via 'get_param'*
 
 411       type: OS::Nova::Server
 
 415           vm_role: { get_param: vm_role }
 
 417 Example vnf_id, vf_module_id, vnf_name, vf_module_name, vm_role
 
 418 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 420 The example below depicts part of a Heat Orchestration Template that
 
 421 uses the five of the ``OS::Nova::Server`` resource
 
 422 ``metadata`` map value parameters discussed in this
 
 423 section. The ``{vm-type}`` has been defined as ``lb`` for load balancer.
 
 430       description: VM Name for lb VM 0
 
 433       description: Unique name for this VNF instance
 
 436       description: Unique ID for this VNF instance
 
 439       description: Unique name for this VNF Module instance
 
 442       description: Unique ID for this VNF Module instance
 
 445       description: Unique role for this VM
 
 448       type: OS::Nova::Server
 
 450         name: { get_param: lb_name_0 }
 
 453           vnf_name: { get_param: vnf_name }
 
 454           vnf_id: { get_param: vnf_id }
 
 455           vf_module_name: { get_param: vf_module_name }
 
 456           vf_module_id: { get_param: vf_module_id }
 
 469     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
 470     resource  property ``metadata`` **MAY**
 
 471     contain the key/value pair ``vf_module_index``.
 
 478     :validation_mode: static
 
 481     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
 482     resource  property ``metadata``
 
 483     key/value pair ``vf_module_index``
 
 484     value **MUST** be obtained via a ``get_param``.
 
 490     :validation_mode: static
 
 493     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 495     ``metadata`` key/value pair ``vf_module_index`` parameter **MUST**
 
 496     be declared as ``vf_module_index`` and the parameter **MUST** be
 
 497     defined as type: ``number``.
 
 504     :validation_mode: static
 
 508     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 509     property ``metadata`` key/value pair ``vf_module_index`` **MUST NOT**
 
 510     have parameter constraints defined.
 
 516     :validation_mode: static
 
 519     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 521     ``metadata`` key/value pair ``vf_module_index`` parameter
 
 522     ``vf_module_index`` **MUST NOT**
 
 523     be enumerated in the Heat Orchestration Template's environment file.
 
 529     :validation_mode: static
 
 532     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 533     property ``metadata`` key/value pair ``vf_module_index`` **MUST NOT**
 
 534     be used in a ``OS::Cinder::Volume`` resource and **MUST NOT** be
 
 535     used in VNF's Volume template;
 
 538 The ``vf_module_index`` parameter indicates which instance of the module is
 
 539 being deployed into the VNF.
 
 540 This parameter may be used in cases where multiple instances of the same
 
 541 incremental module may be instantiated for scaling purposes. The index
 
 542 can be used in the Heat Orchestration Template for indexing into a
 
 543 pseudo-constant array parameter when unique values are required for each
 
 544 module instance, e.g., for fixed private IP addresses on VM types.
 
 546 The ``vf_module_index`` will start at 0 for the first instance of a module
 
 547 type. Subsequent instances of the same module type will receive the
 
 548 lowest unused index. This means that indexes will be reused if a module
 
 549 is deleted and re-added. As an example, if three copies of a module are
 
 550 deployed with ``vf_module_index`` values of 0, 1, and 2 then subsequently
 
 551 the second one is deleted (index 1), and then re-added, index 1 will be
 
 556 In this example, the ``{vm-type}`` has been defined as ``oam_vm`` to represent
 
 557 an OAM VM. An incremental heat module is used to deploy the OAM VM. The
 
 558 OAM VM attaches to an internal control network which has a
 
 559 ``{network-role}`` of ``ctrl``. A maximum of four OAM VMs can be deployed. The
 
 560 environment file contains the four IP addresses that each successive OAM
 
 561 VM will be assigned. The ``vf_module_index`` is used as the index to
 
 562 determine the IP assignment.
 
 569     oam_vm_int_ctrl_ips: 10.10.10.1,10.10.10.2,10.10.10.3,10.10.10.4
 
 578       description: Unique index for this VNF Module instance
 
 581       description: VM Name for lb VM 0
 
 584       description: Neutron UUID for the internal control network
 
 586       type: comma_delimited_list
 
 587       description: Fixed IP assignments for oam VMs on the internal control
 
 591       type: OS::Nova::Server
 
 593         name: { get_param: oam_vm_name_0 }
 
 595           - port: { get_resource: oam_vm_0_int_ctrl_port_0 }
 
 598           vf_module_index: { get_param: vf_module_index }
 
 599     oam_vm_0_int_ctrl_port_0:
 
 600       type: OS::Neutron::Port
 
 602         network: { get_param: int_ctrl_net_id }
 
 603         fixed_ips: [ { "ip_address": {get_param: [ oam_vm_int_ctrl_ips, { get_param: vf_module_index} ]}}]
 
 606 ^^^^^^^^^^^^^^^^^^^^^
 
 614     A VNF's Heat Orchestration Template's OS::Nova::Server
 
 615     Resource **SHOULD** contain the metadata map value parameter
 
 622     :validation_mode: static
 
 625     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 626     property ``metadata`` key/value pair ``workload_context``
 
 628     be declared as ``workload_context`` and the parameter **MUST**
 
 629     be defined as type: ``string``.
 
 635     :validation_mode: static
 
 638     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 639     property ``metadata`` key/value pair ``workload_context``
 
 640     parameter ``workload_context`` **MUST NOT**
 
 641     have parameter constraints defined.
 
 647     :validation_mode: static
 
 651     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 652     property ``metadata`` key/value pair ``workload_context``
 
 653     parameter ``workload_context`` **MUST NOT**
 
 654     be enumerated in the Heat Orchestration Template's environment file.
 
 656 The 'workload\_context' parameter value will be chosen by the Service Model
 
 657 Distribution context client in VID and will be supplied to the
 
 658 Heat Orchestration Template by ONAP at orchestration time.
 
 660 *Example Parameter Definition*
 
 667       description: Workload Context for this VNF instance
 
 670 *Example OS::Nova::Server with metadata*
 
 677     {vm-type}_server_{index}:
 
 678        type: OS::Nova::Server
 
 685           vnf_name: { get_param: vnf_name }
 
 686           vnf_id: { get_param: vnf_id }
 
 687           vf_module_name: { get_param: vf_module_name }
 
 688           vf_module_id: { get_param: vf_module_id }
 
 689           workload_context: {get_param: workload_context}
 
 692 ^^^^^^^^^^^^^^^^^^^^^
 
 700     A VNF's Heat Orchestration Template's OS::Nova::Server
 
 701     Resource **SHOULD** contain the metadata map value parameter
 
 702     'environment_context'.
 
 708     :validation_mode: static
 
 711     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 712     property ``metadata`` key/value pair ``environment_context``
 
 713     parameter **MUST** be declared as ``environment_context`` and the
 
 714     parameter type **MUST** be defined as type: ``string``.
 
 720     :validation_mode: static
 
 723     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 724     property ``metadata``key/value pair ``environment_context``
 
 725     parameter ``environment_context`` **MUST NOT**
 
 726     have parameter constraints defined.
 
 732     :validation_mode: static
 
 735     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 737     ``metadata`` key/value pair ``environment_context`` **MUST NOT**
 
 738     be enumerated in the Heat Orchestration Template's environment file.
 
 740 The 'environment_context' parameter value will be defined by the
 
 741 service designer as part of the service model during the SDC
 
 742 on-boarding process and will be supplied to the Heat Orchestration
 
 743 Template by ONAP at orchestration time.
 
 746 *Example Parameter Definition*
 
 753       description: Environment Context for this VNF instance
 
 756 *Example OS::Nova::Server with metadata*
 
 763     {vm-type}_server_{index}:
 
 764        type: OS::Nova::Server
 
 771           vnf_name: { get_param: vnf_name }
 
 772           vnf_id: { get_param: vnf_id }
 
 773           vf_module_name: { get_param: vf_module_name }
 
 774           vf_module_id: { get_param: vf_module_id }
 
 775           workload_context: {get_param: workload_context}
 
 776           environment_context: {get_param: environment_context }