1 .. Licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2017 AT&T Intellectual Property. All rights reserved.
5 .. _ONAP Heat VNF Modularity:
7 ONAP Heat VNF Modularity
8 ---------------------------
10 ONAP supports a modular Heat Orchestration Template design pattern,
11 referred to as *VNF Modularity.* With this approach, a single VNF **MAY** be
12 composed from one or more Heat Orchestration Templates, each of which
13 represents a subset of the overall VNF. These component parts are
14 referred to as *VNF Modules*. During orchestration, these modules
15 are deployed incrementally to create the complete VNF.
17 As stated in :need:`R-33132`, a VNF's Heat Orchestration Template **MAY** be
18 1. Base Module Heat Orchestration Template (also referred to as a
20 2. Incremental Module Heat Orchestration Template (referred to as
21 an Incremental Module), or
22 3. a Cinder Volume Module Heat Orchestration Template (referred to as
23 Cinder Volume Module).
25 As stated in :need:`R-20974`, at orchestration time, the VNF's Base
26 Module **MUST** be deployed first, prior to any incremental modules.
28 As stated in :need:`R-28980`, :need:`R-86926`, and :need:`R-91497`, a
29 VNF's incremental module **MAY** be used for
31 * initial VNF deployment only
33 * both deployment and scale out
35 As stated in :need:`R-68122`, a VNF's incremental module **MAY** be deployed
36 more than once, either during initial VNF deployment and/or scale out
38 As stated in :need:`R-37028` and :need:`R-13196`, a VNF **MUST** be composed
39 of one Base Module and *MAY** be composed of zero to many Incremental
42 As stated in :need:`R-20974`, at orchestration time, the VNF's Base Module
43 **MUST** be deployed first, prior to any incremental modules.
45 ONAP also supports the concept of an optional, independently deployed
46 Cinder volume via a separate Heat Orchestration Templates, referred to
47 as a Cinder Volume Module. This allows the volume to persist after a VM
48 (i.e., OS::Nova::Server) is deleted, allowing the volume to be reused on
49 another instance (e.g., during a fail over activity).
51 The scope of a Cinder volume module, when it exists, must be 1:1 with a
52 Base module or Incremental Module.
54 A VNF module (base, incremental, cinder) **MAY** support nested templates.
56 A shared Heat Resource is a resource that **MAY** be used by
57 other Heat Resources either in the Base Module or an
64 :validation_mode: static
68 A shared Heat Orchestration Template resource is a resource that **MUST**
69 be defined in the base module and will be referenced by one or
70 more resources in one more more incremental modules.
72 The UUID of the shared resource (created in the base module) **MUST** be
73 exposed by declaring a parameter in the
74 ``outputs`` section of the base module.
76 For ECOMP to provided the UUID value of the shared resource to the
77 incremental module, the parameter name defined in the ``outputs``
78 section of the base module **MUST** be defined as a parameter
79 in the ``parameters`` section of the incremental module.
81 ECOMP will capture the output parameter name and value in the base module
82 and provide the value to the corresponding parameter(s) in the
83 incremental module(s).
85 When the shared resource needs to be referenced by a resource in an
86 incremental module, the UUID of the shared resource must be exposed by
87 declaring an ONAP Base Module Output Parameter.
89 Note that a Cinder volume is not a shared resource. A volume template
90 must correspond 1:1 with a base module or incremental module.
92 An example of a shared resource is the resource
93 OS::Neutron::SecurityGroup. Security groups are sets of IP filter rules
94 that are applied to a VNF’s networking. The resource OS::Neutron::Port
95 has a property security_groups which provides the security groups
96 associated with port. The value of parameter(s) associated with this
97 property must be the UUIDs of the resource(s)
98 OS::Neutron::SecurityGroup.
100 *Note:* A Cinder volume is not considered a shared resource. A volume
101 template must correspond 1:1 with a base template or add-on module
104 Suggested Patterns for Modular VNFs
105 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107 There are numerous variations of VNF modularity. Below are two suggested
110 **Option 1: Incremental Modules per VNFC type**
112 a. Base module contains only the shared resources.
114 b. Group all VMs (e.g., VNFCs) of a given type (i.e. {vm-type}) into its
115 own incremental module. That is, the VNF has an incremental module
118 c. For a given {vm-type} incremental module, the VNF may have
120 i. One incremental module used for both initial turn up and re-used
121 for scaling. This approach is used when the number of VMs
122 instantiated will be the same for initial deployment and scaling.
124 ii. Two incremental modules, where one is used for initial turn up
125 and one is used for scaling. This approach is used when the
126 number of VMs instantiated will be different for initial
127 deployment and scaling.
129 **Option 2: Base VNF with Incremental Growth Modules**
131 a. Base module contains a complete initial VNF instance
133 b. Incremental modules for incremental scaling units
135 i. May contain VMs of multiple types in logical scaling combinations
137 ii. May be separated by VM type for multi-dimensional scaling
139 With no growth units, Option 2 is equivalent to the "One Heat Template
142 Note that modularization of VNFs is not required. A single Heat
143 Orchestration Template (a base module) may still define a complete VNF,
144 which might be appropriate for smaller VNFs that do not have any scaling
150 There are some rules to follow when building modular VNF templates:
152 1. All VNFs must have one Base VNF Module (template) that must be the
153 first one deployed. The base template:
155 a. Must include all shared resources (e.g., private networks, server
156 groups, security groups)
158 b. Must expose all shared resources (by UUID) as "outputs" in its
159 associated Heat template (i.e., ONAP Base Module Output
162 c. May include initial set of VMs
164 d. May be operational as a stand-alone "minimum" configuration of the
167 2. VNFs may have one or more incremental modules which:
169 a. Defines additional resources that can be added to an existing VNF
171 b. Must be complete Heat templates
173 i. i.e. not snippets to be incorporated into some larger template
175 c. Should define logical growth-units or sub-components of an overall
178 d. On creation, receives appropriate Base Module outputs as
181 i. Provides access to all shared resources (by UUID)
183 ii. *VNFs may have one or more incremental modules which must not be
184 dependent on other Add-On VNF Modules*
186 e. Multiple instances of an incremental Module may be added to the
187 same VNF (e.g., incrementally grow a VNF by a fixed "add-on"
190 3. Each VNF Module (base or incremental) may have (optional) an
191 associated Cinder Volume Module (see Cinder Volumes)
193 a. Volume modules must correspond 1:1 with a base module or
196 b. A Cinder volume may be embedded within the base module or
197 incremental module if persistence is not required
199 4. Shared resource UUIDs are passed between the base module and
200 incremental modules via Heat Outputs Parameters (i.e., Base Module
203 a. The output parameter name in the base must match the parameter
204 name in the add-on module
206 VNF Modularity Examples
207 ^^^^^^^^^^^^^^^^^^^^^^^^^
209 *Example: Base Module creates SecurityGroup*
211 A VNF has a base module, named base.yaml, that defines a
212 OS::Neutron::SecurityGroup. The security group will be referenced by an
213 OS::Neutron::Port resource in an incremental module, named
214 INCREMENTAL_MODULE.yaml. The base module defines a parameter in the
215 outputs:section named dns_sec_grp_id. dns_sec_grp_id is defined as a
216 parameter in the incremental module. ONAP captures the UUID value of
217 dns_sec_grp_id from the base module output statement and provides the
218 value to the incremental module.
220 Note that the example below is not a complete Heat Orchestration
221 Template. The {network-role} has been defined as oam to represent an oam
222 network and the {vm-type} has been defined as dns.
232 type: OS::Neutron::SecurityGroup
234 description: vDNS security group
237 template: VNF_NAME_sec_grp_DNS
239 VMF_NAME: {get_param: vnf_name}
245 description: UUID of DNS Resource SecurityGroup
246 value: { get_resource: DNS_SECURITY_GROUP }
248 INCREMENTAL_MODULE.yaml
255 description: security group UUID
260 type: OS::Neutron::Port
264 template: VNF_NAME_dns_oam_port
266 VNF_NAME: {get_param: vnf_name}
267 network: { get_param: oam_net_name }
268 fixed_ips: [{ "ip_address": { get_param: dns_oam_ip_0 }}]
269 security_groups: [{ get_param: dns_sec_grp_id }]
271 *Examples: Base Module creates an internal network*
273 A VNF has a base module, named base_module.yaml, that creates an
274 internal network. An incremental module, named incremental_module.yaml,
275 will create a VM that will connect to the internal network. The base
276 module defines a parameter in the out section named int_oam_net_id.
277 int_oam_net_id is defined as a parameter in the incremental module.
278 ONAP captures the UUID value of int_oam_net_id from the base module
279 output statement and provides the value to the incremental module.
281 Note that the example below is not a complete Heat Orchestration
282 Template. The {network-role} has been defined as oam to represent an oam
283 network and the {vm-type} has been defined as lb for load balancer.
289 heat_template_version: 2013-05-23
293 type: OS::Neutron::Network
300 value: {get_resource: int_oam_network }
306 heat_template_version: 2013-05-23
311 description: ID of shared private network from Base template
314 description: name for the add-on VM instance
318 type: OS::Nova::Server
320 name: {get_param: lb_name_0}
322 - port: { get_resource: get_resource: lb_0_int_oam_port_0 }
325 type: OS::Neutron::Port
327 network: { get_param: int_oam_net_id }