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 OpenStack
 
  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``.
 
  54     :validation_mode: static
 
  57     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  59     ``metadata`` key/value pair ``vnf_id`` parameter
 
  60     **MUST** be declared as ``vnf_id`` and the parameter **MUST**
 
  61     be defined as type: ``string``.
 
  67     :validation_mode: static
 
  70     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  72     ``metadata`` key/value pair ``vnf_id`` parameter ``vnf_id`` **MUST NOT**
 
  73     have parameter constraints defined.
 
  79     :validation_mode: static
 
  82     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  84     ``metadata`` key/value pair ``vnf_id`` parameter ``vnf_id`` **MUST NOT**
 
  85     be enumerated in the Heat Orchestration Template's environment file.
 
  91     :validation_mode: static
 
  94     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
  96     ``metadata`` key/value pair ``vnf_id`` is passed into a Nested YAML
 
  97     file, the key/value pair name ``vnf_id`` **MUST NOT** change.
 
  99 *Example 'vnf_id' Parameter Definition*
 
 107       description: Unique ID for this VNF instance
 
 112 The OS::Nova::Server Resource ``metadata`` map value parameter ``vf_module_id``
 
 113 is an ONAP generated UUID that identifies the VF Module (e.g., Heat
 
 114 Orchestration Template).  The value
 
 115 is provided by ONAP to the VNF's Heat Orchestration
 
 116 Template at orchestration time.
 
 122     :validation_mode: static
 
 125     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource 
 
 126     property ``metadata`` **MUST**
 
 127     contain the key/value pair ``vf_module_id``
 
 128     and the value MUST be obtained via a ``get_param``.
 
 134     :validation_mode: static
 
 137     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 138     ``metadata`` key/value pair ``vf_module_id`` parameter **MUST**
 
 139     be declared as ``vf_module_id`` and the parameter **MUST**
 
 140     be defined as type: ``string``.
 
 146     :validation_mode: static
 
 149     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 150     ``metadata`` key/value pair ``vf_module_id`` parameter ``vf_module_id``
 
 152     have parameter constraints defined.
 
 158     :validation_mode: static
 
 161     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 162     ``metadata`` key/value pair ``vf_module_id`` parameter ``vf_module_id``
 
 164     be enumerated in the Heat Orchestration Template's environment file.
 
 171     :validation_mode: static
 
 174     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 176     ``metadata`` key/value pair ``vf_module_id`` is passed into a
 
 178     file, the key/value pair name ``vf_module_id`` **MUST NOT** change.
 
 181 *Example 'vf_module_id' Parameter Definition*
 
 189       description: Unique ID for this VNF module instance
 
 195 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter ``vnf_name``
 
 196 is the ONAP (SDN-C) generated alphanumeric name of the deployed VNF instance.
 
 198 is provided by ONAP to the VNF's Heat Orchestration
 
 199 Template at orchestration time.
 
 205     :validation_mode: static
 
 208     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource **MUST**
 
 209     contain the ``metadata`` map value parameter ``vnf_name``.
 
 215     :validation_mode: static
 
 218     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 219     property ``metadata`` key/value pair ``vnf_name`` parameter **MUST**
 
 220     be declared as ``vnf_name`` and the parameter **MUST** be defined as
 
 227     :validation_mode: static
 
 230     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 231     property ``metadata`` key/value pair ``vnf_name`` 
 
 232     parameter ``vnf_name`` **MUST NOT**
 
 233     have parameter constraints defined.
 
 239     :validation_mode: static
 
 242     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 243     property ``metadata`` key/value pair ``vnf_name`` parameter
 
 244     ``vnf_name`` **MUST NOT**
 
 245     be enumerated in the Heat Orchestration Template's environment file.
 
 251     :validation_mode: static
 
 255     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 257     ``metadata`` key/value pair ``vnf_name`` is passed into a Nested YAML
 
 258     file, the key/value pair name ``vnf_name`` **MUST NOT** change.
 
 260 *Example 'vnf_name' Parameter Definition*
 
 268       description: Unique name for this VNF instance
 
 273 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter 
 
 275 is the deployment name of the heat stack created (e.g., ``<STACK_NAME>``)
 
 277 VNF's Heat Orchestration template
 
 278 in the command ``Heat stack-create``
 
 279 (e.g., ``Heat stack-create [-f <FILE>] [-e <FILE>] <STACK_NAME>``).
 
 280 The ``vf_module_name`` (e.g., ``<STACK_NAME>`` is specified as
 
 281 part of the orchestration process.
 
 289     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource 
 
 290     property ``metadata`` **SHOULD**
 
 291     contain the key/value pair ``vf_module_name`` and the value **MUST**
 
 292     be obtained via a ``get_param``.
 
 298     :validation_mode: static
 
 301     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 303     ``metadata`` key/value pair ``vf_module_name`` parameter **MUST** be
 
 304     declared as ``vf_module_name`` and the parameter **MUST**
 
 305     be defined as type: ``string``.
 
 311     :validation_mode: static
 
 314     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 316     ``metadata`` key/value pair ``vf_module_name`` parameter ``vf_module_name``
 
 317     **MUST NOT** have parameter constraints defined.
 
 323     :validation_mode: static
 
 326     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 327     ``metadata`` map value parameter ``vf_module_name`` **MUST NOT**
 
 328     be enumerated in the Heat Orchestration Template's environment file.
 
 334     :validation_mode: static
 
 337     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 338     property ``metadata`` key/value pair ``vf_module_name`` is passed into a
 
 340     file, the key/value pair name ``vf_module_name`` **MUST NOT** change.
 
 342 *Example 'vf_module_name' Parameter Definition*
 
 350       description: Unique name for this VNF Module instance
 
 355 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter ``vm-role``
 
 356 is a ``metadata`` tag that describes the role of the Virtual Machine.
 
 357 The ``vm_role`` is stored in ONAP’s A&AI module and is
 
 358 available for use by other ONAP components and/or north bound systems.
 
 366     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
 
 368     contain the key/value pair ``vm_role`` and the value **MUST** be 
 
 372     - hard coded in the key/value pair ``vm_role``.
 
 378     :validation_mode: static
 
 381     If a VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
 383     ``metadata`` key/value pair ``vm_role`` value is obtained via 
 
 384     ``get_param``, the parameter **MUST** be declared as ``vm_role`` 
 
 385     and the parameter **MUST** be defined as type: ``string``.
 
 391     :validation_mode: static
 
 394     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 395     property ``metadata`` key/value pair ``vm_role`` parameter ``vm_role``
 
 396     **MUST NOT** have parameter constraints defined.
 
 402     :validation_mode: static
 
 405     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 406     ``metadata`` map value parameter ``vm_role`` **MUST**
 
 409      * enumerated in the VNF's Heat Orchestration Template's environment
 
 412      * hard coded in the VNF's
 
 413        Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 414        ``metadata`` property.
 
 417 Defining the ``vm_role`` as the ``{vm-type}`` is a recommended convention
 
 424     :validation_mode: static
 
 427     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 428     ``metadata`` map value parameter ``vm_role`` value **MUST**
 
 429     only contain alphanumeric characters and underscores '_'.
 
 435     :validation_mode: static
 
 438     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 439     ``metadata`` map value parameter ``vm_role`` is passed into a Nested YAML
 
 440     file, the parameter name ``vm_role`` **MUST NOT** change.
 
 442 *Example 'vm_role' Parameter Definition*
 
 450       description: Unique role for this VM
 
 452 *Example: 'vm-role' Definition: Hard Coded in
 
 453 OS::Nova::Resource metadata property*
 
 460       type: OS::Nova::Server
 
 466 *Example 'vm-role' Definition: Defined in Environment file
 
 467 and retrieved via 'get_param'*
 
 474       type: OS::Nova::Server
 
 478           vm_role: { get_param: vm_role }
 
 480 Example vnf_id, vf_module_id, vnf_name, vf_module_name, vm_role
 
 481 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 483 The example below depicts part of a Heat Orchestration Template that
 
 484 uses the five of the ``OS::Nova::Server`` resource
 
 485 ``metadata`` map value parameters discussed in this
 
 486 section. The ``{vm-type}`` has been defined as ``lb`` for load balancer.
 
 493       description: VM Name for lb VM 0
 
 496       description: Unique name for this VNF instance
 
 499       description: Unique ID for this VNF instance
 
 502       description: Unique name for this VNF Module instance
 
 505       description: Unique ID for this VNF Module instance
 
 508       description: Unique role for this VM
 
 511       type: OS::Nova::Server
 
 513         name: { get_param: lb_name_0 }
 
 516           vnf_name: { get_param: vnf_name }
 
 517           vnf_id: { get_param: vnf_id }
 
 518           vf_module_name: { get_param: vf_module_name }
 
 519           vf_module_id: { get_param: vf_module_id }
 
 532     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
 533     resource  property ``metadata`` **MAY**
 
 534     contain the key/value pair ``vf_module_index``
 
 535     and the value **MUST** be obtained via a ``get_param``.
 
 541     :validation_mode: static
 
 544     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 545     ``metadata`` map value parameter ``vf_module_index`` **MUST**
 
 546     be declared as type: ``number``.
 
 552     :validation_mode: static
 
 556     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 557     property ``metadata`` key/value pair ``vf_module_index`` **MUST NOT**
 
 558     have parameter constraints defined.
 
 564     :validation_mode: static
 
 567     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 569     ``metadata`` key/value pair ``vf_module_index`` parameter
 
 570     ``vf_module_index`` **MUST NOT**
 
 571     be enumerated in the Heat Orchestration Template's environment file.
 
 577     :validation_mode: static
 
 580     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 581     property ``metadata`` key/value pair ``vf_module_index`` is passed into a
 
 582     Nested YAML file, the key/value pair
 
 583     ``vf_module_index`` **MUST NOT** change.
 
 589     :validation_mode: static
 
 592     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 593     property ``metadata`` key/value pair ``vf_module_index`` **MUST NOT**
 
 594     be used in a ``OS::Cinder::Volume`` resource and **MUST NOT** be
 
 595     used in VNF's Volume template;
 
 598 The ``vf_module_index`` parameter indicates which instance of the module is
 
 599 being deployed into the VNF.
 
 600 This parameter may be used in cases where multiple instances of the same
 
 601 incremental module may be instantiated for scaling purposes. The index
 
 602 can be used in the Heat Orchestration Template for indexing into a
 
 603 pseudo-constant array parameter when unique values are required for each
 
 604 module instance, e.g., for fixed private IP addresses on VM types.
 
 606 The ``vf_module_index`` will start at 0 for the first instance of a module
 
 607 type. Subsequent instances of the same module type will receive the
 
 608 lowest unused index. This means that indexes will be reused if a module
 
 609 is deleted and re-added. As an example, if three copies of a module are
 
 610 deployed with ``vf_module_index`` values of 0, 1, and 2 then subsequently
 
 611 the second one is deleted (index 1), and then re-added, index 1 will be
 
 616 In this example, the ``{vm-type}`` has been defined as ``oam_vm`` to represent
 
 617 an OAM VM. An incremental heat module is used to deploy the OAM VM. The
 
 618 OAM VM attaches to an internal control network which has a
 
 619 ``{network-role}`` of ``ctrl``. A maximum of four OAM VMs can be deployed. The
 
 620 environment file contains the four IP addresses that each successive OAM
 
 621 VM will be assigned. The ``vf_module_index`` is used as the index to
 
 622 determine the IP assignment.
 
 629     oam_vm_int_ctrl_ips: 10.10.10.1,10.10.10.2,10.10.10.3,10.10.10.4
 
 638       description: Unique index for this VNF Module instance
 
 641       description: VM Name for lb VM 0
 
 644       description: Neutron UUID for the internal control network
 
 646       type: comma_delimited_list
 
 647       description: Fixed IP assignments for oam VMs on the internal control
 
 651       type: OS::Nova::Server
 
 653         name: { get_param: oam_vm_name_0 }
 
 655           - port: { get_resource: oam_vm_0_int_ctrl_port_0 }
 
 658           vf_module_index: { get_param: vf_module_index }
 
 659     oam_vm_0_int_ctrl_port_0:
 
 660       type: OS::Neutron::Port
 
 662         network: { get_param: int_ctrl_net_id }
 
 663         fixed_ips: [ { "ip_address": {get_param: [ oam_vm_int_ctrl_ips, { get_param: vf_module_index} ]}}]
 
 666 ^^^^^^^^^^^^^^^^^^^^^
 
 674     A VNF's Heat Orchestration Template's OS::Nova::Server
 
 675     Resource **SHOULD** contain the metadata map value parameter
 
 682     :validation_mode: static
 
 685     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 686     ``metadata`` map value parameter ``workload_context`` **MUST**
 
 687     be declared as type: ``string``.
 
 693     :validation_mode: static
 
 696     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 697     property ``metadata`` key/value pair ``workload_context`` 
 
 698     parameter ``workload_context`` **MUST NOT**
 
 699     have parameter constraints defined.
 
 705     :validation_mode: static
 
 709     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 710     property ``metadata`` key/value pair ``workload_context`` 
 
 711     parameter ``workload_context`` **MUST NOT**
 
 712     be enumerated in the Heat Orchestration Template's environment file.
 
 718     :validation_mode: static
 
 721     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 722     property ``metadata`` key/value pair ``workload_context`` 
 
 723     is passed into a Nested YAML
 
 724     file, the key/value pair name ``workload_context`` **MUST NOT** change.
 
 727 The 'workload\_context' parameter value will be chosen by the Service Model
 
 728 Distribution context client in VID and will be supplied to the
 
 729 Heat Orchestration Template by ONAP at orchestration time.
 
 731 *Example Parameter Definition*
 
 738       description: Workload Context for this VNF instance
 
 741 *Example OS::Nova::Server with metadata*
 
 748     {vm-type}_server_{index}:
 
 749        type: OS::Nova::Server
 
 756           vnf_name: { get_param: vnf_name }
 
 757           vnf_id: { get_param: vnf_id }
 
 758           vf_module_name: { get_param: vf_module_name }
 
 759           vf_module_id: { get_param: vf_module_id }
 
 760           workload_context: {get_param: workload_context}
 
 763 ^^^^^^^^^^^^^^^^^^^^^
 
 771     A VNF's Heat Orchestration Template's OS::Nova::Server
 
 772     Resource **SHOULD** contain the metadata map value parameter
 
 773     'environment_context'.
 
 779     :validation_mode: static
 
 782     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 783     ``metadata`` map value parameter ``environment_context`` **MUST**
 
 784     be declared as type: ``string``.
 
 790     :validation_mode: static
 
 793     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
 794     property ``metadata``key/value pair ``environment_context``
 
 795     parameter ``environment_context`` **MUST NOT**
 
 796     have parameter constraints defined.
 
 802     :validation_mode: static
 
 805     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 806     ``metadata`` map value parameter ``environment_context`` **MUST NOT**
 
 807     be enumerated in the Heat Orchestration Template's environment file.
 
 813     :validation_mode: static
 
 816     If a VNF's Heat Orchestration Template's ``OS::Nova::Server Resource``
 
 817     ``metadata`` map value parameter ``environment_context`` is passed into a
 
 819     file, the parameter name ``environment_context`` **MUST NOT** change.
 
 821 The 'environment_context' parameter value will be defined by the
 
 822 service designer as part of the service model during the SDC
 
 823 on-boarding process and will be supplied to the Heat Orchestration
 
 824 Template by ONAP at orchestration time.
 
 827 *Example Parameter Definition*
 
 834       description: Environment Context for this VNF instance
 
 837 *Example OS::Nova::Server with metadata*
 
 844     {vm-type}_server_{index}:
 
 845        type: OS::Nova::Server
 
 852           vnf_name: { get_param: vnf_name }
 
 853           vnf_id: { get_param: vnf_id }
 
 854           vf_module_name: { get_param: vf_module_name }
 
 855           vf_module_id: { get_param: vf_module_id }
 
 856           workload_context: {get_param: workload_context}
 
 857           environment_context: {get_param: environment_context }