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 ``vnf_id`` **MUST**
 
  60     be declared as type: ``string``.
 
  66     :validation_mode: static
 
  69     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  71     ``metadata`` key/value pair ``vnf_id`` parameter ``vnf_id`` **MUST NOT**
 
  72     have parameter constraints defined.
 
  78     :validation_mode: static
 
  81     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
 
  83     ``metadata`` key/value pair ``vnf_id`` parameter ``vnf_id`` **MUST NOT**
 
  84     be enumerated in the Heat Orchestration Template's environment file.
 
  90     :validation_mode: static
 
  93     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
 
  95     ``metadata`` key/value pair ``vnf_id`` is passed into a Nested YAML
 
  96     file, the key/value pair name ``vnf_id`` **MUST NOT** change.
 
  98 *Example 'vnf_id' Parameter Definition*
 
 106       description: Unique ID for this VNF instance
 
 111 The OS::Nova::Server Resource ``metadata`` map value parameter ``vf_module_id``
 
 112 is an ONAP generated UUID that identifies the VF Module (e.g., Heat
 
 113 Orchestration Template).  The value
 
 114 is provided by ONAP to the VNF's Heat Orchestration
 
 115 Template at orchestration time.
 
 121     :validation_mode: static
 
 124     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource **MUST**
 
 125     contain the ``metadata`` map value parameter ``vf_module_id``.
 
 131     :validation_mode: static
 
 134     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 135     ``metadata`` map value parameter ``vf_module_id`` **MUST**
 
 136     be declared as type: ``string``.
 
 142     :validation_mode: static
 
 145     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 146     ``metadata`` map value parameter ``vf_module_id`` **MUST NOT**
 
 147     have parameter constraints defined.
 
 153     :validation_mode: static
 
 156     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 157     ``metadata`` map value parameter ``vf_module_id`` **MUST NOT**
 
 158     be enumerated in the Heat Orchestration Template's environment file.
 
 164     :validation_mode: static
 
 167     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 168     ``metadata`` map value parameter ``vf_module_id`` is passed into a
 
 170     file, the parameter name ``vf_module_id`` **MUST NOT** change.
 
 172 *Example 'vf_module_id' Parameter Definition*
 
 180       description: Unique ID for this VNF module instance
 
 186 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter ``vnf_name``
 
 187 is the ONAP (SDN-C) generated alphanumeric name of the deployed VNF instance.
 
 189 is provided by ONAP to the VNF's Heat Orchestration
 
 190 Template at orchestration time.
 
 196     :validation_mode: static
 
 199     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource **MUST**
 
 200     contain the ``metadata`` map value parameter ``vnf_name``.
 
 206     :validation_mode: static
 
 209     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 210     ``metadata`` map value parameter ``vnf_name`` **MUST**
 
 211     be declared as type: ``string``.
 
 217     :validation_mode: static
 
 220     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 221     ``metadata`` map value parameter ``vnf_name`` **MUST NOT**
 
 222     have parameter constraints defined.
 
 228     :validation_mode: static
 
 231     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 232     ``metadata`` map value parameter ``vnf_name`` **MUST NOT**
 
 233     be enumerated in the Heat Orchestration Template's environment file.
 
 239     :validation_mode: static
 
 242     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 243     ``metadata`` map value parameter ``vnf_name`` is passed into a Nested YAML
 
 244     file, the parameter name ``vnf_name`` **MUST NOT** change.
 
 246 *Example 'vnf_name' Parameter Definition*
 
 254       description: Unique name for this VNF instance
 
 259 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter 
 
 261 is the deployment name of the heat stack created (e.g., ``<STACK_NAME>``)
 
 263 VNF's Heat Orchestration template
 
 264 in the command ``Heat stack-create``
 
 265 (e.g., ``Heat stack-create [-f <FILE>] [-e <FILE>] <STACK_NAME>``).
 
 266 The ``vf_module_name`` (e.g., ``<STACK_NAME>`` is specified as
 
 267 part of the orchestration process.
 
 275     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource 
 
 277     contain the ``metadata`` map value parameter ``vf_module_name``.
 
 283     :validation_mode: static
 
 286     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 287     ``metadata`` map value parameter ``vf_module_name`` **MUST**
 
 288     be declared as type: ``string``.
 
 294     :validation_mode: static
 
 297     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 298     ``metadata`` map value parameter ``vf_module_name`` **MUST NOT**
 
 299     have parameter constraints defined.
 
 305     :validation_mode: static
 
 308     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 309     ``metadata`` map value parameter ``vf_module_name`` **MUST NOT**
 
 310     be enumerated in the Heat Orchestration Template's environment file.
 
 316     :validation_mode: static
 
 319     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 320     metadata map value parameter ``vf_module_name`` is passed into a Nested YAML
 
 321     file, the parameter name ``vf_module_name`` **MUST NOT** change.
 
 323 *Example 'vf_module_name' Parameter Definition*
 
 331       description: Unique name for this VNF Module instance
 
 336 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter ``vm-role``
 
 337 is a ``metadata`` tag that describes the role of the Virtual Machine.
 
 338 The ``vm_role`` is stored in ONAP’s A&AI module and is
 
 339 available for use by other ONAP components and/or north bound systems.
 
 347     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource **MAY**
 
 348     contain the ``metadata`` map value parameter ``vm_role``.
 
 354     :validation_mode: static
 
 357     A VNF's Heat Orchestration Template's OS::Nova::Server Resource
 
 358     ``metadata`` map value parameter ``vm_role`` **MUST**
 
 359     be declared as type: ``string``.
 
 365     :validation_mode: static
 
 368     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 369     ``metadata`` map value parameter ``vm_role`` **MUST NOT**
 
 370     have parameter constraints defined.
 
 376     :validation_mode: static
 
 379     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 380     ``metadata`` map value parameter ``vm_role`` **MUST**
 
 383      * enumerated in the VNF's Heat Orchestration Template's environment
 
 386      * hard coded in the VNF's
 
 387        Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 388        ``metadata`` property.
 
 391 Defining the ``vm_role`` as the ``{vm-type}`` is a recommended convention
 
 398     :validation_mode: static
 
 401     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 402     ``metadata`` map value parameter ``vm_role`` value **MUST**
 
 403     only contain alphanumeric characters and underscores '_'.
 
 409     :validation_mode: static
 
 412     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 413     ``metadata`` map value parameter ``vm_role`` is passed into a Nested YAML
 
 414     file, the parameter name ``vm_role`` **MUST NOT** change.
 
 416 *Example 'vm_role' Parameter Definition*
 
 424       description: Unique role for this VM
 
 426 *Example: 'vm-role' Definition: Hard Coded in
 
 427 OS::Nova::Resource metadata property*
 
 434       type: OS::Nova::Server
 
 440 *Example 'vm-role' Definition: Defined in Environment file
 
 441 and retrieved via 'get_param'*
 
 448       type: OS::Nova::Server
 
 452           vm_role: { get_param: vm_role }
 
 454 Example vnf_id, vf_module_id, vnf_name, vf_module_name, vm_role
 
 455 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 457 The example below depicts part of a Heat Orchestration Template that
 
 458 uses the five of the ``OS::Nova::Server`` resource
 
 459 ``metadata`` map value parameters discussed in this
 
 460 section. The ``{vm-type}`` has been defined as ``lb`` for load balancer.
 
 467       description: VM Name for lb VM 0
 
 470       description: Unique name for this VNF instance
 
 473       description: Unique ID for this VNF instance
 
 476       description: Unique name for this VNF Module instance
 
 479       description: Unique ID for this VNF Module instance
 
 482       description: Unique role for this VM
 
 485       type: OS::Nova::Server
 
 487         name: { get_param: lb_name_0 }
 
 490           vnf_name: { get_param: vnf_name }
 
 491           vnf_id: { get_param: vnf_id }
 
 492           vf_module_name: { get_param: vf_module_name }
 
 493           vf_module_id: { get_param: vf_module_id }
 
 506     A VNF's Heat Orchestration Template's ``OS::Nova::Server Resource`` **MAY**
 
 507     contain the metadata map value parameter ``vf_module_index``.
 
 513     :validation_mode: static
 
 516     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 517     ``metadata`` map value parameter ``vf_module_index`` **MUST**
 
 518     be declared as type: ``number``.
 
 524     :validation_mode: static
 
 527     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 528     ``metadata`` map value parameter ``vf_module_index`` **MUST NOT**
 
 529     have parameter constraints defined.
 
 535     :validation_mode: static
 
 538     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 539     ``metadata`` map value parameter ``vf_module_index`` **MUST NOT**
 
 540     be enumerated in the Heat Orchestration Template's environment file.
 
 546     :validation_mode: static
 
 549     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 550     ``metadata`` map value parameter ``vf_module_index`` is passed into a
 
 552     file, the parameter name ``vf_module_index`` **MUST NOT** change.
 
 558     :validation_mode: static
 
 561     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 562     ``metadata`` map value parameter ``vf_module_index`` **MUST NOT**
 
 564     VNF's Volume Template; it is not supported.
 
 566 The ``vf_module_index`` parameter indicates which instance of the module is
 
 567 being deployed into the VNF.
 
 568 This parameter may be used in cases where multiple instances of the same
 
 569 incremental module may be instantiated for scaling purposes. The index
 
 570 can be used in the Heat Orchestration Template for indexing into a
 
 571 pseudo-constant array parameter when unique values are required for each
 
 572 module instance, e.g., for fixed private IP addresses on VM types.
 
 574 The ``vf_module_index`` will start at 0 for the first instance of a module
 
 575 type. Subsequent instances of the same module type will receive the
 
 576 lowest unused index. This means that indexes will be reused if a module
 
 577 is deleted and re-added. As an example, if three copies of a module are
 
 578 deployed with ``vf_module_index`` values of 0, 1, and 2 then subsequently
 
 579 the second one is deleted (index 1), and then re-added, index 1 will be
 
 584 In this example, the ``{vm-type}`` has been defined as ``oam_vm`` to represent
 
 585 an OAM VM. An incremental heat module is used to deploy the OAM VM. The
 
 586 OAM VM attaches to an internal control network which has a
 
 587 ``{network-role}`` of ``ctrl``. A maximum of four OAM VMs can be deployed. The
 
 588 environment file contains the four IP addresses that each successive OAM
 
 589 VM will be assigned. The ``vf_module_index`` is used as the index to
 
 590 determine the IP assignment.
 
 597     oam_vm_int_ctrl_ips: 10.10.10.1,10.10.10.2,10.10.10.3,10.10.10.4
 
 606       description: Unique index for this VNF Module instance
 
 609       description: VM Name for lb VM 0
 
 612       description: Neutron UUID for the internal control network
 
 614       type: comma_delimited_list
 
 615       description: Fixed IP assignments for oam VMs on the internal control
 
 619       type: OS::Nova::Server
 
 621         name: { get_param: oam_vm_name_0 }
 
 623           - port: { get_resource: oam_vm_0_int_ctrl_port_0 }
 
 626           vf_module_index: { get_param: vf_module_index }
 
 627     oam_vm_0_int_ctrl_port_0:
 
 628       type: OS::Neutron::Port
 
 630         network: { get_param: int_ctrl_net_id }
 
 631         fixed_ips: [ { "ip_address": {get_param: [ oam_vm_int_ctrl_ips, { get_param: vf_module_index} ]}}]
 
 634 ^^^^^^^^^^^^^^^^^^^^^
 
 642     A VNF's Heat Orchestration Template's OS::Nova::Server
 
 643     Resource **SHOULD** contain the metadata map value parameter
 
 650     :validation_mode: static
 
 653     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 654     ``metadata`` map value parameter ``workload_context`` **MUST**
 
 655     be declared as type: ``string``.
 
 661     :validation_mode: static
 
 664     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 665     ``metadata`` map value parameter ``workload_context`` **MUST NOT**
 
 666     have parameter constraints defined.
 
 672     :validation_mode: static
 
 675     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 676     ``metadata`` map value parameter ``workload_context`` **MUST NOT**
 
 677     be enumerated in the Heat Orchestration Template's environment file.
 
 683     :validation_mode: static
 
 686     If a VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 687     ``metadata`` map value parameter ``workload_context`` is passed into a
 
 689     file, the parameter name ``workload_context`` **MUST NOT** change.
 
 691 The 'workload\_context' parameter value will be chosen by the Service Model
 
 692 Distribution context client in VID and will be supplied to the
 
 693 Heat Orchestration Template by ONAP at orchestration time.
 
 695 *Example Parameter Definition*
 
 702       description: Workload Context for this VNF instance
 
 705 *Example OS::Nova::Server with metadata*
 
 712     {vm-type}_server_{index}:
 
 713        type: OS::Nova::Server
 
 720           vnf_name: { get_param: vnf_name }
 
 721           vnf_id: { get_param: vnf_id }
 
 722           vf_module_name: { get_param: vf_module_name }
 
 723           vf_module_id: { get_param: vf_module_id }
 
 724           workload_context: {get_param: workload_context}
 
 727 ^^^^^^^^^^^^^^^^^^^^^
 
 735     A VNF's Heat Orchestration Template's OS::Nova::Server
 
 736     Resource **SHOULD** contain the metadata map value parameter
 
 737     'environment_context'.
 
 743     :validation_mode: static
 
 746     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 747     ``metadata`` map value parameter ``environment_context`` **MUST**
 
 748     be declared as type: ``string``.
 
 754     :validation_mode: static
 
 757     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 758     ``metadata`` map value parameter ``environment_context`` **MUST NOT**
 
 759     have parameter constraints defined.
 
 765     :validation_mode: static
 
 768     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` Resource
 
 769     ``metadata`` map value parameter ``environment_context`` **MUST NOT**
 
 770     be enumerated in the Heat Orchestration Template's environment file.
 
 776     :validation_mode: static
 
 779     If a VNF's Heat Orchestration Template's ``OS::Nova::Server Resource``
 
 780     ``metadata`` map value parameter ``environment_context`` is passed into a
 
 782     file, the parameter name ``environment_context`` **MUST NOT** change.
 
 784 The 'environment_context' parameter value will be defined by the
 
 785 service designer as part of the service model during the SDC
 
 786 on-boarding process and will be supplied to the Heat Orchestration
 
 787 Template by ONAP at orchestration time.
 
 790 *Example Parameter Definition*
 
 797       description: Environment Context for this VNF instance
 
 800 *Example OS::Nova::Server with metadata*
 
 807     {vm-type}_server_{index}:
 
 808        type: OS::Nova::Server
 
 815           vnf_name: { get_param: vnf_name }
 
 816           vnf_id: { get_param: vnf_id }
 
 817           vf_module_name: { get_param: vf_module_name }
 
 818           vf_module_id: { get_param: vf_module_id }
 
 819           workload_context: {get_param: workload_context}
 
 820           environment_context: {get_param: environment_context }