[VNFRQTS] final heat updates
[vnfrqts/requirements.git] / docs / Chapter5 / Heat / ONAP Heat Resource ID and Parameter Naming Convention / Neutron Parameters.rst
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 Resource: OS::Neutron::Port - Parameters
6 -------------------------------------------------
7
8 The resource OS::Neutron::Port is for managing Neutron ports.
9
10 (See https://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Neutron::Port)
11
12 Introduction
13 ^^^^^^^^^^^^^
14
15 Four properties of the resource ``OS::Neutron::Port`` must follow the ONAP
16 naming convention. The four properties are:
17
18 1. network
19 2. fixed_ips, ip_address
20 3. fixed_ips, subnet
21
22  * Note that earlier versions of this document mentioned the property
23    fixed_ips, subnet_id.  This property has been removed from the document since
24    it has been deprecated.
25    See https://github.com/openstack/heat/blob/stable/ocata/heat/engine/resources/openstack/neutron/port.py
26
27 4. allowed_address_pairs, ip_address
28
29 Below is a generic example. Note that for some parameters
30 comma_delimited_list are supported in addition to String.
31
32 .. code-block:: yaml
33
34   resources:
35
36   ...
37
38   <resource ID>:
39     type: OS::Neutron::Port
40     properties:
41       allowed_address_pairs: [{"ip_address": String, "mac_address": String},
42       {"ip_address": String, "mac_address": String}, ...]
43       fixed_ips: [{"ip_address": String, "subnet_id": String, "subnet":
44       String}, {"ip_address": String, "subnet_id": String, "subnet": String},
45       ...]
46       network: String
47
48 The values associated with these properties may reference an external
49 network or internal network. External networks and internal
50 networks are defined in :ref:`ONAP Heat Networking`.
51
52 When the ``OS::Neutron::Port`` is attaching to an external network, all
53 property values are parameters that are retrieved via the intrinsic
54 function ``get_param``.
55
56 When the ``OS::Neutron::Port`` is attaching to an internal network, a
57 property value maybe retrieved via the intrinsic
58 function ``get_param``, ``get_resource``, or ``get_attr``.
59
60 This will be described in the forth coming sections.
61
62 Items to Note
63 ~~~~~~~~~~~~~~
64
65 .. req::
66     :id: R-93272
67     :target: VNF
68     :keyword: MAY
69     :updated: casablanca
70
71     A VNF **MAY** have one or more ports connected to a unique
72     external network. All VNF ports connected to the unique external
73     network **MUST** have cloud assigned IP Addresses
74     or **MUST** have ONAP SDN-C assigned IP addresses.
75
76 .. req::
77     :id: R-13841
78     :target: VNF
79     :keyword: MAY
80     :updated: casablanca
81
82     A VNF **MAY** have one or more ports connected to a unique
83     internal network. All VNF ports connected to the unique internal
84     network **MUST** have cloud assigned IP Addresses
85     or **MUST** have statically assigned IP addresses.
86
87 .. req::
88     :id: R-07577
89     :target: VNF
90     :keyword: MUST
91     :validation_mode: static
92     :updated: casablanca
93
94     If the VNF's ports connected to a unique network (internal or external)
95     and the port's IP addresses are cloud assigned IP Addresses,
96     all the IPv4 Addresses **MUST** be from
97     the same subnet and all the IPv6 Addresses **MUST** be from the
98     same subnet.
99
100 .. req::
101     :id: R-45602
102     :target: VNF
103     :keyword: MUST NOT
104     :validation_mode: static
105     :updated: casablanca
106
107     If a VNF's Port is attached to a network (internal or external)
108     and the port's IP addresses are cloud assigned by OpenStack's DHCP
109     Service, the ``OS::Neutron::Port`` Resource's
110
111     * property ``fixed_ips`` map property ``ip_address`` **MUST NOT** be used
112     * property ``fixed_ips`` map property ``subnet``
113       **MAY** be used
114
115 .. req::
116     :id: R-63956
117     :target: VNF
118     :keyword: MAY
119     :updated: casablanca
120
121     If the VNF's ports connected to a unique external network
122     and the port's IP addresses are ONAP SDN-C assigned IP Addresses,
123     the IPv4 Addresses **MAY** be from different subnets and the IPv6
124     Addresses **MAY** be from different subnets.
125
126 .. req::
127     :id: R-48880
128     :target: VNF
129     :keyword: MUST
130     :validation_mode: static
131     :updated: casablanca
132
133     If a VNF's Port is attached to an external network and the port's
134     IP addresses are assigned by ONAP's SDN-Controller,
135     the ``OS::Neutron::Port`` Resource's
136
137     * property ``fixed_ips`` map property ``ip_address`` **MUST** be used
138     * property ``fixed_ips`` map property ``subnet``
139       **MUST NOT** be used
140
141 .. req::
142     :id: R-18001
143     :target: VNF
144     :keyword: MAY
145     :updated: casablanca
146
147     If the VNF's ports connected to a unique internal network
148     and the port's IP addresses are statically assigned IP Addresses,
149     the IPv4 Addresses **MAY** be from different subnets and the
150     IPv6 Addresses **MAY** be from different subnets.
151
152 .. req::
153     :id: R-70964
154     :target: VNF
155     :keyword: MUST NOT
156     :validation_mode: static
157     :updated: casablanca
158
159     If a VNF's Port is attached to an internal network and the port's
160     IP addresses are statically assigned by the VNF's Heat Orchestration\
161     Template (i.e., enumerated in the Heat Orchestration Template's
162     environment file), the ``OS::Neutron::Port`` Resource's
163
164     * property ``fixed_ips`` map property ``ip_address`` **MUST** be used
165     * property ``fixed_ips`` map property ``subnet``
166       **MUST NOT** be used
167
168 Property: network
169 ^^^^^^^^^^^^^^^^^^
170
171 The Resource ``OS::Neutron::Port`` property ``network`` determines what network
172 the port is attached to.
173
174 .. req::
175     :id: R-18008
176     :target: VNF
177     :keyword: MUST
178     :validation_mode: static
179     :updated: casablanca
180
181     The VNF's Heat Orchestration Template's Resource ``OS::Neutron::Port``
182     property ``network`` parameter **MUST** be declared as type: ``string``.
183
184 .. req::
185     :id: R-62983
186     :target: VNF
187     :keyword: MUST
188     :validation_mode: static
189     :updated: casablanca
190
191     When the VNF's Heat Orchestration Template's Resource
192     ``OS::Neutron::Port`` is attaching to an external network (per the
193     ONAP definition, see Requirement R-57424), the
194     ``network`` parameter name **MUST**
195
196       * follow the naming convention ``{network-role}_net_id`` if the Neutron
197         network UUID value is used to reference the network
198       * follow the naming convention ``{network-role}_net_name`` if the
199         OpenStack network name is used to reference the network.
200
201     where ``{network-role}`` is the network-role of the external network
202     and a ``get_param`` **MUST** be used as the intrinsic function.
203
204 .. req::
205     :id: R-86182
206     :target: VNF
207     :keyword: MUST
208     :validation_mode: static
209     :updated: casablanca
210
211     When the VNF's Heat Orchestration Template's Resource
212     ``OS::Neutron::Port`` is attaching to an internal network (per the
213     ONAP definition, see Requirements R-52425 and R-46461),
214     and the internal network is created in a
215     different Heat Orchestration Template than the ``OS::Neutron::Port``,
216     the ``network`` parameter name **MUST**
217
218       * follow the naming convention ``int_{network-role}_net_id`` if the Neutron
219         network UUID value is used to reference the network
220       * follow the naming convention ``int_{network-role}_net_name`` if the
221         OpenStack network name in is used to reference the network.
222
223     where ``{network-role}`` is the network-role of the internal network and
224     a ``get_param`` **MUST** be used as the intrinsic function.
225
226 In Requirement R-86182, the internal network is created in the VNF's
227 Base Module (Heat Orchestration Template) and the parameter name is
228 declared in the Base Module's ``outputs`` section.
229 The output parameter name will be declared as a parameter in the
230 ``parameters`` section of the incremental module.
231
232
233 .. req::
234     :id: R-93177
235     :target: VNF
236     :keyword: MUST
237     :validation_mode: static
238     :updated: casablanca
239
240     When the VNF's Heat Orchestration Template's resource
241     ``OS::Neutron::Port`` is attaching to an internal network (per the
242     ONAP definition, see Requirements R-52425 and R-46461),
243     and the internal network is created in the
244     same Heat Orchestration Template as the ``OS::Neutron::Port``,
245     the ``network`` property value **MUST** obtain the UUID
246     of the internal network by using the intrinsic function
247     ``get_resource``
248     and referencing the Resource ID of the internal network.
249
250 .. req::
251     :id: R-29872
252     :target: VNF
253     :keyword: MUST NOT
254     :validation_mode: static
255     :updated: casablanca
256
257     The VNF's Heat Orchestration Template's Resource ``OS::Neutron::Port``
258     property ``network``
259     parameter **MUST NOT** be enumerated in the Heat Orchestration
260     Template's Environment File.
261
262 The parameter values for external networks are provided by ONAP
263 to the VNF's Heat Orchestration Template at orchestration time.
264
265 The parameter values for internal networks created in the VNF's Base Module
266 Heat Orchestration Template
267 are provided to the VNF's Incremental Module Heat Orchestration Template
268 at orchestration time.
269
270 *Example Parameter Definition of External Networks*
271
272 .. code-block:: yaml
273
274   parameters:
275
276     {network-role}_net_id:
277       type: string
278       description: Neutron UUID for the external {network-role} network
279
280     {network-role}_net_name:
281       type: string
282       description: Neutron name for the external {network-role} network
283
284
285
286 *Example Parameter Definition of Internal Networks in an Incremental Module*
287
288 .. code-block:: yaml
289
290   parameters:
291
292     int_{network-role}_net_id:
293       type: string
294       description: Neutron UUID for the internal int_{network-role} network
295
296     int_{network-role}_net_name:
297       type: string
298       description: Neutron name for the internal int_{network-role} network
299
300 Property: fixed_ips, Map Property: ip_address
301 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
302
303 The resource ``OS::Neutron::Port`` property ``fixed_ips``
304 map property ``ip_address``
305 is used to assign one IPv4 or IPv6
306 addresses to port.
307
308 One ``OS::Neutron::Port`` resource may assign one or more
309 IPv4 and/or IPv6 addresses.
310
311 .. req::
312     :id: R-34037
313     :target: VNF
314     :keyword: MUST
315     :validation_mode: static
316     :updated: casablanca
317
318     The VNF's Heat Orchestration Template's
319     resource ``OS::Neutron::Port`` property ``fixed_ips``
320     map property ``ip_address`` parameter
321     **MUST** be declared as either type ``string`` or type
322     ``comma_delimited_list``.
323
324 .. req::
325     :id: R-40971
326     :target: VNF
327     :keyword: MUST
328     :validation_mode: static
329     :updated: casablanca
330
331     When the VNF's Heat Orchestration Template's Resource
332     ``OS::Neutron::Port`` is attaching to an external network (per the
333     ONAP definition, see Requirement R-57424),
334     and an IPv4 address is assigned
335     using the property ``fixed_ips``
336     map property ``ip_address`` and the parameter type is defined as a string,
337     the parameter name **MUST** follow the
338     naming convention
339
340       * ``{vm-type}_{network-role}_ip_{index}``
341
342       where
343
344       * ``{vm-type}`` is the {vm-type} associated with the
345         ``OS::Nova::Server``
346       * ``{network-role}`` is the {network-role} of the external
347         network
348       * the value for ``{index}`` must start at zero (0) and increment by one
349
350 .. req::
351     :id: R-39841
352     :target: VNF
353     :keyword: MUST NOT
354     :validation_mode: static
355     :updated: casablanca
356
357     The VNF's Heat Orchestration Template's Resource
358     ``OS::Neutron::Port`` property ``fixed_ips``
359     map property ``ip_address`` parameter
360     ``{vm-type}_{network-role}_ip_{index}``
361     **MUST NOT** be enumerated in the
362     VNF's Heat Orchestration Template's Environment File.
363
364 ONAP's SDN-Controller assigns the IP Address and ONAP provides
365 the value at orchestration to the Heat Orchestration Template.
366
367 *Example External Network IPv4 Address string Parameter Definition*
368
369 .. code-block:: yaml
370
371   parameters:
372
373     {vm-type}_{network-role}_ip_{index}:
374       type: string
375       description: Fixed IPv4 assignment for {vm-type} VM {index} on the {network-role} network
376
377 .. req::
378     :id: R-04697
379     :target: VNF
380     :keyword: MUST
381     :validation_mode: static
382     :updated: casablanca
383
384     When the VNF's Heat Orchestration Template's Resource
385     ``OS::Neutron::Port`` is attaching to an external network (per the
386     ONAP definition, see Requirement R-57424),
387     and an IPv4 address is assigned
388     using the property ``fixed_ips``
389     map property ``ip_address`` and the parameter type is defined as a
390     ``comma_delimited_list``,
391     the parameter name **MUST** follow the
392     naming convention
393
394       * ``{vm-type}_{network-role}_ips``
395
396       where
397
398       * ``{vm-type}`` is the {vm-type} associated with the
399         ``OS::Nova::Server``
400       * ``{network-role}`` is the {network-role} of the external
401         network
402
403 .. req::
404     :id: R-98905
405     :target: VNF
406     :keyword: MUST NOT
407     :validation_mode: static
408     :updated: casablanca
409
410     The VNF's Heat Orchestration Template's Resource
411     ``OS::Neutron::Port`` property ``fixed_ips``
412     map property ``ip_address`` parameter
413     ``{vm-type}_{network-role}_ips``
414     **MUST NOT** be enumerated in the
415     VNF's Heat Orchestration Template's Environment File.
416
417 ONAP's SDN-Controller assigns the IP Address and ONAP provides
418 the value at orchestration to the Heat Orchestration Template.
419
420 *Example External Network IPv4 Address comma_delimited_list
421 Parameter Definition*
422
423 .. code-block:: yaml
424
425   parameters:
426
427     {vm-type}_{network-role}_ips:
428       type: comma_delimited_list
429       description: Fixed IPv4 assignments for {vm-type} VMs on the {network-role} network
430
431
432 .. req::
433     :id: R-71577
434     :target: VNF
435     :keyword: MUST
436     :validation_mode: static
437     :updated: casablanca
438
439     When the VNF's Heat Orchestration Template's Resource
440     ``OS::Neutron::Port`` is attaching to an external network (per the
441     ONAP definition, see Requirement R-57424),
442     and an IPv6 address is assigned
443     using the property ``fixed_ips``
444     map property ``ip_address`` and the parameter type is defined as a string,
445     the parameter name **MUST** follow the
446     naming convention
447
448       * ``{vm-type}_{network-role}_v6_ip_{index}``
449
450       where
451
452       * ``{vm-type}`` is the {vm-type} associated with the
453         OS::Nova::Server
454       * ``{network-role}`` is the {network-role} of the external
455         network
456       * the value for ``{index}`` must start at zero (0) and increment by one
457
458 .. req::
459     :id: R-87123
460     :target: VNF
461     :keyword: MUST NOT
462     :validation_mode: static
463     :updated: casablanca
464
465     The VNF's Heat Orchestration Template's Resource
466     ``OS::Neutron::Port`` property ``fixed_ips``
467     map property ``ip_address`` parameter
468     ``{vm-type}_{network-role}_v6_ip_{index}``
469     **MUST NOT** be enumerated in the
470     VNF's Heat Orchestration Template's Environment File.
471
472 ONAP's SDN-Controller assigns the IP Address and ONAP provides
473 the value at orchestration to the Heat Orchestration Template.
474
475 *Example External Network IPv6 Address string Parameter Definition*
476
477 .. code-block:: yaml
478
479   parameters:
480
481     {vm-type}_{network-role}_v6_ip_{index}:
482       type: string
483       description: Fixed IPv6 assignment for {vm-type} VM {index} on the {network-role} network
484
485 .. req::
486     :id: R-23503
487     :target: VNF
488     :keyword: MUST
489     :validation_mode: static
490     :updated: casablanca
491
492     When the VNF's Heat Orchestration Template's Resource
493     ``OS::Neutron::Port`` is attaching to an external network (per the
494     ONAP definition, see Requirement R-57424),
495     and an IPv6 address is assigned
496     using the property ``fixed_ips``
497     map property ``ip_address`` and the parameter type is defined as a
498     ``comma_delimited_list``,
499     the parameter name **MUST** follow the
500     naming convention
501
502       * ``{vm-type}_{network-role}_v6_ips``
503
504     where
505
506       * ``{vm-type}`` is the {vm-type} associated with the
507         OS::Nova::Server
508       * ``{network-role}`` is the {network-role} of the external
509         network
510
511 .. req::
512     :id: R-93030
513     :target: VNF
514     :keyword: MUST NOT
515     :validation_mode: static
516     :updated: casablanca
517
518     The VNF's Heat Orchestration Template's Resource
519     ``OS::Neutron::Port`` property ``fixed_ips``
520     map property ``ip_address`` parameter
521     ``{vm-type}_{network-role}_v6_ips``
522     **MUST NOT** be enumerated in the
523     VNF's Heat Orchestration Template's Environment File.
524
525 ONAP's SDN-Controller assigns the IP Address and ONAP provides
526 the value at orchestration to the Heat Orchestration Template.
527
528 *Example External Network IPv6 Address comma_delimited_list Parameter
529 Definition*
530
531 .. code-block:: yaml
532
533   parameters:
534
535     {vm-type}_{network-role}_v6_ips:
536       type: comma_delimited_list
537       description: Fixed IPv6 assignments for {vm-type} VMs on the {network-role} network
538
539
540 .. req::
541     :id: R-78380
542     :target: VNF
543     :keyword: MUST
544     :validation_mode: static
545     :updated: casablanca
546
547     When the VNF's Heat Orchestration Template's Resource
548     ``OS::Neutron::Port`` is attaching to an internal network (per the
549     ONAP definition, see Requirements R-52425 and R-46461),
550     and an IPv4 address is assigned
551     using the property ``fixed_ips``
552     map property ``ip_address`` and the parameter type is
553     defined as a ``string``,
554     the parameter name **MUST** follow the
555     naming convention
556
557       * ``{vm-type}_int_{network-role}_ip_{index}``
558
559     where
560
561       * ``{vm-type}`` is the {vm-type} associated with the
562         OS::Nova::Server
563       * ``{network-role}`` is the {network-role} of the internal
564         network
565       * the value for ``{index`` must start at zero (0) and increment by one
566
567 .. req::
568     :id: R-28795
569     :target: VNF
570     :keyword: MUST
571     :validation_mode: static
572     :updated: casablanca
573
574     The VNF's Heat Orchestration Template's Resource
575     ``OS::Neutron::Port`` property ``fixed_ips``
576     map property ``ip_address`` parameter
577     ``{vm-type}_int_{network-role}_ip_{index}``
578     **MUST** be enumerated in the
579     VNF's Heat Orchestration Template's Environment File.
580
581 The IP address is local to the VNF's internal network and is (re)used
582 in every VNF spin up, thus the constant value is declared in the VNF's
583 Heat Orchestration Template's Environment File.
584
585 *Example Internal Network IPv4 Address string Parameter Definition*
586
587 .. code-block:: yaml
588
589   parameters:
590
591     {vm-type}_int_{network-role}_ip_{index}:
592       type: string
593       description: Fixed IPv4 assignment for {vm-type} VM {index} on the int_{network-role} network
594
595 .. req::
596     :id: R-85235
597     :target: VNF
598     :keyword: MUST
599     :validation_mode: static
600     :updated: casablanca
601
602     When the VNF's Heat Orchestration Template's Resource
603     ``OS::Neutron::Port`` is attaching to an internal network (per the
604     ONAP definition, see Requirements R-52425 and R-46461),
605     and an IPv4 address is assigned
606     using the property ``fixed_ips``
607     map property ``ip_address`` and the parameter type is defined as a
608     ``comma_delimited_list``,
609     the parameter name **MUST** follow the
610     naming convention
611
612       * ``{vm-type}_int_{network-role}_ips``
613
614     where
615
616       * ``{vm-type}`` is the {vm-type} associated with the
617         ``OS::Nova::Server``
618       * ``{network-role}`` is the {network-role} of the internal
619         network
620
621 .. req::
622     :id: R-90206
623     :target: VNF
624     :keyword: MUST
625     :validation_mode: static
626     :updated: casablanca
627
628     The VNF's Heat Orchestration Template's Resource
629     ``OS::Neutron::Port`` property ``fixed_ips``
630     map property ``ip_address`` parameter
631     ``{vm-type}_int_{network-role}_int_ips``
632     **MUST** be enumerated in the
633     VNF's Heat Orchestration Template's Environment File.
634
635 The IP address is local to the VNF's internal network and is (re)used
636 in every VNF spin up, thus the constant value is declared in the VNF's
637 Heat Orchestration Template's Environment File.
638
639 .. code-block:: yaml
640
641   parameters:
642
643     {vm-type}_int_{network-role}_ips:
644       type: comma_delimited_list
645       description: Fixed IPv4 assignments for {vm-type} VMs on the int_{network-role} network
646
647
648 .. req::
649     :id: R-27818
650     :target: VNF
651     :keyword: MUST
652     :validation_mode: static
653     :updated: casablanca
654
655     When the VNF's Heat Orchestration Template's Resource
656     ``OS::Neutron::Port`` is attaching to an internal network (per the
657     ONAP definition, see RRequirements R-52425 and R-46461),
658     and an IPv6 address is assigned
659     using the property ``fixed_ips``
660     map property ``ip_address`` and the parameter type is defined as a
661     ``string``,
662     the parameter name **MUST** follow the
663     naming convention
664
665       * ``{vm-type}_int_{network-role}_v6_ip_{index}``
666
667     where
668
669       * ``{vm-type}`` is the {vm-type} associated with the
670         ``OS::Nova::Server``
671       * ``{network-role}`` is the {network-role} of the internal
672         network
673       * the value for ``{index}`` must start at zero (0) and increment by one
674
675
676 .. req::
677     :id: R-97201
678     :target: VNF
679     :keyword: MUST
680     :validation_mode: static
681     :updated: casablanca
682
683     The VNF's Heat Orchestration Template's Resource
684     ``OS::Neutron::Port`` property ``fixed_ips``
685     map property ``ip_address`` parameter
686     ``{vm-type}_int_{network-role}_v6_ip_{index}``
687     **MUST** be enumerated in the
688     VNF's Heat Orchestration Template's Environment File.
689
690 The IP address is local to the VNF's internal network and is (re)used
691 in every VNF spin up, thus the constant value is declared in the VNF's
692 Heat Orchestration Template's Environment File.
693
694 *Example Internal Network IPv6 Address string Parameter Definition*
695
696 .. code-block:: yaml
697
698   parameters:
699
700     {vm-type}_int_{network-role}_v6_ip_{index}:
701       type: string
702       description: Fixed IPv6 assignment for {vm-type} VM {index} on the int_{network-role} network
703
704 .. req::
705     :id: R-29765
706     :target: VNF
707     :keyword: MUST
708     :validation_mode: static
709     :updated: casablanca
710
711     When the VNF's Heat Orchestration Template's Resource
712     ``OS::Neutron::Port`` is attaching to an internal network (per the
713     ONAP definition, see Requirements R-52425 and R-46461),
714     and an IPv6 address is assigned
715     using the property ``fixed_ips``
716     map property ``ip_address`` and the parameter type is defined as a
717     ``comma_delimited_list``,
718     the parameter name **MUST** follow the
719     naming convention
720
721       * ``{vm-type}_int_{network-role}_v6_ips``
722
723     where
724
725       * ``{vm-type}`` is the {vm-type} associated with the
726         ``OS::Nova::Server``
727       * ``{network-role}`` is the {network-role} of the internal
728         network
729
730 *Example Internal Network IPv6 Address comma_delimited_list Parameter
731 Definition*
732
733 .. code-block:: yaml
734
735   parameters:
736
737     {vm-type}_int_{network-role}_v6_ips:
738       type: comma_delimited_list
739       description: Fixed IPv6 assignments for {vm-type} VMs on the int_{network-role} network
740
741
742 .. req::
743     :id: R-98569
744     :target: VNF
745     :keyword: MUST
746     :validation_mode: static
747     :updated: casablanca
748
749     The VNF's Heat Orchestration Template's Resource
750     ``OS::Neutron::Port`` property ``fixed_ips``
751     map property ``ip_address`` parameter
752     ``{vm-type}_int_{network-role}_v6_ips``
753     **MUST** be enumerated in the
754     VNF's Heat Orchestration Template's Environment File.
755
756 The IP address is local to the VNF's internal network and is (re)used
757 in every VNF spin up, thus the constant value is declared in the VNF's
758 Heat Orchestration Template's Environment File.
759
760 .. code-block:: yaml
761
762   parameters:
763
764     {vm-type}_int_{network-role}_v6_ips:
765       type: comma_delimited_list
766       description: Fixed IPv6 assignments for {vm-type} VMs on the int_{network-role} network
767
768 .. req::
769     :id: R-62590
770     :target: VNF
771     :keyword: MUST NOT
772     :validation_mode: static
773     :updated: casablanca
774
775     The VNF's Heat Orchestration Template's Resource ``OS::Neutron::Port``
776     property ``fixed_ips``
777     map property ``ip_address``
778     parameter associated with an external network, i.e.,
779
780      * ``{vm-type}_{network-role}_ip_{index}``
781      * ``{vm-type}_{network-role}_v6_ip_{index}``
782      * ``{vm-type}_{network-role}_ips``
783      * ``{vm-type}_{network-role}_v6_ips``
784
785
786     **MUST NOT** be enumerated in the Heat Orchestration
787     Template's Environment File.  ONAP provides the IP address
788     assignments at orchestration time.
789
790 .. req::
791     :id: R-93496
792     :target: VNF
793     :keyword: MUST
794     :validation_mode: static
795     :updated: casablanca
796
797     The VNF's Heat Orchestration Template's Resource ``OS::Neutron::Port``
798     property ``fixed_ips``
799     map property ``ip_address``
800     parameter associated with an internal network, i.e.,
801
802      * ``{vm-type}_int_{network-role}_ip_{index}``
803      * ``{vm-type}_int_{network-role}_v6_ip_{index}``
804      * ``{vm-type}_int_{network-role}_ips``
805      * ``{vm-type}_int_{network-role}_v6_ips``
806
807
808     **MUST** be enumerated in the Heat Orchestration
809     Template's Environment File and IP addresses **MUST** be
810     assigned.
811
812 Summary Table
813 ~~~~~~~~~~~~~~~~~
814
815 .. csv-table:: **Table 4 OS::Neutron::Port Property fixed_ips map property ip_address Parameter Naming Convention**
816    :header: Resource,Property,Map Property,Network Type,IP Address,Parameter Type,Parameter Name, Environment File
817    :align: center
818    :widths: auto
819
820    OS::Neutron::Port, fixed_ips, ip_address, external, IPv4, string, {vm-type}_{network-role}_ip_{index}, NO
821    OS::Neutron::Port, fixed_ips, ip_address, external, IPv4, comma_delimited_list, {vm-type}_{network-role}_ips, NO
822    OS::Neutron::Port, fixed_ips, ip_address, external, IPv6, string, {vm-type}_{network-role}_v6_ip_{index}, NO
823    OS::Neutron::Port, fixed_ips, ip_address, external, IPv6, comma_delimited_list, {vm-type}_{network-role}_v6_ips, NO
824    OS::Neutron::Port, fixed_ips, ip_address, internal, IPv4, string, {vm-type}_int_{network-role}_ip_{index}, YES
825    OS::Neutron::Port, fixed_ips, ip_address, internal, IPv4, comma_delimited_list, {vm-type}_int_{network-role}_ips, YES
826    OS::Neutron::Port, fixed_ips, ip_address, internal, IPv6, string, {vm-type}_int_{network-role}_v6_ip_{index}, YES
827    OS::Neutron::Port, fixed_ips, ip_address, internal, IPv6, comma_delimited_list, {vm-type}_int_{network-role}_v6_ips, YES
828
829
830 Examples
831 ~~~~~~~~~~~~~~
832
833 *Example: comma_delimited_list parameters for IPv4 and IPv6 Address
834 Assignments to an external network*
835
836 In this example, the ``{network-role}`` has been defined as ``oam`` to represent
837 an oam network and the ``{vm-type}`` has been defined as ``db`` for database.
838
839 .. code-block:: yaml
840
841   parameters:
842     oam_net_id:
843       type: string
844       description: Neutron UUID for a oam network
845     db_oam_ips:
846       type: comma_delimited_list
847       description: Fixed IPv4 assignments for db VMs on the oam network
848     db_oam_v6_ips:
849       type: comma_delimited_list
850       description: Fixed IPv6 assignments for db VMs on the oam network
851   resources:
852     db_0_oam_port_0:
853       type: OS::Neutron::Port
854       properties:
855         network: { get_param: oam_net_id }
856         fixed_ips: [ { "ip_address": {get_param: [ db_oam_ips, 0 ]}}, {
857         "ip_address": {get_param: [ db_oam_v6_ips, 0 ]}}]
858     db_1_oam_port_0:
859       type: OS::Neutron::Port
860       properties:
861         network: { get_param: oam_net_id }
862         fixed_ips:
863           - "ip_address": {get_param: [ db_oam_ips, 1 ]}
864           - "ip_address": {get_param: [ db_oam_v6_ips, 1 ]}
865
866 *Example: string parameters for IPv4 and IPv6 Address Assignments to an
867 external network*
868
869 In this example, the ``{network-role}`` has been defined as ``oam`` to
870 represent an oam network and the ``{vm-type}`` has been defined as ``db`` for
871 database.
872
873 .. code-block:: yaml
874
875   parameters:
876     oam_net_id:
877       type: string
878       description: Neutron UUID for an OAM network
879     db_oam_ip_0:
880       type: string
881       description: Fixed IPv4 assignment for db VM 0 on the OAM network
882     db_oam_ip_1:
883       type: string
884       description: Fixed IPv4 assignment for db VM 1 on the OAM network
885     db_oam_v6_ip_0:
886       type: string
887       description: Fixed IPv6 assignment for db VM 0 on the OAM network
888     db_oam_v6_ip_1:
889       type: string
890       description: Fixed IPv6 assignment for db VM 1 on the OAM network
891   resources:
892     db_0_oam_port_0:
893       type: OS::Neutron::Port
894       properties:
895         network: { get_param: oam_net_id }
896         fixed_ips: [ { "ip_address": {get_param: db_oam_ip_0}}, { "ip_address": {get_param: db_oam_v6_ip_0 }}]
897     db_1_oam_port_0:
898       type: OS::Neutron::Port
899       properties:
900         network: { get_param: oam_net_id }
901         fixed_ips:
902           - "ip_address": {get_param: db_oam_ip_1}
903           - "ip_address": {get_param: db_oam_v6_ip_1}
904
905
906 *Example*: comma_delimited_list parameters for IPv4 and IPv6 Address
907 Assignments to an internal network*
908
909 In this example, the ``{network-role}`` has been defined as ``ctrl`` to
910 represent an ctrl network internal to the vnf.
911 The ``{vm-type}`` has been defined as ``db`` for
912 database.
913
914 .. code-block:: yaml
915
916   parameters:
917     int_ctrl_net_id:
918       type: string
919       description: Neutron UUID for the ctrl internal network
920     db_int_ctrl_ips:
921       type: comma_delimited_list
922       description: Fixed IPv4 assignments for db VMs on the ctrl internal
923       network
924     db_int_ctrl_v6_ips:
925       type: comma_delimited_list
926       description: Fixed IPv6 assignments for db VMs on the ctrl internal
927       network
928   resources:
929     db_0_int_ctrl_port_0:
930       type: OS::Neutron::Port
931       properties:
932         network: { get_param: int_ctrl_net_id }
933         fixed_ips: [ { "ip_address": {get_param: [ db_int_ctrl_ips, 0 ]}}, {
934         "ip_address": {get_param: [ db_int_ctrl_v6_ips, 0 ]}}]
935     db_1_int_ctrl_port_0:
936       type: OS::Neutron::Port
937       properties:
938         network: { get_param: int_ctrl_net_id }
939         fixed_ips:
940         - "ip_address": {get_param: [ db_int_ctrl_ips, 1 ]}
941         - "ip_address": {get_param: [ db_int_ctrl_v6_ips, 1 ]}
942
943
944 *Example: string parameters for IPv4 and IPv6 Address Assignments to an
945 internal network*
946
947 In this example, the ``int_{network-role}`` has been defined as
948 ``int_ctrl`` to represent a control network internal to the vnf.
949 The ``{vm-type}`` has been defined as ``db`` for database.
950
951 .. code-block:: yaml
952
953   parameters:
954     int_ctrl_net_id:
955       type: string
956       description: Neutron UUID for an OAM internal network
957     db_int_ctrl_ip_0:
958       type: string
959       description: Fixed IPv4 assignment for db VM on the oam_int network
960     db_int_ctrl_ip_1:
961       type: string
962       description: Fixed IPv4 assignment for db VM 1 on the oam_int network
963     db_int_ctrl_v6_ip_0:
964       type: string
965       description: Fixed IPv6 assignment for db VM 0 on the oam_int network
966     db_int_ctrl_v6_ip_1:
967       type: string
968       description: Fixed IPv6 assignment for db VM 1 on the oam_int network
969   resources:
970     db_0_int_ctrl_port_0:
971       type: OS::Neutron::Port
972       properties:
973         network: { get_param: int_oam_int_net_id }
974         fixed_ips: [ { "ip_address": {get_param: db_oam_int_ip_0}}, {
975         "ip_address": {get_param: db_oam_int_v6_ip_0 }}]
976     db_1_int_ctrl_port_0:
977       type: OS::Neutron::Port
978       properties:
979         network: { get_param: int_oam_int_net_id }
980         fixed_ips:
981           - "ip_address": {get_param: db_oam_int_ip_1}
982           - "ip_address": {get_param: db_oam_int_v6_ip_1}
983
984
985 Property: fixed_ips, Map Property: subnet
986 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
987
988 The resource ``OS::Neutron::Port`` property ``fixed_ips`` map
989 property ``subnet`` is used when a
990 port is requesting an IP assignment via
991 OpenStack’s DHCP Service (i.e., cloud assigned).
992
993 The IP address assignment will be made from the specified subnet.
994
995 Specifying the subnet is not required; it is optional.
996
997 If the network (external or internal) that the port is attaching
998 to only contains one subnet, specifying the subnet is
999 superfluous.  The IP address will be assigned from the one existing
1000 subnet.
1001
1002 If the network (external or internal) that the port is attaching
1003 to contains two or more subnets, specifying the subnet in the
1004 ``fixed_ips`` map property ``subnet`` determines which
1005 subnet the IP address will be assigned from.
1006
1007 If the network (external or internal) that the port is attaching
1008 to contains two or more subnets, and the subnet is not is not
1009 specified, OpenStack will randomly determine which subnet
1010 the IP address will be assigned from.
1011
1012 The property ``fixed_ips`` is used to assign IPs to a port. The Map Property
1013 ``subnet`` specifies the subnet the IP is assigned from.
1014
1015 .. req::
1016     :id: R-38236
1017     :target: VNF
1018     :keyword: MUST
1019     :validation_mode: static
1020     :updated: casablanca
1021
1022     The VNF's Heat Orchestration Template's
1023     resource ``OS::Neutron::Port`` property ``fixed_ips``
1024     map property ``subnet`` parameter
1025     **MUST** be declared type ``string``.
1026
1027 .. req::
1028     :id: R-62802
1029     :target: VNF
1030     :keyword: MUST
1031     :validation_mode: static
1032     :updated: casablanca
1033
1034     When the VNF's Heat Orchestration Template's
1035     resource ``OS::Neutron::Port`` is attaching
1036     to an external network (per the ONAP definition, see
1037     Requirement R-57424),
1038     and an IPv4 address is being cloud assigned by OpenStack's DHCP Service
1039     and the external network IPv4 subnet is to be specified
1040     using the property ``fixed_ips``
1041     map property ``subnet``, the parameter
1042     **MUST** follow the naming convention
1043
1044       * ``{network-role}_subnet_id``
1045
1046     where
1047     
1048       * ``{network-role}`` is the network role of the network.
1049
1050 .. req::
1051     :id: R-83677
1052     :target: VNF
1053     :keyword: MUST NOT
1054     :validation_mode: static
1055     :updated: casablanca
1056
1057
1058     The VNF's Heat Orchestration Template's Resource
1059     ``OS::Neutron::Port`` property ``fixed_ips``
1060     map property ``subnet`` parameter
1061     ``{network-role}_subnet_id``
1062     **MUST NOT** be enumerated in the
1063     VNF's Heat Orchestration Template's Environment File.
1064
1065 ONAP's SDN-Controller provides the network's subnet's UUID
1066 value at orchestration to the Heat Orchestration Template.
1067
1068 *Example Parameter Definition*
1069
1070 .. code-block:: yaml
1071
1072   parameters:
1073
1074     {network-role}_subnet_id:
1075       type: string
1076       description: Neutron IPv4 subnet UUID for the {network-role} network
1077
1078
1079 .. req::
1080     :id: R-15287
1081     :target: VNF
1082     :keyword: MUST
1083     :validation_mode: static
1084     :updated: casablanca
1085
1086     When the VNF's Heat Orchestration Template's
1087     resource ``OS::Neutron::Port`` is attaching
1088     to an external network (per the ONAP definition, see
1089     Requirement R-57424),
1090     and an IPv6 address is being cloud assigned by OpenStack's DHCP Service
1091     and the external network IPv6 subnet is to be specified
1092     using the property ``fixed_ips``
1093     map property ``subnet``, the parameter
1094     **MUST** follow the naming convention 
1095
1096       * ``{network-role}_v6_subnet_id``
1097
1098     where 
1099       
1100       * ``{network-role}`` is the network role of the network.
1101
1102 .. req::
1103     :id: R-80829
1104     :target: VNF
1105     :keyword: MUST NOT
1106     :validation_mode: static
1107     :updated: casablanca
1108
1109     The VNF's Heat Orchestration Template's Resource
1110     ``OS::Neutron::Port`` property ``fixed_ips``
1111     map property ``subnet`` parameter
1112     ``{network-role}_v6_subnet_id``
1113     **MUST NOT** be enumerated in the
1114     VNF's Heat Orchestration Template's Environment File.
1115
1116 *Example: One Cloud Assigned IPv4 Address (DHCP) assigned to a network
1117 that has two or more IPv4 subnets*
1118
1119 In this example, the ``{network-role}`` has been defined as ``oam`` to represent
1120 an oam network and the ``{vm-type}`` has been defined as ``lb`` for load
1121 balancer. The cloud assigned IP Address uses the OpenStack DHCP service
1122 to assign IP addresses.
1123
1124 .. code-block:: yaml
1125
1126   parameters:
1127     oam_net_id:
1128       type: string
1129       description: Neutron UUID for the oam network
1130     oam_subnet_id:
1131       type: string
1132       description: Neutron IPv4 subnet UUID for the oam network
1133   resources:
1134     lb_0_oam_port_0:
1135       type: OS::Neutron::Port
1136         parameters:
1137           network: { get_param: oam_net_id }
1138           fixed_ips:
1139             - subnet: { get_param: oam_subnet_id }
1140
1141 *Example: One Cloud Assigned IPv4 address and one Cloud Assigned IPv6
1142 address assigned to a network that has at least one IPv4 subnet and one
1143 IPv6 subnet*
1144
1145 In this example, the ``{network-role}`` has been defined as ``oam`` to represent
1146 an oam network and the ``{vm-type}`` has been defined as ``lb`` for load
1147 balancer.
1148
1149 .. code-block:: yaml
1150
1151   parameters:
1152     oam_net_id:
1153       type: string
1154       description: Neutron UUID for the oam network
1155     oam_subnet_id:
1156       type: string
1157       description: Neutron IPv4 subnet UUID for the oam network
1158     oam_v6_subnet_id:
1159       type: string
1160       description: Neutron IPv6 subnet UUID for the oam network
1161   resources:
1162     lb_0_oam_port_0:
1163       type: OS::Neutron::Port
1164       properties:
1165         network: { get_param: oam_net_id }
1166         fixed_ips:
1167           - subnet: { get_param: oam_subnet_id }
1168           - subnet: { get_param: oam_v6_subnet_id }
1169
1170 .. req::
1171     :id: R-84123
1172     :target: VNF
1173     :keyword: MUST
1174     :validation_mode: static
1175     :updated: casablanca
1176
1177     When
1178
1179       * the VNF's Heat Orchestration Template's
1180         resource ``OS::Neutron::Port`` in an Incremental Module is attaching
1181         to an internal network (per the ONAP definition, see
1182         Requirements R-52425 and R-46461)
1183         that is created in the Base Module, AND
1184       * an IPv4 address is being cloud assigned by OpenStack's DHCP Service AND
1185       * the internal network IPv4 subnet is to be specified
1186         using the property ``fixed_ips`` map property ``subnet``,
1187
1188     the parameter **MUST** follow the naming convention
1189     
1190       * ``int_{network-role}_subnet_id``
1191
1192     where
1193
1194       * ``{network-role}`` is the network role of the internal network
1195
1196     Note that the parameter **MUST** be defined as an ``output`` parameter in
1197     the base module.
1198
1199 .. req::
1200     :id: R-69634
1201     :target: VNF
1202     :keyword: MUST NOT
1203     :validation_mode: static
1204     :updated: casablanca
1205
1206     The VNF's Heat Orchestration Template's Resource
1207     ``OS::Neutron::Port`` property ``fixed_ips``
1208     map property ``subnet`` parameter
1209     ``int_{network-role}_subnet_id``
1210     **MUST NOT** be enumerated in the
1211     VNF's Heat Orchestration Template's Environment File.
1212
1213 The assumption is that internal networks are created in the base module.
1214 The Neutron subnet network ID will be passed as an output parameter
1215 (e.g., ONAP Base Module Output Parameter) to the incremental modules.
1216 In the incremental modules, the output parameter name will be defined as
1217 input parameter.
1218
1219 *Example Parameter Definition*
1220
1221 .. code-block:: yaml
1222
1223   parameters:
1224
1225     int_{network-role}_subnet_id:
1226       type: string
1227       description: Neutron IPv4 subnet UUID for the int_{network-role} network
1228
1229 .. req::
1230     :id: R-76160
1231     :target: VNF
1232     :keyword: MUST
1233     :validation_mode: static
1234     :updated: casablanca
1235
1236     When
1237
1238       * the VNF's Heat Orchestration Template's
1239         resource ``OS::Neutron::Port`` in an Incremental Module is attaching
1240         to an internal network (per the ONAP definition, see Requirements 
1241         R-52425 and R-46461)
1242         that is created in the Base Module, AND
1243       * an IPv6 address is being cloud assigned by OpenStack's DHCP Service AND
1244       * the internal network IPv6 subnet is to be specified
1245         using the property ``fixed_ips`` map property ``subnet``,
1246
1247     the parameter **MUST** follow the naming convention
1248     ``int_{network-role}_v6_subnet_id``,
1249     where ``{network-role}`` is the network role of the internal network.
1250
1251     Note that the parameter **MUST** be defined as an ``output`` parameter in
1252     the base module.
1253
1254 .. req::
1255     :id: R-22288
1256     :target: VNF
1257     :keyword: MUST NOT
1258     :validation_mode: static
1259     :updated: casablanca
1260
1261     The VNF's Heat Orchestration Template's Resource
1262     ``OS::Neutron::Port`` property ``fixed_ips``
1263     map property ``subnet`` parameter
1264     ``int_{network-role}_v6_subnet_id``
1265     **MUST NOT** be enumerated in the
1266     VNF's Heat Orchestration Template's Environment File.
1267
1268
1269 *Example Parameter Definition*
1270
1271 .. code-block:: yaml
1272
1273   parameters:
1274
1275     int_{network-role}_v6_subnet_id:
1276       type: string
1277       description: Neutron subnet UUID for the int_{network-role} network
1278
1279 Property: allowed\_address\_pairs, Map Property: ip\_address
1280 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1281
1282 The property ``allowed_address_pairs`` in the resource ``OS::Neutron::Port``
1283 allows the user to specify a mac_address and/or ip_address that will
1284 pass through a port regardless of subnet. This enables the use of
1285 protocols, such as VRRP, which allow for a Virtual IP (VIP) address
1286 to be shared among two or more ports, with one designated as the master
1287 and the others as backups. In case the master fails,
1288 the Virtual IP address is mapped to a backup's IP address and
1289 the backup becomes the master.
1290
1291 Note that the management of the VIP IP addresses (i.e. transferring
1292 ownership between active and standby VMs) is the responsibility of
1293 the VNF application.
1294
1295 .. req::
1296     :id: R-62300
1297     :target: VNF
1298     :keyword: MUST
1299     :validation_mode: static
1300     :updated: casablanca
1301
1302     If a VNF has two or more ports that require a Virtual IP Address (VIP),
1303     a VNF's Heat Orchestration Template's Resource
1304     ``OS::Neutron::Port`` property ``allowed_address_pairs``
1305     map property ``ip_address`` parameter
1306     **MUST** be used.
1307
1308 The ``allowed_address_pairs`` is an optional property. It is not required.
1309
1310 ONAP automation supports the assignment of VIP addresses
1311 for external networks.  ONAP support the assignment of one IPv4 VIP address
1312 and/or one IPv6 VIP address to a set of ports associated with a
1313 ``{vm-type}`` and ``{network-role}``.
1314
1315 If a VNF requires more than one IPv4 VIP address
1316 and/or more than one IPv6 VIP address to a set of ports associated with a
1317 ``{vm-type}`` and ``{network-role}``, there are "manual" work-around
1318 procedures that can be utilized.
1319
1320 VIP Assignment, External Networks, Supported by Automation
1321 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1322
1323 .. req::
1324     :id: R-91810
1325     :target: VNF
1326     :keyword: MUST NOT
1327     :validation_mode: static
1328     :updated: casablanca
1329
1330     If a VNF requires ONAP to assign a Virtual IP (VIP) Address to
1331     ports connected an external network, the port
1332     **MUST NOT** have more than one IPv4 VIP address.
1333
1334 .. req::
1335     :id: R-41956
1336     :target: VNF
1337     :keyword: MUST NOT
1338     :validation_mode: static
1339     :updated: casablanca
1340
1341     If a VNF requires ONAP to assign a Virtual IP (VIP) Address to
1342     ports connected an external network, the port
1343     **MUST NOT** have more than one IPv6 VIP address.
1344
1345 .. req::
1346     :id: R-10754
1347     :target: VNF
1348     :keyword: MUST
1349     :validation_mode: static
1350     :updated: casablanca
1351
1352     If a VNF has two or more ports that
1353     attach to an external network that require a Virtual IP Address (VIP),
1354     and the VNF requires ONAP automation to assign the IP address,
1355     all the Virtual Machines using the VIP address **MUST**
1356     be instantiated in the same Base Module Heat Orchestration Template
1357     or in the same Incremental Module Heat Orchestration Template.
1358
1359 .. req::
1360     :id: R-98748
1361     :target: VNF
1362     :keyword: MUST
1363     :validation_mode: static
1364     :updated: casablanca
1365
1366     The VNF's Heat Orchestration Template's Resource
1367     ``OS::Neutron::Port`` property ``allowed_address_pairs``
1368     map property ``ip_address`` parameter
1369     **MUST** be declared as type ``string``.
1370
1371 .. req::
1372     :id: R-41492
1373     :target: VNF
1374     :keyword: MUST
1375     :validation_mode: static
1376     :updated: casablanca
1377
1378     When the VNF's Heat Orchestration Template's Resource
1379     ``OS::Neutron::Port`` is attaching to an external network (per the
1380     ONAP definition, see Requirement R-57424),
1381     and an IPv4 Virtual IP (VIP)
1382     address is assigned via ONAP automation
1383     using the property ``allowed_address_pairs``
1384     map property ``ip_address`` and
1385     the parameter name **MUST** follow the
1386     naming convention
1387
1388       * ``{vm-type}_{network-role}_floating_ip``
1389
1390     where
1391
1392       * ``{vm-type}`` is the {vm-type} associated with the
1393         OS::Nova::Server
1394       * ``{network-role}`` is the {network-role} of the external
1395         network
1396     
1397     And the parameter **MUST** be declared as type ``string``.
1398
1399 .. req::
1400     :id: R-83412
1401     :target: VNF
1402     :keyword: MUST NOT
1403     :validation_mode: static
1404     :updated: casablanca
1405
1406     The VNF's Heat Orchestration Template's Resource
1407     ``OS::Neutron::Port`` property ``allowed_address_pairs``
1408     map property ``ip_address`` parameter
1409     ``{vm-type}_{network-role}_floating_ip``
1410     **MUST NOT** be enumerated in the
1411     VNF's Heat Orchestration Template's Environment File.
1412
1413 *Example Parameter Definition*
1414
1415 .. code-block:: yaml
1416
1417   parameters:
1418
1419     {vm-type}_{network-role}_floating_ip:
1420       type: string
1421       description: IPv4 VIP for {vm-type} VMs on the {network-role} network
1422
1423 .. req::
1424     :id: R-35735
1425     :target: VNF
1426     :keyword: MUST
1427     :validation_mode: static
1428     :updated: casablanca
1429
1430     When the VNF's Heat Orchestration Template's Resource
1431     ``OS::Neutron::Port`` is attaching to an external network (per the
1432     ONAP definition, see Requirement R-57424),
1433     and an IPv6 Virtual IP (VIP)
1434     address is assigned via ONAP automation
1435     using the property ``allowed_address_pairs``
1436     map property ``ip_address``, 
1437     the parameter name **MUST** follow the
1438     naming convention
1439
1440       * ``{vm-type}_{network-role}_floating_v6_ip``
1441
1442     where
1443
1444       * ``{vm-type}`` is the {vm-type} associated with the
1445         OS::Nova::Server
1446       * ``{network-role}`` is the {network-role} of the external
1447         network
1448
1449     And the parameter **MUST** be declared as type ``string``.
1450
1451 .. req::
1452     :id: R-83418
1453     :target: VNF
1454     :keyword: MUST NOT
1455     :validation_mode: static
1456     :updated: casablanca
1457
1458     The VNF's Heat Orchestration Template's Resource
1459     ``OS::Neutron::Port`` property ``allowed_address_pairs``
1460     map property ``ip_address`` parameter
1461     ``{vm-type}_{network-role}_floating_v6_ip``
1462     **MUST NOT** be enumerated in the
1463     VNF's Heat Orchestration Template's Environment File.
1464
1465 *Example Parameter Definition*
1466
1467 .. code-block:: yaml
1468
1469   parameters:
1470
1471     {vm-type}_{network-role}_floating_v6_ip:
1472       type: string
1473       description: VIP for {vm-type} VMs on the {network-role} network
1474
1475 Note that these parameters are **not** intended to represent an OpenStack
1476 "Floating IP", for which OpenStack manages a pool of public IP
1477 addresses that are mapped to specific VM ports. In that case, the
1478 individual VMs are not even aware of the public IPs, and all assignment
1479 of public IPs to VMs is via OpenStack commands. ONAP does not support
1480 Neutron-style Floating IPs.  That is, ONAP does not support the
1481 resources ``OS::Neutron::FloatingIP``
1482 and ``OS::Neutron::FloatingIPAssociation``.
1483
1484
1485 .. req::
1486     :id: R-05257
1487     :target: VNF
1488     :keyword: MUST NOT
1489     :validation_mode: static
1490     :updated: casablanca
1491
1492     A VNF's Heat Orchestration Template's **MUST NOT**
1493     contain the Resource ``OS::Neutron::FloatingIP``.
1494
1495 .. req::
1496     :id: R-76449
1497     :target: VNF
1498     :keyword: MUST NOT
1499     :validation_mode: static
1500     :updated: casablanca
1501
1502     A VNF's Heat Orchestration Template's **MUST NOT**
1503     contain the Resource ``OS::Neutron::FloatingIPAssociation``.
1504
1505 The Floating IP functions as a NAT.  They are allocated within
1506 Openstack, and always "terminate" within the Openstack infrastructure.
1507 When Openstack receives packets on a Floating IP, the packets will
1508 be forwarded to the
1509 Port that has been mapped to the Floating IP, using the private address of the
1510 port.  The VM never sees or knows about the Openstack Floating IP.
1511 The process to use is:
1512
1513   - User allocates a floating IP from the Openstack pool.
1514   - User â€˜attaches’ that floating IP to one of the VM ports.
1515
1516 If there is a high-availability VNF that wants to "float" the IP to a
1517 different VM, it requires a Neutron command to request Openstack to â€˜attach’
1518 the floating IP to a different VM port.
1519 The pool of such addresses is managed by Openstack infrastructure.
1520 Users cannot create new ones, they can only choose from those in the pool.
1521 The pool is typically global (i.e. any user/tenant can grab them).
1522
1523 Allowed address pairs are for more typical Linux-level "virtual IPs".
1524 They are additional IP addresses that are advertised by some port on the VM,
1525 in addition to the primary private IP address.  Typically in a
1526 high-availability VNF, an additional IP is assigned and will float between
1527 VMs (e.g., via some health-check app that will plumb the IP on one or other
1528 VM).  In order for this to work, the actual packets must be addressed to that
1529 IP address (and the allowed_ip_address list will let it pass through
1530 to the VM).  This generally requires provider network access
1531 (i.e. direct access to a data center network for the VMs), such that these
1532 IPs can pass through all of the virtual routers.
1533 Contrail also provides the enhanced networking that allows routing of such
1534 additional IPs.
1535
1536 Floating IPs are not used in ONAP due to the NAT-ting nature of the IPs,
1537 the inability to reserve such IPs for specific use, the need to manage them
1538 via Openstack commands (i.e. a HA VNF would require direct access to
1539 Openstack to â€˜float’ such an IP from one VM to another).
1540
1541 *Example:*
1542
1543 In this example, the {network-role} has been defined as oam to represent
1544 an oam network and the {vm-type} has been defined as db for database.
1545
1546 .. code-block:: yaml
1547
1548   parameters:
1549     oam_net_id:
1550       type: string
1551       description: Neutron UUID for the oam network
1552     db_oam_ips:
1553       type: comma_delimited_list
1554       description: Fixed IPs for db VMs on the oam network
1555     db_oam_floating_ip:
1556       type: string
1557       description: VIP IP for db VMs on the oam network
1558   resources:
1559     db_0_oam_port_0:
1560       type: OS::Neutron::Port
1561       properties:
1562         network: { get_param: oam_net_id }
1563         fixed_ips: [ { "ip_address": {get_param: [db_oam_ips,0] }}]
1564         allowed_address_pairs: [ { "ip_address": {get_param:
1565         db_oam_floating_ip}}]
1566     db_1_oam_port_0:
1567       type: OS::Neutron::Port
1568         properties:
1569           network: { get_param: oam_net_id }
1570           fixed_ips: [ { "ip_address": {get_param: [db_oam_ips,1] }}]
1571           allowed_address_pairs: [ { "ip_address": {get_param:
1572           db_oam_floating_ip}}]
1573
1574 VIP Assignment, External Networks, Additional Options
1575 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1576
1577 The parameter ``{vm-type}_{network-role}_floating_ip`` allows for only one
1578 allowed address pair IPv4 address per ``{vm-type}`` and ``{network-role}``
1579 combination.
1580
1581 The parameter ``{vm-type}_{network-role}_floating_v6_ip`` allows for only one
1582 allowed address pair IPv6 address per ``{vm-type}`` and ``{network-role}``
1583 combination.
1584
1585 If there is a need for multiple allowed address pair IPs for a given
1586 {vm-type} and {network-role} combination within a VNF, there are two
1587 options.
1588
1589 **Option One**
1590
1591 If there is a need for multiple allowed address pair IPs for a given
1592 ``{vm-type}`` and ``{network-role}`` combination within a VNF, then the
1593 parameter names defined for the Property ``fixed_ips`` Map Property
1594 ``ip_address`` should be used or the Property ``allowed_address_pairs``
1595 Map Property ``ip_address``. The
1596 parameter names are provided in the table below.
1597
1598 .. csv-table:: **Table 5 OS::Neutron::Port Property allowed_address_pairs map property ip_address Parameter Naming Convention**
1599    :header: IP Address,Parameter Type,Parameter Name
1600    :align: center
1601    :widths: auto
1602
1603    IPv4, string, {vm-type}_{network-role}_ip_{index}
1604    IPv4, comma_delimited_list, {vm-type}_{network-role}_ips
1605    IPv6, string, {vm-type}_{network-role}_v6_ip_{index}
1606    IPv6, comma_delimited_list, {vm-type}_{network-role}_v6_ips
1607
1608 The examples below illustrate this concept.
1609
1610 *Example: A VNF has four load balancers. Each pair has a unique VIP.*
1611
1612 In this example, there are two administrative VM pairs. Each pair has
1613 one VIP. The {network-role} has been defined as oam to represent an oam
1614 network and the {vm-type} has been defined as admin for an
1615 administrative VM.
1616
1617 Pair 1: Resources admin_0_port_0 and admin_1_port_0 share a unique VIP,
1618 [admin_oam_ips,2]
1619
1620 Pair 2: Resources admin_2_port_0 and admin_3_port_0 share a unique VIP,
1621 [admin_oam_ips,5]
1622
1623 .. code-block:: yaml
1624
1625   parameters:
1626     oam_net_id:
1627       type: string
1628       description: Neutron UUID for the oam network
1629     admin_oam_ips:
1630       type: comma_delimited_list
1631       description: Fixed IP assignments for admin VMs on the oam network
1632
1633   resources:
1634     admin_0_oam_port_0:
1635       type: OS::Neutron::Port
1636       properties:
1637         network: { get_param: oam_net_id }
1638         fixed_ips: [ { "ip_address": {get_param: [admin_oam_ips,0] }}]
1639         allowed_address_pairs: [{ "ip_address": {get_param: [admin_oam_ips,2]
1640         }}]
1641     admin_1_oam_port_0:
1642       type: OS::Neutron::Port
1643       properties:
1644         network: { get_param: oam_net_id }
1645         fixed_ips: [ { "ip_address": {get_param: [admin_oam_ips,1] }}]
1646         allowed_address_pairs: [{ "ip_address": {get_param: [admin_oam_ips,2]
1647       }}]
1648     admin_2_oam_port_0:
1649       type: OS::Neutron::Port
1650       properties:
1651         network: { get_param: oam_net_id }
1652         fixed_ips: [ { "ip_address": {get_param: [admin_oam_ips,3] }}]
1653         allowed_address_pairs: [{ "ip_address": {get_param: [admin_oam_ips,5]
1654         }}]
1655     admin_3_oam_port_0:
1656       type: OS::Neutron::Port
1657       properties:
1658         network: { get_param: oam_net_id }
1659         fixed_ips: [ { "ip_address": {get_param: [admin_oam_ips,4] }}]
1660         allowed_address_pairs: [{ "ip_address": {get_param: [admin_oam_ips,5]
1661         }}]
1662
1663 *Example: A VNF has two load balancers. The pair of load balancers share
1664 two VIPs.*
1665
1666 In this example, there is one load balancer pairs. The pair has two
1667 VIPs. The {network-role} has been defined as oam to represent an oam
1668 network and the {vm-type} has been defined as lb for a load balancer VM.
1669
1670 .. code-block:: yaml
1671
1672   resources:
1673     lb_0_oam_port_0:
1674       type: OS::Neutron::Port
1675       properties:
1676         network: { get_param: oam_net_id }
1677         fixed_ips: [ { "ip_address": {get_param: [lb_oam_ips,0] }}]
1678         allowed_address_pairs: [{ "ip_address": {get_param: [lb_oam_ips,2] },
1679         {get_param: [lb_oam_ips,3] }}]
1680     lb_1_oam_port_0:
1681       type: OS::Neutron::Port
1682       properties:
1683         network: { get_param: oam_net_id }
1684         fixed_ips: [ { "ip_address": {get_param: [lb_oam_ips,1] }}]
1685         allowed_address_pairs: [{ "ip_address": {get_param: [lb_oam_ips,2] },
1686         {get_param: [lb_oam_ips,3] }}]
1687
1688 As a general rule, provide the fixed IPs for the VMs indexed first in
1689 the CDL and then the VIPs as shown in the examples above.
1690
1691 **Option Two**
1692
1693 If there is a need for multiple allowed address pair IPs for a given
1694 ``{vm-type}`` and ``{network-role}`` combination within a VNF, then the
1695 parameter names defined for the table below can be used.
1696
1697 **Resource OS::Neutron::Port**
1698
1699 Table 6: Multiple allowed_address_pairs Option 2A
1700
1701 .. csv-table:: **Table 6 OS::Neutron::Port Property allowed_address_pairs map property ip_address Parameter Naming Convention**
1702    :header: IP Address,Parameter Type,Parameter Name
1703    :align: center
1704    :widths: auto
1705
1706    IPv4, string, {vm-type}_{network-role}_vip_{index}
1707    IPv4, comma_delimited_list, {vm-type}_{network-role}_vips
1708    IPv6, string, {vm-type}_{network-role}_v6_vip_{index}
1709    IPv6, comma_delimited_list, {vm-type}_{network-role}_v6_vips
1710
1711
1712 If there is a need for multiple allowed address pair IPs for a given
1713 ``{vm-type}`` and ``{network-role}`` combination within a VNF and the need to
1714 differentiate the VIPs for different traffic types (e.g., 911 VIP,
1715 fail-over VIP), then the parameter names defined for the table below can
1716 be used.
1717
1718 **Resource OS::Neutron::Port**
1719
1720 Table 7: Multiple allowed_address_pairs Option 2B
1721
1722 .. csv-table:: **Table 7 OS::Neutron::Port Property allowed_address_pairs map property ip_address Parameter Naming Convention**
1723    :header: IP Address,Parameter Type,Parameter Name
1724    :align: center
1725    :widths: auto
1726
1727    IPv4, string, {vm-type}_{network-role}_{vip_type}_vip
1728    IPv4, comma_delimited_list, {vm-type}_{network-role}_{vip_type}_vips
1729    IPv6, string, {vm-type}_{network-role}_{vip_type}_v6_vip
1730    IPv6, comma_delimited_list, {vm-type}_{network-role}_{vip_type}_v6_vips
1731
1732 Internal Networks
1733 ~~~~~~~~~~~~~~~~~~~~~~~
1734
1735 ONAP defines an internal network in relation to
1736 the VNF and not with regard to the cloud site. Internal
1737 networks may also be referred to as "intra-VNF" networks or "private"
1738 networks. An internal network only connects VMs in a single VNF. It
1739 must not connect to other VNFs or an external (to the cloud) gateway or an
1740 external (to the cloud) router.
1741
1742 ONAP internal networks should be created in the base module.
1743
1744 As previously mentioned, ports that connect to an internal network are assigned
1745 IP addresses via one of two methods
1746
1747  * Method 1: Cloud assigned by OpenStack's DHCP Service
1748  * Method 2: Statically assigned.  That is, predetermined by the VNF designer
1749    and are specified in the VNF's Heat Orchestration Template's
1750    Environment File
1751
1752 If cloud assigned IP addressing is being used, output statements
1753 are created in the base module.
1754
1755 If static assigned IP addressing is being used, the  IP addresses
1756 are defined in the environment file.
1757
1758
1759   * ``{vm-type}_int_{network-role}_floating_ip``
1760   * ``{vm-type}_int_{network-role}_floating_v6_ip``
1761
1762   * ``{vm-type}_int_{network-role}_vip_{index}``
1763   * ``{vm-type}_int_{network-role}_vips``
1764   * ``{vm-type}_int_{network-role}_v6_vip_{index}``
1765   * ``{vm-type}_int_{network-role}_v6_vips``
1766
1767
1768   * ``{vm-type}_int_{network-role}_{vip_type}_vip``
1769   * ``{vm-type}_int_{network-role}_{vip_type}_vips``
1770   * ``{vm-type}_int_{network-role}_{vip_type}_v6_vip``
1771   * ``{vm-type}_int_{network-role}_{vip_type}_v6_vips``
1772
1773
1774
1775 *Example Parameter Definition*
1776
1777 .. code-block:: yaml
1778
1779   parameters:
1780     {vm-type}_int_{network-role}_floating_ip:
1781       type: string
1782       description: VIP for {vm-type} VMs on the int_{network-role} network
1783
1784     {vm-type}_int_{network-role}_floating_v6_ip:
1785       type: string
1786       description: VIP for {vm-type} VMs on the int_{network-role} network
1787
1788
1789
1790 allowed_address_pair IP Addresses Required in more than one module
1791 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1792
1793 If the IP address ``{vm-type}_{network-role}_floating_ip`` and/or
1794 ``{vm-type}_{network-role}_floating_v6_ip`` must be used in more than module
1795 in the
1796 VNF, the parameter values must be defined as output values in the base module
1797 with
1798 output names: ``{vm-type}_{network-role}_shared_vip`` or
1799 ``{vm-type}_{network-role}_v6_shared_vip``.
1800
1801
1802 .. code-block:: yaml
1803
1804   outputs:
1805     {vm-type}_{network-role}_shared_vip:
1806       description:
1807       value: { get_param: {vm-type}_{network-role}_floating_ip }
1808
1809     {vm-type}_{network-role}_v6_shared_vip:
1810       description:
1811       value: { get_param: {vm-type}_{network-role}_v6_floating_ip }
1812
1813 The output parameters must be defined as input parameter in the
1814 incremental modules that require the IP addresses. When defining the
1815 ``allowed_address_pairs`` in the ``OS::Neutron::Port``, it should be as
1816 follows:
1817
1818 .. code-block:: yaml
1819
1820   allowed_address_pairs: [ { "ip_address": {get_param:
1821   {vm-type}_{network-role}_shared_vip }}, { "ip_address": {get_param:
1822   {vm-type}_{network-role}_v6_shared_vip }}]
1823
1824 Reserve Port Concept
1825 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
1826
1827 A "Reserve Port" is an ``OS::Neutron::Port`` that ``fixed_ips``, ip_address
1828 property is assigned one or more IP addresses that are used as Virtual
1829 IP (VIP) Addresses (i.e., allowed_address_pairs) on other ports.
1830
1831 A "Reserve Port" is never attached to a Virtual Machine
1832 (``OS::Nova::Server``). The reserve port ensures that the intended
1833 ``allowed_address_pair`` IP address is not inadvertently assigned as a
1834 fixed_ips to a ``OS::Neutron::Port`` that is attached ``OS::Nova::Server`` and
1835 thus causing routing issues.
1836
1837 A VNF may have one or more "Reserve Ports". A reserve port maybe created
1838 in the base module or an incremental module. If created in the base
1839 module, parameters may be defined in the outputs: section of the base
1840 template so the IP Address assigned to the reserve port maybe assigned
1841 to the allowed_address_pair property of an ``OS::Neutron::Port`` in one or
1842 more incremental modules.
1843
1844 The parameter name of the IP address used in the "Reserve Port" depends
1845 on the ``allowed_address_pair`` "option" utilized by the VNF.
1846
1847 When creating a Reserve Port, if only one allowed_address_pair is configured
1848 on a port, then the parameter name depends upon the IP addresses type
1849 (IPv4 or IPv6) and network type (internal or external).
1850 The valid parameter names are:
1851
1852   * ``{vm-type}_{network-role}_floating_ip``
1853   * ``{vm-type}_{network-role}_floating_v6_ip``
1854   * ``{vm-type}_int_{network-role}_floating_ip``
1855   * ``{vm-type}_int_{network-role}_floating_v6_ip``
1856
1857 When creating a Reserve Port, if more than one (e.g., multiple)
1858 ``allowed_address_pair`` is configured on a port, then the parameter name
1859 depends
1860 upon the IP addresses type (IPv4 or IPv6) and network type
1861 (internal or external) and the option being used.  The valid parameter
1862 names are:
1863
1864   * ``{vm-type}_{network-role}_ip_{index}``
1865   * ``{vm-type}_{network-role}_ips``
1866   * ``{vm-type}_{network-role}_v6_ip_{index}``
1867   * ``{vm-type}_{network-role}_v6_ips``
1868   * ``{vm-type}_{network-role}_vip_{index}``
1869   * ``{vm-type}_{network-role}_vips``
1870   * ``{vm-type}_{network-role}_v6_vip_{index}``
1871   * ``{vm-type}_{network-role}_v6_vips``
1872   * ``{vm-type}_{network-role}_{vip-type}_vip``
1873   * ``{vm-type}_{network-role}_v6_{vip-type}_vip``
1874   * ``{vm-type}_{network-role}_{vip-type}_vips``
1875   * ``{vm-type}_{network-role}_v6_{vip-type}_vips``
1876
1877
1878 *Example IPv4 Reserve Port Definition: one allowed_address_pair
1879 configured on a port*
1880
1881 .. code-block:: yaml
1882
1883   Reserve_Port_{vm-type}_{network-role}_floating_ip_{index}:
1884     type: OS::Neutron::Port
1885     properties:
1886       network: { get_param: {network-role}_net_id }
1887       fixed_ips:
1888         - ip_address : { get_param: {vm-type}_{network-role}_floating_ip }
1889
1890 *Example IPv6 Reserve Port Definition: one allowed_address_pair
1891 configured on a port*
1892
1893 .. code-block:: yaml
1894
1895   Reserve_Port_{vm-type}_{network-role}_floating_v6_ip_{index}:
1896     type: OS::Neutron::Port
1897     properties:
1898       network: { get_param: {network-role}_net_id }
1899       fixed_ips:
1900         - ip_address : { get_param: {vm-type}_{network-role}_floating_v6_ip }