3564ef5149bdb4feae05ad579c2252699b63c657
[vnfrqts/requirements.git] /
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.
4
5 .. _Nova Server - Metadata Parameters:
6
7 Resource: OS::Nova::Server Metadata Parameters
8 --------------------------------------------------------------------------------
9
10 The ``OS::Nova::Server`` resource property ``metadata`` is an optional
11 OpenStack property.
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.
15
16
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
19    :align: center
20    :widths: auto
21
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
30
31 vnf_id
32 ^^^^^^^^^
33
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.
38
39 .. req::
40     :id: R-37437
41     :target: VNF
42     :keyword: MUST
43     :validation_mode: static
44     :updated: casablanca
45
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``.
50
51 .. req::
52     :id: R-07507
53     :target: VNF
54     :keyword: MUST
55     :validation_mode: static
56     :updated: casablanca
57
58     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
59     resource property
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``.
63
64 .. req::
65     :id: R-55218
66     :target: VNF
67     :keyword: MUST NOT
68     :validation_mode: static
69     :updated: casablanca
70
71     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
72     resource property
73     ``metadata`` key/value pair ``vnf_id`` parameter ``vnf_id`` **MUST NOT**
74     have parameter constraints defined.
75
76 .. req::
77     :id: R-20856
78     :target: VNF
79     :keyword: MUST NOT
80     :validation_mode: static
81     :updated: casablanca
82
83     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
84     resource property
85     ``metadata`` key/value pair ``vnf_id`` parameter ``vnf_id`` **MUST NOT**
86     be enumerated in the Heat Orchestration Template's environment file.
87
88 *Example 'vnf_id' Parameter Definition*
89
90 .. code-block:: yaml
91
92   parameters:
93
94     vnf_id:
95       type: string
96       description: Unique ID for this VNF instance
97
98 vf_module_id
99 ^^^^^^^^^^^^^^^^^^^^
100
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.
106
107 .. req::
108     :id: R-71493
109     :target: VNF
110     :keyword: MUST
111     :validation_mode: static
112     :updated: casablanca
113
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``.
118
119 .. req::
120     :id: R-82134
121     :target: VNF
122     :keyword: MUST
123     :validation_mode: static
124     :updated: casablanca
125
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``.
130
131 .. req::
132     :id: R-98374
133     :target: VNF
134     :keyword: MUST NOT
135     :validation_mode: static
136     :updated: casablanca
137
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``
140     **MUST NOT**
141     have parameter constraints defined.
142
143 .. req::
144     :id: R-72871
145     :target: VNF
146     :keyword: MUST NOT
147     :validation_mode: static
148     :updated: casablanca
149
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``
152     **MUST NOT**
153     be enumerated in the Heat Orchestration Template's environment file.
154
155 *Example 'vf_module_id' Parameter Definition*
156
157 .. code-block:: yaml
158
159   parameters:
160
161     vnf_module_id:
162       type: string
163       description: Unique ID for this VNF module instance
164
165
166 vnf_name
167 ^^^^^^^^^
168
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.
171 The value
172 is provided by ONAP to the VNF's Heat Orchestration
173 Template at orchestration time.
174
175 .. req::
176     :id: R-72483
177     :target: VNF
178     :keyword: MUST
179     :validation_mode: static
180     :updated: casablanca
181
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``.
185
186 .. req::
187     :id: R-62428
188     :target: VNF
189     :keyword: MUST
190     :validation_mode: static
191     :updated: casablanca
192
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
196     type: ``string``.
197
198 .. req::
199     :id: R-44318
200     :target: VNF
201     :keyword: MUST NOT
202     :validation_mode: static
203     :updated: casablanca
204
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.
209
210 .. req::
211     :id: R-36542
212     :target: VNF
213     :keyword: MUST NOT
214     :validation_mode: static
215     :updated: casablanca
216
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.
221
222
223 *Example 'vnf_name' Parameter Definition*
224
225 .. code-block:: yaml
226
227   parameters:
228
229     vnf_name:
230       type: string
231       description: Unique name for this VNF instance
232
233 vf_module_name
234 ^^^^^^^^^^^^^^^^^^
235
236 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter
237 ``vf_module_name``
238 is the deployment name of the heat stack created (e.g., ``<STACK_NAME>``)
239 from the
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.
245
246 .. req::
247     :id: R-68023
248     :target: VNF
249     :keyword: SHOULD
250     :updated: casablanca
251
252     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
253     property ``metadata`` **SHOULD**
254     contain the key/value pair ``vf_module_name`` and the value **MUST**
255     be obtained via a ``get_param``.
256
257 .. req::
258     :id: R-39067
259     :target: VNF
260     :keyword: MUST
261     :validation_mode: static
262     :updated: casablanca
263
264     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
265     property
266     ``metadata`` key/value pair ``vf_module_name`` parameter **MUST** be
267     declared as ``vf_module_name`` and the parameter **MUST**
268     be defined as type: ``string``.
269
270 .. req::
271     :id: R-15480
272     :target: VNF
273     :keyword: MUST NOT
274     :validation_mode: static
275     :updated: casablanca
276
277     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
278     property
279     ``metadata`` key/value pair ``vf_module_name`` parameter ``vf_module_name``
280     **MUST NOT** have parameter constraints defined.
281
282 .. req::
283     :id: R-80374
284     :target: VNF
285     :keyword: MUST NOT
286     :validation_mode: static
287     :updated: casablanca
288
289
290     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
291     property ``metadata`` key/value pair ``vf_module_name``
292     parameter ``vf_module_name`` **MUST NOT**
293     be enumerated in the Heat Orchestration Template's environment file.
294
295
296 *Example 'vf_module_name' Parameter Definition*
297
298 .. code-block:: yaml
299
300   parameters:
301
302     vf_module_name:
303       type: string
304       description: Unique name for this VNF Module instance
305
306 vm_role
307 ^^^^^^^^^
308
309 The ``OS::Nova::Server`` Resource ``metadata`` map value parameter ``vm-role``
310 is a ``metadata`` tag that describes the role of the Virtual Machine.
311 The ``vm_role`` is stored in ONAP’s A&AI module and is
312 available for use by other ONAP components and/or north bound systems.
313
314 .. req::
315     :id: R-85328
316     :target: VNF
317     :keyword: MAY
318     :updated: casablanca
319
320     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource property
321     ``metadata`` **MAY**
322     contain the key/value pair ``vm_role`` and the value **MUST** be
323     obtained either via
324
325     - ``get_param``
326     - hard coded in the key/value pair ``vm_role``.
327
328 .. req::
329     :id: R-95430
330     :target: VNF
331     :keyword: MUST
332     :validation_mode: static
333     :updated: casablanca
334
335     If a VNF's Heat Orchestration Template's ``OS::Nova::Server``
336     resource property
337     ``metadata`` key/value pair ``vm_role`` value is obtained via
338     ``get_param``, the parameter **MUST** be declared as ``vm_role``
339     and the parameter **MUST** be defined as type: ``string``.
340
341 .. req::
342     :id: R-67597
343     :target: VNF
344     :keyword: MUST NOT
345     :validation_mode: static
346     :updated: casablanca
347
348     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
349     property ``metadata`` key/value pair ``vm_role`` parameter ``vm_role``
350     **MUST NOT** have parameter constraints defined.
351
352 Defining the ``vm_role`` as the ``{vm-type}`` is a recommended convention
353
354
355 .. req::
356     :id: R-86476
357     :target: VNF
358     :keyword: MUST
359     :validation_mode: static
360     :updated: casablanca
361
362     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
363     property ``metadata`` key/value pair ``vm_role`` value **MUST**
364     only contain alphanumeric characters and underscores (i.e., '_').
365
366
367 *Example 'vm_role' Parameter Definition*
368
369 .. code-block:: yaml
370
371   parameters:
372
373     vm_role:
374       type: string
375       description: Unique role for this VM
376
377 *Example: 'vm-role' Definition: Hard Coded in
378 OS::Nova::Resource metadata property*
379
380 .. code-block:: yaml
381
382   resources:
383
384     dns_server_0
385       type: OS::Nova::Server
386       properties:
387         . . . .
388         metadata:
389           vm_role: dns
390
391 *Example 'vm-role' Definition: Defined in Environment file
392 and retrieved via 'get_param'*
393
394 .. code-block:: yaml
395
396   resources:
397
398     dns_server_0:
399       type: OS::Nova::Server
400       properties:
401         . . . .
402         metadata:
403           vm_role: { get_param: vm_role }
404
405 Example vnf_id, vf_module_id, vnf_name, vf_module_name, vm_role
406 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
407
408 The example below depicts part of a Heat Orchestration Template that
409 uses the five of the ``OS::Nova::Server`` resource
410 ``metadata`` map value parameters discussed in this
411 section. The ``{vm-type}`` has been defined as ``lb`` for load balancer.
412
413 .. code-block:: yaml
414
415   parameters:
416     lb_name_0
417       type: string
418       description: VM Name for lb VM 0
419     vnf_name:
420       type: string
421       description: Unique name for this VNF instance
422     vnf_id:
423       type: string
424       description: Unique ID for this VNF instance
425     vf_module_name:
426       type: string
427       description: Unique name for this VNF Module instance
428     vf_module_id:
429       type: string
430       description: Unique ID for this VNF Module instance
431     vm_role:
432       type: string
433       description: Unique role for this VM
434   resources:
435     lb_server_0:
436       type: OS::Nova::Server
437       properties:
438         name: { get_param: lb_name_0 }
439         ...
440         metadata:
441           vnf_name: { get_param: vnf_name }
442           vnf_id: { get_param: vnf_id }
443           vf_module_name: { get_param: vf_module_name }
444           vf_module_id: { get_param: vf_module_id }
445           vm_role: lb
446
447 vf_module_index
448 ^^^^^^^^^^^^^^^^^^
449
450
451 .. req::
452     :id: R-50816
453     :target: VNF
454     :keyword: MAY
455     :updated: casablanca
456
457     A VNF's Heat Orchestration Template's ``OS::Nova::Server``
458     resource  property ``metadata`` **MAY**
459     contain the key/value pair ``vf_module_index``
460     and the value **MUST** be obtained via a ``get_param``.
461
462 .. req::
463     :id: R-54340
464     :target: VNF
465     :keyword: MUST
466     :validation_mode: static
467     :updated: casablanca
468
469     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
470     property
471     ``metadata`` key/value pair ``vf_module_index`` parameter **MUST**
472     be declared as ``vf_module_index`` and the parameter **MUST** be
473     defined as type: ``number``.
474
475
476 .. req::
477     :id: R-09811
478     :target: VNF
479     :keyword: MUST NOT
480     :validation_mode: static
481     :updated: casablanca
482
483
484     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
485     property ``metadata`` key/value pair ``vf_module_index`` **MUST NOT**
486     have parameter constraints defined.
487
488 .. req::
489     :id: R-37039
490     :target: VNF
491     :keyword: MUST NOT
492     :validation_mode: static
493     :updated: casablanca
494
495     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
496     property
497     ``metadata`` key/value pair ``vf_module_index`` parameter
498     ``vf_module_index`` **MUST NOT**
499     be enumerated in the Heat Orchestration Template's environment file.
500
501 .. req::
502     :id: R-55306
503     :target: VNF
504     :keyword: MUST NOT
505     :validation_mode: static
506     :updated: casablanca
507
508     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
509     property ``metadata`` key/value pair ``vf_module_index`` **MUST NOT**
510     be used in a ``OS::Cinder::Volume`` resource and **MUST NOT** be
511     used in VNF's Volume template;
512     it is not supported.
513
514 The ``vf_module_index`` parameter indicates which instance of the module is
515 being deployed into the VNF.
516 This parameter may be used in cases where multiple instances of the same
517 incremental module may be instantiated for scaling purposes. The index
518 can be used in the Heat Orchestration Template for indexing into a
519 pseudo-constant array parameter when unique values are required for each
520 module instance, e.g., for fixed private IP addresses on VM types.
521
522 The ``vf_module_index`` will start at 0 for the first instance of a module
523 type. Subsequent instances of the same module type will receive the
524 lowest unused index. This means that indexes will be reused if a module
525 is deleted and re-added. As an example, if three copies of a module are
526 deployed with ``vf_module_index`` values of 0, 1, and 2 then subsequently
527 the second one is deleted (index 1), and then re-added, index 1 will be
528 reused.
529
530 *Example*
531
532 In this example, the ``{vm-type}`` has been defined as ``oam_vm`` to represent
533 an OAM VM. An incremental heat module is used to deploy the OAM VM. The
534 OAM VM attaches to an internal control network which has a
535 ``{network-role}`` of ``ctrl``. A maximum of four OAM VMs can be deployed. The
536 environment file contains the four IP addresses that each successive OAM
537 VM will be assigned. The ``vf_module_index`` is used as the index to
538 determine the IP assignment.
539
540 Environment File
541
542 .. code-block:: yaml
543
544   parameters:
545     oam_vm_int_ctrl_ips: 10.10.10.1,10.10.10.2,10.10.10.3,10.10.10.4
546
547 YAML File
548
549 .. code-block:: yaml
550
551   parameters:
552     vf_module_index:
553       type: number
554       description: Unique index for this VNF Module instance
555     oam_vm_name_0:
556       type: string
557       description: VM Name for lb VM 0
558     int_ctrl_net_id:
559       type: string
560       description: Neutron UUID for the internal control network
561     oam_vm_int_ctrl_ips:
562       type: comma_delimited_list
563       description: Fixed IP assignments for oam VMs on the internal control
564                    network
565   resources:
566     oam_vm_server_0:
567       type: OS::Nova::Server
568       properties:
569         name: { get_param: oam_vm_name_0 }
570         networks:
571           - port: { get_resource: oam_vm_0_int_ctrl_port_0 }
572   #     . . .
573         metadata:
574           vf_module_index: { get_param: vf_module_index }
575     oam_vm_0_int_ctrl_port_0:
576       type: OS::Neutron::Port
577       properties:
578         network: { get_param: int_ctrl_net_id }
579         fixed_ips: [ { "ip_address": {get_param: [ oam_vm_int_ctrl_ips, { get_param: vf_module_index} ]}}]
580
581 workload_context
582 ^^^^^^^^^^^^^^^^^^^^^
583
584 .. req::
585     :id: R-47061
586     :target: VNF
587     :keyword: SHOULD
588     :updated: casablanca
589
590     A VNF's Heat Orchestration Template's OS::Nova::Server
591     Resource **SHOULD** contain the metadata map value parameter
592     'workload_context'.
593
594 .. req::
595     :id: R-74978
596     :target: VNF
597     :keyword: MUST
598     :validation_mode: static
599     :updated: casablanca
600
601     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
602     property ``metadata`` key/value pair ``workload_context``
603     parameter **MUST**
604     be declared as ``workload_context`` and the parameter **MUST**
605     be defined as type: ``string``.
606
607 .. req::
608     :id: R-34055
609     :target: VNF
610     :keyword: MUST NOT
611     :validation_mode: static
612     :updated: casablanca
613
614     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
615     property ``metadata`` key/value pair ``workload_context``
616     parameter ``workload_context`` **MUST NOT**
617     have parameter constraints defined.
618
619 .. req::
620     :id: R-02691
621     :target: VNF
622     :keyword: MUST NOT
623     :validation_mode: static
624     :updated: casablanca
625
626
627     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
628     property ``metadata`` key/value pair ``workload_context``
629     parameter ``workload_context`` **MUST NOT**
630     be enumerated in the Heat Orchestration Template's environment file.
631
632 The 'workload\_context' parameter value will be chosen by the Service Model
633 Distribution context client in VID and will be supplied to the
634 Heat Orchestration Template by ONAP at orchestration time.
635
636 *Example Parameter Definition*
637
638 .. code-block:: yaml
639
640   parameters:
641     workload_context:
642       type: string
643       description: Workload Context for this VNF instance
644
645
646 *Example OS::Nova::Server with metadata*
647
648 .. code-block:: yaml
649
650   resources:
651     . . .
652
653     {vm-type}_server_{index}:
654        type: OS::Nova::Server
655        properties:
656          name:
657          flavor:
658          image:
659         ...
660        metadata:
661           vnf_name: { get_param: vnf_name }
662           vnf_id: { get_param: vnf_id }
663           vf_module_name: { get_param: vf_module_name }
664           vf_module_id: { get_param: vf_module_id }
665           workload_context: {get_param: workload_context}
666
667 environment_context
668 ^^^^^^^^^^^^^^^^^^^^^
669
670 .. req::
671     :id: R-88536
672     :target: VNF
673     :keyword: SHOULD
674     :updated: casablanca
675
676     A VNF's Heat Orchestration Template's OS::Nova::Server
677     Resource **SHOULD** contain the metadata map value parameter
678     'environment_context'.
679
680 .. req::
681     :id: R-20308
682     :target: VNF
683     :keyword: MUST
684     :validation_mode: static
685     :updated: casablanca
686
687     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
688     property ``metadata`` key/value pair ``environment_context``
689     parameter **MUST** be declared as ``environment_context`` and the
690     parameter type **MUST** be defined as type: ``string``.
691
692 .. req::
693     :id: R-56183
694     :target: VNF
695     :keyword: MUST NOT
696     :validation_mode: static
697     :updated: casablanca
698
699     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
700     property ``metadata``key/value pair ``environment_context``
701     parameter ``environment_context`` **MUST NOT**
702     have parameter constraints defined.
703
704 .. req::
705     :id: R-13194
706     :target: VNF
707     :keyword: MUST NOT
708     :validation_mode: static
709     :updated: casablanca
710
711     A VNF's Heat Orchestration Template's ``OS::Nova::Server`` resource
712     property
713     ``metadata`` key/value pair ``environment_context`` **MUST NOT**
714     be enumerated in the Heat Orchestration Template's environment file.
715
716 The 'environment_context' parameter value will be defined by the
717 service designer as part of the service model during the SDC
718 on-boarding process and will be supplied to the Heat Orchestration
719 Template by ONAP at orchestration time.
720
721
722 *Example Parameter Definition*
723
724 .. code-block:: yaml
725
726   parameters:
727     environment_context:
728       type: string
729       description: Environment Context for this VNF instance
730
731
732 *Example OS::Nova::Server with metadata*
733
734 .. code-block:: yaml
735
736   resources:
737     . . .
738
739     {vm-type}_server_{index}:
740        type: OS::Nova::Server
741        properties:
742          name:
743          flavor:
744          image:
745         ...
746        metadata:
747           vnf_name: { get_param: vnf_name }
748           vnf_id: { get_param: vnf_id }
749           vf_module_name: { get_param: vf_module_name }
750           vf_module_id: { get_param: vf_module_id }
751           workload_context: {get_param: workload_context}
752           environment_context: {get_param: environment_context }