VNFRQTS -Requirements add VF-C link
[vnfrqts/requirements.git] / docs / Chapter7.rst
1 **7. ONAP Management Requirements**
2 =====================================
3
4 a. Service Design
5 ==================
6
7 This section, Service Design, has been left intentionally blank. It is out-of-scope for the VNF Requirements project for the Amsterdam release and no numbered requirements are expected. Content may be added in future updates of this document.
8
9 b. VNF On-boarding and package management
10 ==========================================
11
12 **Design Definition**
13
14 The ONAP Design Time Framework provides the ability to design NFV
15 resources including VNFs, Services, and products. The vendor must
16 provide VNF packages that include a rich set of recipes, management and
17 functional interfaces, policies, configuration parameters, and
18 infrastructure requirements that can be utilized by the ONAP Design
19 module to onboard and catalog these resources. Initially this
20 information may be provided in documents, but in the near future a
21 method will be developed to automate as much of the transfer of data as
22 possible to satisfy its long term requirements.
23
24 The current VNF Package Requirement is based on a subset of the
25 Requirements contained in the ETSI Document: ETSI GS NFV-MAN 001 v1.1.1
26 and GS NFV IFA011 V0.3.0 (2015-10) - Network Functions Virtualization
27 (NFV), Management and Orchestration, VNF Packaging Specification.
28
29 **Resource Description**
30
31 * R-77707 The VNF Vendor **MUST** include a Manifest File that contains a list of all the components in the VNF package.
32 * R-66070 The VNF Package **MUST** include VNF Identification Data to uniquely identify the resource for a given Vendor. The identification data must include: an identifier for the VNF, the name of the VNF as was given by the VNF Vendor, VNF description, VNF Vendor, and version.
33 * R-69565 The VNF Package **MUST** include documentation describing VNF Management APIs. The document must include information and tools for:
34
35  - ONAP to deploy and configure (initially and ongoing) the VNF application(s) (e.g., NETCONF APIs). Includes description of configurable parameters for the VNF and whether the parameters can be configured after VNF instantiation.
36  - ONAP to monitor the health of the VNF (conditions that require healing and/or scaling responses). Includes a description of:
37
38   - Parameters that can be monitored for the VNF and event records (status, fault, flow, session, call, control plane, etc.) generated by the VNF after instantiation.
39   - Runtime lifecycle events and related actions (e.g., control responses, tests) which can be performed for the VNF.
40
41 * R-84366 The VNF Package **MUST** include documentation describing VNF Functional APIs that are utilized to build network and application services. This document describes the externally exposed functional inputs and outputs for the VNF, including interface format and protocols supported.
42 * R-36280 The VNF Vendor **MUST** provide documentation describing VNF Functional Capabilities that are utilized to operationalize the VNF and compose complex services.
43 * R-98617 The VNF Vendor **MUST** provide information regarding any dependency (e.g., affinity, anti-affinity) with other VNFs and resources.
44
45 **Resource Configuration**
46
47 * R-89571 The VNF **MUST** support and provide artifacts for configuration management using at least one of the following technologies:
48
49  - Netconf/YANG
50  - Chef
51  - Ansible
52
53  Note: The requirements for Netconf/YANG, Chef, and Ansible protocols are provided separately and must be supported only if the corresponding protocol option is provided by the vendor.
54
55  **Configuration Management via Netconf/YANG**
56
57  * R-30278 The VNF Vendor **MUST** provide a Resource/Device YANG model as a foundation for creating the YANG model for configuration. This will include VNF attributes/parameters and valid values/attributes configurable by policy.
58  
59  **Configuration Management via Chef** 
60
61  * R-13390 The VNF Vendor **MUST** provide cookbooks to be loaded on the appropriate Chef Server.
62  * R-18525 The VNF Vendor **MUST** provide a JSON file for each supported action for the VNF.  The JSON file must contain key value pairs with all relevant values populated with sample data that illustrates its usage. The fields and their description are defined in Appendix A.
63  
64  Note: Chef support in ONAP is not currently available and planned for 4Q 2017.
65
66  **Configuration Management via Ansible**
67
68  * R-75608 The VNF Vendor **MUST** provide playbooks to be loaded on the appropriate Ansible Server.
69  * R-16777 The VNF Vendor **MUST** provide a JSON file for each supported action for the VNF.  The JSON file must contain key value pairs with all relevant values populated with sample data that illustrates its usage. The fields and their description are defined in Appendix B.
70   
71   Note: Ansible support in ONAP is not currently available and planned for 4Q 2017.
72
73 * R-46567 The VNF Package **MUST** include configuration scripts for boot sequence and configuration.
74 * R-16065 The VNF Vendor **MUST** provide configurable parameters (if unable to conform to YANG model) including VNF attributes/parameters and valid values, dynamic attributes and cross parameter dependencies (e.g., customer provisioning data).
75
76 **Resource Control Loop**
77
78 * R-22888 The VNF Vendor **MUST** provide documentation for the VNF Policy Description to manage the VNF runtime lifecycle. The document must include a description of how the policies (conditions and actions) are implemented in the VNF.
79 * R-01556 The VNF Package **MUST** include documentation describing the fault, performance, capacity events/alarms and other event records that are made available by the VNF. The document must include:
80
81  - A unique identification string for the specific VNF, a description of the problem that caused the error, and steps or procedures to perform Root Cause Analysis and resolve the issue.
82  - All events, severity level (e.g., informational, warning, error) and descriptions including causes/fixes if applicable for the event.
83  - All events (fault, measurement for VNF Scaling, Syslogs, State Change and Mobile Flow), that need to be collected at each VM, VNFC (defined in *VNF Guidelines for Network Cloud and ONAP*) and for the overall VNF.
84
85 * R-27711 The VNF Vendor **MUST** provide an XML file that contains a list of VNF error codes, descriptions of the error, and possible causes/corrective action.
86 * R-01478 The VNF Package **MUST** include documentation describing all parameters that are available to monitor the VNF after instantiation (includes all counters, OIDs, PM data, KPIs, etc.) that must be collected for reporting purposes. The documentation must include a list of:
87
88  - Monitoring parameters/counters exposed for virtual resource management and VNF application management.
89  - KPIs and metrics that need to be collected at each VM for capacity planning and performance management purposes.
90  - The monitoring parameters must include latencies, success rates, retry rates, load and quality (e.g., DPM) for the key transactions/functions supported by the VNF and those that must be exercised by the VNF in order to perform its function.
91  - For each KPI, provide lower and upper limits.
92  - When relevant, provide a threshold crossing alert point for each KPI and describe the significance of the threshold crossing.
93  - For each KPI, identify the suggested actions that need to be performed when a threshold crossing alert event is recorded.
94  - Describe any requirements for the monitoring component of tools for Network Cloud automation and management to provide these records to components of the VNF.
95  - When applicable, provide calculators needed to convert raw data into appropriate reporting artifacts.
96
97 * R-56815 The VNF Package **MUST** include documentation describing supported VNF scaling capabilities and capacity limits (e.g., number of users, bandwidth, throughput, concurrent calls).
98 * R-48596 The VNF Package **MUST** include documentation describing the characteristics for the VNF reliability and high availability.
99 * R-74763 The VNF Vendor **MUST** provide an artifact per VNF that contains all of the VNF Event Records supported. The artifact should include reference to the specific release of the VNF Event Stream Common Event Data Model document it is based on. (e.g., `VES Event Listener <https://github.com/att/evel-test-collector/tree/master/docs/att_interface_definition>`__)
100
101 **Compute, Network, abd Storage Requirements**
102
103 * R-35851 The VNF Package **MUST** include VNF topology that describes basic network and application connectivity internal and external to the VNF including Link type, KPIs, Bandwidth, latency, jitter, QoS (if applicable) for each interface.
104 * R-97102 The VNF Package **MUST** include VM requirements via a Heat template that provides the necessary data for:
105
106 - VM specifications for all VNF components - for hypervisor, CPU, memory, storage.
107   - Network connections, interface connections, internal and external to VNF.
108   - High availability redundancy model.
109   - Scaling/growth VM specifications.
110
111   Note: Must comply with the *Heat requirements in 5.b*.
112
113 * R-26881 The VNF Vendor **MUST** provide the binaries and images needed to instantiate the VNF (VNF and VNFC images).
114 * R-96634 The VNF Vendor **MUST** describe scaling capabilities to manage scaling characteristics of the VNF.
115
116
117 **Testing**
118
119 * R-43958 The VNF Package **MUST** include documentation describing the tests that were conducted by the Vendor and the test results.
120 * R-04298 The VNF Vendor **MUST** provide their testing scripts to support testing.
121 * R-58775 The VNF Vendor **MUST** provide software components that can be packaged with/near the VNF, if needed, to simulate any functions or systems that connect to the VNF system under test. This component is necessary only if the existing testing environment does not have the necessary simulators.
122
123 **Licensing Requirements**
124
125 * R-85653 The VNF **MUST** provide metrics (e.g., number of sessions, number of subscribers, number of seats, etc.) to ONAP for tracking every license.
126 * R-44125 The VNF Vendor **MUST** agree to the process that can be met by Service Provider reporting infrastructure. The Contract shall define the reporting process and the available reporting tools.
127 * R-40827 The VNF Vendor **MUST** enumerate all of the open source licenses their VNF(s) incorporate.
128 * R-97293 The VNF Vendor **MUST NOT** require audits of Service Provider’s business.
129 * R-44569 The VNF Vendor **MUST NOT** require additional infrastructure such as a vendor license server for Vendor functions and metrics..
130 * R-13613 The VNF **MUST** provide clear measurements for licensing purposes to allow automated scale up/down by the management system.
131 * R-27511 The VNF Vendor **MUST** provide the ability to scale up a vendor supplied product during growth and scale down a vendor supplied product during decline without “real-time” restrictions based upon vendor permissions.
132 * R-85991 The VNF Vendor **MUST** provide a universal license key per VNF to be used as needed by services (i.e., not tied to a VM instance) as the recommended solution. The vendor may provide pools of Unique VNF License Keys, where there is a unique key for each VNF instance as an alternate solution. Licensing issues should be resolved without interrupting in-service VNFs.
133 * R-47849 The VNF Vendor **MUST** support the metadata about licenses (and their applicable entitlements) as defined in this document for VNF software, and any license keys required to authorize use of the VNF software.  This metadata will be used to facilitate onboarding the VNF into the ONAP environment and automating processes for putting the licenses into use and managing the full lifecycle of the licenses. The details of this license model are described in Appendix C. Note: License metadata support in ONAP is not currently available and planned for 1Q 2018.
134
135 c. Configuration Management
136 ===========================
137
138 ONAP interacts directly with VNFs through its Network and Application
139 Adapters to perform configuration activities within NFV environment.
140 These activities include service and resource
141 configuration/reconfiguration, automated scaling of resources, service
142 and resource removal to support runtime lifecycle management of VNFs and
143 services. The Adapters employ a model driven approach along with
144 standardized APIs provided by the VNF developers to configure resources
145 and manage their runtime lifecycle.
146
147 Additional details can be found in the `ONAP Application Controller (APPC) API Guide <http://onap.readthedocs.io/en/latest/submodules/appc.git/docs/APPC%20API%20Guide/APPC%20API%20Guide.html>`_, `ONAP VF-C project <http://onap.readthedocs.io/en/latest/submodules/vfc/nfvo/lcm.git/docs/index.html>`_ and the `ONAP SDNC project <http://onap.readthedocs.io/en/latest/submodules/sdnc/northbound.git/docs/index.html>`_.
148
149 NETCONF Standards and Capabilities
150 ----------------------------------
151
152 ONAP Controllers and their Adapters utilize device YANG model and
153 NETCONF APIs to make the required changes in the VNF state and
154 configuration. The VNF providers must provide the Device YANG model and
155 NETCONF server supporting NETCONF APIs to comply with target ONAP and
156 industry standards.
157
158 **VNF Configuration via NETCONF Requirements**
159
160 **Configuration Management**
161
162 * R-88026 The VNF **MUST** include a NETCONF server enabling runtime configuration and lifecycle management capabilities. 
163 * R-95950 The VNF **MUST** provide a NETCONF interface fully defined by supplied YANG models for the embedded NETCONF server. 
164
165 **NETCONF Server Requirements**
166
167 * R-73468 The VNF **MUST** allow the NETCONF server connection parameters to be configurable during virtual machine instantiation through Heat templates where SSH keys, usernames, passwords, SSH service and SSH port numbers are Heat template parameters.
168 * R-90007 The VNF **MUST** implement the protocol operation: **close-session()**- Gracefully close the current session.
169 * R-70496 The VNF **MUST** implement the protocol operation: **commit(confirmed, confirm-timeout)** - Commit candidate configuration datastore to the running configuration.
170 * R-18733 The VNF **MUST** implement the protocol operation: **discard-changes()** - Revert the candidate configuration datastore to the running configuration.
171 * R-44281 The VNF **MUST** implement the protocol operation: **edit-config(target, default-operation, test-option, error-option, config)** - Edit the target configuration datastore by merging, replacing, creating, or deleting new config elements.
172 * R-60106 The VNF **MUST** implement the protocol operation: **get(filter)** - Retrieve (a filtered subset of) the running configuration and device state information. This should include the list of VNF supported schemas.
173 * R-29488 The VNF **MUST** implement the protocol operation: **get-config(source, filter)** - Retrieve a (filtered subset of a) configuration from the configuration datastore source.
174 * R-11235 The VNF **MUST** implement the protocol operation: **kill-session(session)** - Force the termination of **session**.
175 * R-02597 The VNF **MUST** implement the protocol operation: **lock(target)** - Lock the configuration datastore target.
176 * R-96554 The VNF **MUST** implement the protocol operation: **unlock(target)** - Unlock the configuration datastore target.
177 * R-29324 The VNF **SHOULD** implement the protocol operation: **copy-config(target, source) -** Copy the content of the configuration datastore source to the configuration datastore target. 
178 * R-88031 The VNF **SHOULD** implement the protocol operation: **delete-config(target) -** Delete the named configuration datastore target.
179 * R-97529 The VNF **SHOULD** implement the protocol operation: **get-schema(identifier, version, format) -** Retrieve the YANG schema.
180 * R-62468 The VNF **MUST** allow all configuration data shall to be edited through a NETCONF <edit-config> operation. Proprietary NETCONF RPCs that make configuration changes are not sufficient.
181 * R-01382 The VNF **MUST** allow the entire configuration of the VNF to be retrieved via NETCONF's <get-config> and <edit-config>, independently of whether it was configured via NETCONF or other mechanisms.
182 * R-28756 The VNF **MUST** support **:partial-lock** and **:partial-unlock** capabilities, defined in RFC 5717. This allows multiple independent clients to each write to a different part of the <running> configuration at the same time.
183 * R-83873 The VNF **MUST** support **:rollback-on-error** value for the <error-option> parameter to the <edit-config> operation. If any error occurs during the requested edit operation, then the target database (usually the running configuration) will be left affected. This provides an 'all-or-nothing' edit mode for a single <edit-config> request.
184 * R-68990 The VNF **MUST** support the **:startup** capability. It will allow the running configuration to be copied to this special database. It can also be locked and unlocked.
185 * R-68200 The VNF **MUST** support the **:url** value to specify protocol operation source and target parameters. The capability URI for this feature will indicate which schemes (e.g., file, https, sftp) that the server supports within a particular URL value. The 'file' scheme allows for editable local configuration databases. The other schemes allow for remote storage of configuration databases.
186 * R-20353 The VNF **MUST** implement at least one of the capabilities **:candidate** or **:writable-running**. If both **:candidate** and **:writable-running** are provided then two locks should be supported.
187 * R-11499 The VNF **MUST** fully support the XPath 1.0 specification for filtered retrieval of configuration and other database contents. The 'type' attribute within the <filter> parameter for <get> and <get-config> operations may be set to 'xpath'. The 'select' attribute (which contains the XPath expression) will also be supported by the server. A server may support partial XPath retrieval filtering, but it cannot advertise the **:xpath** capability unless the entire XPath 1.0 specification is supported.
188 * R-83790 The VNF **MUST** implement the **:validate** capability
189 * R-49145 The VNF **MUST** implement **:confirmed-commit** If **:candidate** is supported.
190 * R-58358 The VNF **MUST** implement the **:with-defaults** capability [RFC6243].
191 * R-59610 The VNF **MUST** implement the data model discovery and download as defined in [RFC6022].
192 * R-87662 The VNF **SHOULD** implement the NETCONF Event Notifications [RFC5277].
193 * R-93443 The VNF **MUST** define all data models in YANG [RFC6020], and the mapping to NETCONF shall follow the rules defined in this RFC.
194 * R-26115 The VNF **MUST** follow the data model upgrade rules defined in [RFC6020] section 10. All deviations from section 10 rules shall be handled by a built-in automatic upgrade mechanism.
195 * R-10716 The VNF **MUST** support parallel and simultaneous configuration of separate objects within itself.
196 * R-29495 The VNF **MUST** support locking if a common object is being manipulated by two simultaneous NETCONF configuration operations on the same VNF within the context of the same writable running data store (e.g., if an interface parameter is being configured then it should be locked out for configuration by a simultaneous configuration operation on that same interface parameter).
197 * R-53015 The VNF **MUST** apply locking based on the sequence of NETCONF operations, with the first configuration operation locking out all others until completed.
198 * R-02616 The VNF **MUST** permit locking at the finest granularity if a VNF needs to lock an object for configuration to avoid blocking simultaneous configuration operations on unrelated objects (e.g., BGP configuration should not be locked out if an interface is being configured or entire Interface configuration should not be locked out if a non-overlapping parameter on the interface is being configured).
199 * R-41829 The VNF **MUST** be able to specify the granularity of the lock via a restricted or full XPath expression.
200 * R-66793 The VNF **MUST** guarantee the VNF configuration integrity for all simultaneous configuration operations (e.g., if a change is attempted to the BUM filter rate from multiple interfaces on the same EVC, then they need to be sequenced in the VNF without locking either configuration method out).
201 * R-54190 The VNF **MUST** release locks to prevent permanent lock-outs when/if a session applying the lock is terminated (e.g., SSH session is terminated).
202 * R-03465 The VNF **MUST** release locks to prevent permanent lock-outs when the corresponding <partial-unlock> operation succeeds.
203 * R-63935 The VNF **MUST** release locks to prevent permanent lock-outs when a user configured timer has expired forcing the NETCONF SSH Session termination (i.e., product must expose a configuration knob for a user setting of a lock expiration timer)
204 * R-10173 The VNF **MUST** allow another NETCONF session to be able to initiate the release of the lock by killing the session owning the lock, using the <kill-session> operation to guard against hung NETCONF sessions.
205 * R-88899 The VNF **MUST** support simultaneous <commit> operations within the context of this locking requirements framework.
206 * R-07545 The VNF **MUST** support all operations, administration and management (OAM) functions available from the supplier for VNFs using the supplied YANG code and associated NETCONF servers.
207 * R-60656 The VNF **MUST** support sub tree filtering.
208 * R-80898 The VNF **MUST** support heartbeat via a <get> with null filter.
209 * R-06617 The VNF **MUST** support get-schema (ietf-netconf-monitoring) to pull YANG model over session.
210 * R-25238 The VNF PACKAGE **MUST** validated YANG code using the open source pyang [2]_ program using the following commands:
211
212 .. code-block:: python
213
214  $ pyang --verbose --strict <YANG-file-name(s)>
215  $ echo $!
216
217 * R-63953 The VNF **MUST** have the echo command return a zero value otherwise the validation has failed
218 * R-26508 The VNF **MUST** support NETCONF server that can be mounted on OpenDaylight (client) and perform the following operations:
219  
220 - Modify, update, change, rollback configurations using each configuration data element.
221 - Query each state (non-configuration) data element. 
222 - Execute each YANG RPC.
223 - Receive data through each notification statement.
224
225
226
227 The following requirements provides the Yang models that suppliers must
228 conform, and those where applicable, that suppliers need to use.
229
230 * R-28545 The VNF **MUST** conform its YANG model to RFC 6060, “YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)”
231 * R-29967 The VNF **MUST** conform its YANG model to RFC 6022, “YANG module for NETCONF monitoring”.
232 * R-22700 The VNF **MUST** conform its YANG model to RFC 6470, “NETCONF Base Notifications”.
233 * R-10353 The VNF **MUST** conform its YANG model to RFC 6244, “An Architecture for Network Management Using NETCONF and YANG”.
234 * R-53317 The VNF **MUST** conform its YANG model to RFC 6087, “Guidelines for Authors and Reviewers of YANG Data Model Documents”.
235 * R-33955 The VNF **SHOULD** conform its YANG model to \*\*RFC 6991, “Common YANG Data Types”.
236 * R-22946 The VNF **SHOULD** conform its YANG model to RFC 6536, “NETCONF Access Control Model”.
237 * R-10129 The VNF **SHOULD** conform its YANG model to RFC 7223, “A YANG Data Model for Interface Management”.
238 * R-12271 The VNF **SHOULD** conform its YANG model to RFC 7223, “IANA Interface Type YANG Module”.
239 * R-49036 The VNF **SHOULD** conform its YANG model to RFC 7277, “A YANG Data Model for IP Management”.
240 * R-87564 The VNF **SHOULD** conform its YANG model to RFC 7317, “A YANG Data Model for System Management”.
241 * R-24269 The VNF **SHOULD** conform its YANG model to RFC 7407, “A YANG Data Model for SNMP Configuration”.
242
243 The NETCONF server interface shall fully conform to the following
244 NETCONF RFCs.
245
246 * R-33946 The VNF **MUST** conform to the NETCONF RFC 4741, “NETCONF Configuration Protocol”.
247 * R-04158 The VNF **MUST** conform to the NETCONF RFC 4742, “Using the NETCONF Configuration Protocol over Secure Shell (SSH)”.
248 * R-13800 The VNF **MUST** conform to the NETCONF RFC 5277, “NETCONF Event Notification”.
249 * R-01334 The VNF **MUST** conform to the NETCONF RFC 5717, “Partial Lock Remote Procedure Call”.
250 * R-08134 The VNF **MUST** conform to the NETCONF RFC 6241, “NETCONF Configuration Protocol”.
251 * R-78282 The VNF **MUST** conform to the NETCONF RFC 6242, “Using the Network Configuration Protocol over Secure Shell”.
252
253 VNF REST APIs 
254 --------------
255
256 Healthcheck is a command for which no NETCONF support exists. Therefore,
257 this must be supported using a RESTful interface which we have defined.
258
259 The VNF via APP-C must provide a REST formatted GET RPCs to support Healthcheck
260 queries via the GET method over HTTP(s).
261
262 The VNF via VF-C must provide REST APIs to make the configurations of
263 associated VNFs.
264
265 The port number, url, and other authentication information is provided
266 by the VNF vendor.
267
268 **REST APIs**
269
270 * R-31809 The VNF **MUST** support the HealthCheck RPC. The HealthCheck RPC, executes a vendor-defined VNF Healthcheck over the scope of the entire VNF (e.g., if there are multiple VNFCs, then run a health check, as appropriate, for all VNFCs). It returns a 200 OK if the test completes. A JSON object is returned indicating state (healthy, unhealthy), scope identifier, time-stamp and one or more blocks containing info and fault information. If the VNF is unable to run the HealthCheck, return a standard http error code and message.
271
272 Examples:
273
274 .. code-block:: python
275
276  200
277  { 
278    "identifier": "scope represented",
279    "state": "healthy",
280    "time": "01-01-1000:0000"
281  } 
282
283  200
284  { 
285    "identifier": "scope represented",
286    "state": "unhealthy",
287     {[
288    "info": "System threshold exceeded details", 
289    "fault":
290      { 
291        "cpuOverall": 0.80,
292        "cpuThreshold": 0.45    
293      }
294      ]},    
295    "time": "01-01-1000:0000"
296  }
297
298
299 **Table 5. VNF REST APIs**
300
301 +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+
302 | **Principal**   | **Description**                                                                                                                                                                                                                                                                                                                                                                                       | **Type**   | **ID #**   |
303 +=================+=======================================================================================================================================================================================================================================================================================================================================================================================================+============+============+
304 +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+
305 | REST APIs       |  **/configuration** This API executes a vendor-defined VNF configuration action over the scope of the entire VNF(e.g if there are multiple VMs, then run configuration on all VMs according to the input parameters).                                                                                                                                                                                 |  Must      | 12200      |
306 |                 |  **/configuration** returns a 201 Created if the configuration succeeds or a 4XX/5XX response if it fails. A JSON object is returned indicating the outcome of the VNF configuration including all the necessary configuration info.                                                                                                                                                                  |            |            |
307 +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+
308
309 Chef Standards and Capabilities
310 -------------------------------
311
312 ONAP will support configuration of VNFs via Chef subject to the
313 requirements and guidelines defined in this section.
314
315 The Chef configuration management mechanism follows a client-server
316 model. It requires the presence of a Chef-Client on the VNF that will be
317 directly managed by a Chef Server. The Chef-client will register with
318 the appropriate Chef Server and are managed via ‘cookbooks’ and
319 configuration attributes loaded on the Chef Server which contain all
320 necessary information to execute the appropriate actions on the VNF via
321 the Chef-client.
322
323 ONAP will utilize the open source Chef Server, invoke the documented
324 Chef REST APIs to manage the VNF and requires the use of open source
325 Chef-Client and Push Jobs Client on the VNF
326 (https://downloads.chef.io/).
327
328 **VNF Configuration via Chef Requirements**
329
330 **Chef Server Requirements**
331
332 ONAP will interact with the Chef Server designated to manage a target VNF. ONAP design allows for the VNF to register with the following types of Chef Server  [3]_:
333
334 -  **Chef Server hosted by ONAP**: ONAP will provide a Chef Server to manage a VNF.
335
336  * R-77786 The VNF Package **MUST** include all relevant cookbooks to be loaded on the ONAP Chef Server.
337
338 -  **Chef Server hosted in Tenant Space**: The Chef Server may also be hosted external to ONAP in tenant space.
339
340  * R-85428 The VNF **MUST** meet the same guidelines as Chef Server hosted by ONAP.
341  * R-23823 The VNF Package **MUST** include appropriate credentials so that ONAP can interact with the Chef Server.
342
343 **Chef Client Requirements**
344
345 * R-79224 The VNF **MUST** have the chef-client be preloaded with validator keys and configuration to register with the designated Chef Server as part of the installation process.
346 * R-72184 The VNF **MUST** have routable FQDNs for all the endpoints (VMs) of a VNF that contain chef-clients which are used to register with the Chef Server.  As part of invoking VNF actions, ONAP will trigger push jobs against FQDNs of endpoints for a VNF, if required.
347 * R-47068 The VNF **MAY** expose a single endpoint that is responsible for all functionality.
348 * R-67114 The VNF **MUST** be installed with:
349
350  -  Chef-Client >= 12.0
351  -  Chef push jobs client >= 2.0
352
353 **Chef Roles/Requirements**
354
355 * R-27310 The VNF Package **MUST** include all relevant Chef artifacts (roles/cookbooks/recipes) required to execute VNF actions requested by ONAP for loading on appropriate Chef Server.
356 * R-26567 The VNF Package **MUST** include a run list of roles/cookbooks/recipes, for each supported VNF action, that will perform the desired VNF action in its entirety as specified by ONAP (see Section 8.c, ONAP Controller APIs and Behavior, for list of VNF actions and requirements), when triggered by a chef-client run list in JSON file.
357 * R-98911 The VNF **MUST NOT** use any instance specific parameters for the VNF in roles/cookbooks/recipes invoked for a VNF action.
358 * R-37929 The VNF **MUST** accept all necessary instance specific data from the environment or node object attributes for the VNF in roles/cookbooks/recipes invoked for a VNF action.
359 * R-62170 The VNF **MUST** over-ride any default values for configurable parameters that can be set by ONAP in the roles, cookbooks and recipes.
360 * R-78116 The VNF **MUST** update status on the Chef Server appropriately (e.g., via a fail or raise an exception) if the chef-client run encounters any critical errors/failures when executing a VNF action.
361 * R-44013 The VNF **MUST** populate an attribute, defined as node[‘PushJobOutput’] with the desired output on all nodes in the push job that execute chef-client run if the VNF action requires the output of a chef-client run be made available (e.g., get running configuration).
362 * R-30654 The VNF Package **MUST** have appropriate cookbooks that are designed to automatically ‘rollback’ to the original state in case of any errors for actions that change state of the VNF (e.g., configure).
363 * R-65755 The VNF **SHOULD** support callback URLs to return information to ONAP upon completion of the chef-client run for any chef-client run associated with a VNF action.
364
365 -  As part of the push job, ONAP will provide two parameters in the environment of the push job JSON object:
366     -  ‘RequestId’ a unique Id to be used to identify the request,
367     -  ‘CallbackUrl’, the URL to post response back.
368
369 -  If the CallbackUrl field is empty or missing in the push job, then the chef-client run need not post the results back via callback.
370
371 * R-15885 The VNF **MUST** Upon completion of the chef-client run, POST back on the callback URL, a JSON object as described in Table A2 if the chef-client run list includes a cookbook/recipe that is callback capable. Failure to POST on the Callback Url should not be considered a critical error. That is, if the chef-client successfully completes the VNF action, it should reflect this status on the Chef Server regardless of whether the Callback succeeded or not.
372
373 ONAP Chef API Usage
374 ~~~~~~~~~~~~~~~~~~~
375
376 This section outlines the workflow that ONAP invokes when it receives an
377 action request against a Chef managed VNF.
378
379 1. When ONAP receives a request for an action for a Chef Managed VNF, it
380    retrieves the corresponding template (based on **action** and
381    **VNF)** from its database and sets necessary values in the
382    “Environment”, “Node” and “NodeList” keys (if present) from either
383    the payload of the received action or internal data.
384
385 2. If “Environment” key is present in the updated template, it posts the
386    corresponding JSON dictionary to the appropriate Environment object
387    REST endpoint on the Chef Server thus updating the Environment
388    attributes on the Chef Server.
389
390 3. Next, it creates a Node Object from the “Node” JSON dictionary for
391    all elements listed in the NodeList (using the FQDN to construct the
392    endpoint) by replicating it  [4]_. As part of this process, it will
393    set the name field in each Node Object to the corresponding FQDN.
394    These node objects are then posted on the Chef Server to
395    corresponding Node Object REST endpoints to update the corresponding
396    node attributes.
397
398 4. If PushJobFlag is set to “True” in the template, ONAP requests a push
399    job against all the nodes in the NodeList to trigger
400    chef-client\ **.** It will not invoke any other command via the push
401    job. ONAP will include a callback URL in the push job request and a
402    unique Request Id. An example push job posted by ONAP is listed
403    below:
404
405    {
406
407    "command": "chef-client",
408
409    "run\_timeout": 300,
410
411    "nodes”: [“node1.vnf\_a.onap.com”, “node2.vnf\_a.onap.com”],
412
413    "env": {
414
415    “RequestId”:”8279-abcd-aksdj-19231”,
416
417    “CallbackUrl”:”<callback>”
418
419    },
420
421    }
422
423 5. If CallbackCapable field in the template is not present or set to
424    “False” ONAP will poll the Chef Server to check completion status of
425    the push job.
426
427 6. If “GetOutputFlag” is set to “True” in the template and
428    CallbackCapable is not set to “True”, ONAP will retrieve any output
429    from each node where the push job has finished by accessing the Node
430    Object attribute node[‘PushJobOutput’].
431
432 Ansible Standards and Capabilities
433 ----------------------------------
434
435 ONAP will support configuration of VNFs via Ansible subject to the
436 requirements and guidelines defined in this section.
437
438 Ansible allows agentless management of VMs via execution of ‘playbooks’
439 over ssh. The ‘playbooks’ are a structured set of tasks which contain
440 all the necessary data and execution capabilities to take the necessary
441 action on one or more target VMs of the VNF. ONAP will utilize the
442 framework of an Ansible Server that will host and invoke playbooks to
443 manage VNFs that support Ansible.
444
445 **VNF Configuration via Ansible Requirements**
446
447 **Ansible Server Requirements**
448
449 ONAP will utilize an Ansible server in order to manage VNFs that support Ansible playbooks.  We note that Ansible in general does not require the use of a server. However, this framework has been adopted to align with ONAP architecture, ease of management and scalability.
450 All playbooks for the VNF will be hosted on a designated Ansible Server that meets ONAP Ansible API requirements. ONAP design allows for VNFs to be managed by an Ansible Server in any of the two following forms [5]_:
451
452 -  **Ansible Server hosted by ONAP**: ONAP will provide an Ansible Server to manage a VNF.
453
454  * R-07879 The VNF Package **MUST** include all relevant playbooks to ONAP to be loaded on the Ansible Server.
455
456 -  **Ansible Server hosted in Tenant Space**:
457
458  * R-35305 The VNF **MUST** meet the same guidelines as the Ansible Server hosted by ONAP.
459  * R-91681 The VNF **MUST** meet the ONAP Ansible Server API Interface requirements.
460
461 **Ansible Client Requirements**
462
463 * R-32217 The VNF **MUST** have routable FQDNs that are reachable via the Ansible Server for the endpoints (VMs) of a VNF on which playbooks will be executed. ONAP will initiate requests to the Ansible Server for invocation of playbooks against these end points [6]_.
464 * R-98929 The VNF **MAY** have a single endpoint.
465 * R-54373 The VNF **MUST** have Python >= 2.7 on the endpoint VM(s) of a VNF on which an Ansible playbook will be executed.
466 * R-35401 The VNF **MUST** must support SSH and allow SSH access to the Ansible server for the endpoint VM(s) and comply with the  Network Cloud Service Provider guidelines for authentication and access.
467
468 **Ansible Playbook Requirements**
469
470 An Ansible playbook is a collection of tasks that is executed on the Ansible server (local host) and/or the target VM (s) in order to complete the desired action.
471
472 * R-40293 The VNF **MUST** make available (or load on VNF Ansible Server) playbooks that conform to the ONAP requirement.
473 * R-49396 The VNF **MUST** support each VNF action by invocation of **one** playbook [7]_. The playbook will be responsible for executing all necessary tasks (as well as calling other playbooks) to complete the request.
474 * R-33280 The VNF **MUST NOT** use any instance specific parameters in a playbook.
475 * R-48698 The VNF **MUST** utilize   information from key value pairs that will be provided by the Ansible Server as extra-vars during invocation to execute the desired VNF action. If the playbook requires files, they must also be supplied using the methodology detailed in the Ansible Server API.
476
477 The Ansible Server will determine if a playbook invoked to execute a VNF action finished successfully or not using the “PLAY_RECAP” summary in Ansible log.  The playbook will be considered to successfully finish only if the “PLAY RECAP” section at the end of playbook execution output has no unreachable hosts and no failed tasks. Otherwise, the playbook will be considered to have failed.
478
479 * R-43253 The VNF **MUST** use playbooks designed to allow Ansible Server to infer failure or success based on the “PLAY_RECAP” capability.
480 * R-50252 The VNF **MUST** write to a specific set of text files that will be retrieved and made available by the Ansible Server If, as part of a VNF action (e.g., audit), a playbook is required to return any VNF information.
481 * R-51442 The VNF **SHOULD** use playbooks that are designed to automatically ‘rollback’ to the original state in case of any errors for actions that change state of the VNF (e.g., configure). 
482
483 ONAP Controller APIs and Behavior
484 ---------------------------------
485
486 ONAP Controllers support the following operations which act directly
487 upon the VNF. Most of these utilize the NETCONF interface. There are
488 additional commands in use but these either act internally on Controller
489 itself or depend upon network cloud components for implementation. Those
490 actions do not put any special requirement on the VNF provider.
491
492 The following table summarizes how the VNF must act in response to
493 commands from ONAP.
494
495 Table 8. ONAP Controller APIs and NETCONF Commands
496
497 +---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
498 | **Action**          | **Description**                                                                                                                                                                                                                                                                  | **NETCONF Commands**                                                                                                                                                                                                          |
499 +=====================+==================================================================================================================================================================================================================================================================================+===============================================================================================================================================================================================================================+
500 | Action              | Queries ONAP Controller for the current state of a previously submitted runtime LCM (Lifecycle Management) action.                                                                                                                                                               | There is currently no way to check the request status in NETCONF so action status is managed internally by the ONAP controller.                                                                                               |
501 |                     |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
502 | Status              |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
503 +---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
504 | Audit, Sync         | Compare active (uploaded) configuration against the current configuration in the ONAP controller. Audit returns failure if different. Sync considers the active (uploaded) configuration as the current configuration.                                                           | The <get-config> operation is used to retrieve the running configuration from the VNF.                                                                                                                                        |
505 +---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
506 | Lock,               | Returns true when the given VNF has been locked.                                                                                                                                                                                                                                 | There is currently no way to query lock state in NETCONF so VNF locking and unlocking is managed internally by the ONAP controller.                                                                                           |
507 |                     |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
508 | Unlock,             |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
509 |                     |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
510 | CheckLock           |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
511 +---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
512 | Configure,          | Configure applies a post-instantiation configuration the target VNF or VNFC. ConfigModify updates only a subset of the total configuration parameters of a VNF.                                                                                                                  | The <edit-config> operation loads all or part of a specified configuration data set to the specified target database. If there is no <candidate/> database, then the target is the <running/> database. A <commit> follows.   |
513 |                     |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
514 | ConfigModify        |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
515 +---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
516 | Health              | Executes a VNF health check and returns the result. A health check is VNF-specific.                                                                                                                                                                                              | The ONAP health check interface is defined over REST and requires the target VNF to expose a standardized HTTP(S) interface for that purpose. See Section 8.c VNF REST APIs.                                                  |
517 |                     |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
518 | Check               |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
519 +---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
520 | StartApplication,   | ONAP requests application to be started or stopped on the VNF or VNFC. These actions do not need to be supported if (1) the application starts automatically after Configure or if the VM’s are started and (2) the application gracefully shuts down if the VM’s are stopped.   | These commands have no specific NETCONF RPC action.                                                                                                                                                                           |
521 |                     |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
522 | StopApplication     |                                                                                                                                                                                                                                                                                  | They can be supported using Ansible or Chef (see Table 9 below).                                                                                                                                                              |
523 +---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
524 | SoftwareUpload,     | Upgrades the target VNF to a new version without interrupting VNF operation.                                                                                                                                                                                                     | These commands have no specific NETCONF RPC action.                                                                                                                                                                           |
525 |                     |                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                               |
526 | LiveUpgrade         |                                                                                                                                                                                                                                                                                  | They can be supported using Ansible or Chef (see Table 9 below).                                                                                                                                                              |
527 +---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
528
529 Table 9 lists the required Chef and Ansible support for commands from
530 ONAP.
531
532 Table 9. ONAP Controller APIs and Chef/Ansible Support
533
534 +---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
535 | **Action**          | **Chef**                                                                                                                                                                                                                                                                                         | **Ansible**                                                                                                                                                                                                                                             |
536 +=====================+==================================================================================================================================================================================================================================================================================================+=========================================================================================================================================================================================================================================================+
537 | Action              | Not needed. ActionStatus is managed internally by the ONAP controller.                                                                                                                                                                                                                           | Not needed. ActionStatus is managed internally by the ONAP controller.                                                                                                                                                                                  |
538 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
539 | Status              |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
540 +---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
541 | Audit, Sync         | VNF Vendor must provide any necessary roles, cookbooks, recipes to retrieve the running configuration from a VNF and place it in the respective Node Objects ‘PushJobOutput’ attribute of all nodes in NodeList when triggered by a chef-client run.                                             | VNF Vendor must provide an Ansible playbook to retrieve the running configuration from a VNF and place the output on the Ansible server in a manner aligned with playbook requirements listed in this document.                                         |
542 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
543 |                     | The JSON file for this VNF action is required to set “PushJobFlag” to “True” and “GetOutputFlag” to “True”. The “Node” JSON dictionary must have the run list populated with the necessary sequence of roles, cookbooks, recipes.                                                                | The PlaybookName must be provided in the JSON file.                                                                                                                                                                                                     |
544 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
545 |                     | The Environment and Node values should contain all appropriate configuration attributes.                                                                                                                                                                                                         | NodeList must list FQDNs of an example VNF on which to execute playbook.                                                                                                                                                                                |
546 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
547 |                     | NodeList must list sample FQDNs that are required to conduct a chef-client run for this VNF Action.                                                                                                                                                                                              |                                                                                                                                                                                                                                                         |
548 +---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
549 | Lock,               | Not needed. VNF locking and unlocking is managed internally by the ONAP controller.                                                                                                                                                                                                              | Not needed. VNF locking and unlocking is managed internally by the ONAP controller.                                                                                                                                                                     |
550 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
551 | Unlock,             |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
552 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
553 | CheckLock           |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
554 +---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
555 | Configure,          | VNF Vendor must provide any necessary roles, cookbooks, recipes to apply configuration attributes to the VNF when triggered by a chef-client run. All configurable attributes must be obtained from the Environment and Node objects on the Chef Server.                                         | VNF Vendor must provide an Ansible playbook that can configure the VNF with parameters supplied by the Ansible Server.                                                                                                                                  |
556 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
557 | ConfigModify        | The JSON file for this VNF action should include all configurable attributes in the Environment and/or Node JSON dictionary.                                                                                                                                                                     | The PlaybookName must be provided in the JSON file.                                                                                                                                                                                                     |
558 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
559 |                     | The “PushJobFlag” must be set to “True”.                                                                                                                                                                                                                                                         | The “EnvParameters” and/or “FileParameters” field values should be provided and contain all configurable parameters for the VNF.                                                                                                                        |
560 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
561 |                     | The “Node” JSON dictionary must have the run list populated with necessary sequence of roles, cookbooks, recipes. This action is not expected to return an output.                                                                                                                               | NodeList must list FQDNs of an example VNF on which to execute playbook.                                                                                                                                                                                |
562 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
563 |                     | “GetOutputFlag” must be set to “False”.                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                         |
564 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
565 |                     | NodeList must list sample FQDNs that are required to conduct a chef-client run for this VNF Action.                                                                                                                                                                                              |                                                                                                                                                                                                                                                         |
566 +---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
567 | Health              | The ONAP health check interface is defined over REST and requires the target VNF to expose a standardized HTTP(S) interface for that purpose. See Section 8.c VNF REST APIs.                                                                                                                     | The ONAP health check interface is defined over REST and requires the target VNF to expose a standardized HTTP(S) interface for that purpose. See Section 8.c VNF REST APIs.                                                                            |
568 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
569 | Check               |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
570 +---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
571 | StartApplication,   | VNF Vendor must provide roles, cookbooks, recipes to start an application on the VNF when triggered by a chef-client run. If application does not start, the run must fail or raise an exception. If application is already started, or starts successfully, the run must finish successfully.   | VNF Vendor must provide an Ansible playbook to start the application on the VNF. If application does not start, the playbook must indicate failure. If application is already started, or starts successfully, the playbook must finish successfully.   |
572 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
573 | StopApplication     | For StopApplication, the application must be stopped gracefully (no loss of traffic).                                                                                                                                                                                                            | For StopApplication, the application must be stopped gracefully (no loss of traffic).                                                                                                                                                                   |
574 +---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
575 | SoftwareUpload,     | VNF Vendor must provide any necessary roles, cookbooks, recipes to apply a software upgrade to the VNF when triggered by a chef-client run.                                                                                                                                                      | VNF Vendor must provide an Ansible playbook that can apply a software upgrade to the VNF when triggered by the Ansible server                                                                                                                           |
576 |                     |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
577 | LiveUpgrade         |                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                         |
578 +---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
579
580 For information purposes, the following ONAP controller functions are
581 planned in the future:
582
583 Table 10. Planned ONAP Controller Functions
584
585 +------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
586 | ConfigSave,      | ConfigSave stores the VNF running configuration to a url or file using a specified name. ConfigRestore replaces the VNF running configuration with the configuration previously stored with a url or file with the specified name.                                                                               |
587 |                  |                                                                                                                                                                                                                                                                                                                  |
588 | ConfigRestore    |                                                                                                                                                                                                                                                                                                                  |
589 +==================+==================================================================================================================================================================================================================================================================================================================+
590 | Reconfigure      | If the audit fails, Reconfigure may be used to be replace the VNF running configuration using a previously uploaded configuration in the ONAP controller.                                                                                                                                                        |
591 +------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
592 | ConfigStartup    | ConfigStartup is used to store a running configuration to be used when a VNF is rebooted.                                                                                                                                                                                                                        |
593 +------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
594 | ConfigRecovery   | ConfigRecovery is used to replace the running configuration with a recovery configuration. This recovery configuration is stored in the ONAP Controller and is the configuration uploaded after instantiation. It will only be used if there is no other option to restore the VNF to a working configuration.   |
595 +------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
596 | StatusQuery      | Executes a VNF status query and returns the result. A status query is VNF-specific.                                                                                                                                                                                                                              |
597 +------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
598
599
600 d. Monitoring & Management
601 ===========================
602
603 This section addresses data collection and event processing
604 functionality that is directly dependent on the interfaces provided by
605 the VNFs’ APIs. These can be in the form of asynchronous interfaces for
606 event, fault notifications, and autonomous data streams. They can also
607 be synchronous interfaces for on-demand requests to retrieve various
608 performance, usage, and other event information.
609
610 The target direction for VNF interfaces is to employ APIs that are
611 implemented utilizing standardized messaging and modeling protocols over
612 standardized transports. Migrating to a virtualized environment presents
613 a tremendous opportunity to eliminate the need for proprietary
614 interfaces for vendor equipment while removing the traditional
615 boundaries between Network Management Systems and Element Management
616 Systems. Additionally, VNFs provide the ability to instrument the
617 networking applications by creating event records to test and monitor
618 end-to-end data flow through the network, similar to what physical or
619 virtual probes provide without the need to insert probes at various
620 points in the network. The VNF vendors must be able to provide the
621 aforementioned set of required data directly to the ONAP collection
622 layer using standardized interfaces.
623
624 Additional details can be found in the `Data Collection, Analytics, and Events (DCAE) <http://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/index.html>`_ project documentation.
625
626 Transports and Protocols Supporting Resource Interfaces
627 -------------------------------------------------------
628
629 Delivery of data from VNFs to ONAP must use the same common transport
630 mechanisms and protocols for all VNFs. Transport mechanisms and
631 protocols have been selected to enable both high volume and moderate
632 volume datasets, as well as asynchronous and synchronous communications
633 over secure connections. The specified encoding provides
634 self-documenting content, so data fields can be changed as needs evolve,
635 while minimizing changes to data delivery.
636
637 The term ‘Event Record’ is used throughout this document to represent
638 various forms instrumentation/telemetry made available by the VNF
639 including, faults, status events and various other types of VNF
640 measurements and logs. Headers received by themselves must be used as
641 heartbeat indicators. The common structure and delivery protocols for
642 other types of data will be given in future versions of this document as
643 we get more insight into data volumes and required processing.
644
645 In the following guidelines, we provide options for encoding,
646 serialization and data delivery. Agreements between Service Providers
647 and VNF vendors shall determine which encoding, serialization and
648 delivery method to use for particular data sets. The selected methods
649 must be agreed to prior to the on-boarding of the VNF into ONAP design
650 studio.
651
652 Monitoring & Management Requirements
653
654 **VNF telemetry via standardized interface**
655
656 * R-51910 The VNF **MUST** provide all telemetry (e.g., fault event records, syslog records, performance records etc.) to ONAP using the model, format and mechanisms described in this section.
657
658 **Encoding and Serialization**
659
660 * R-19624 The VNF **MUST** encode and serialize content delivered to ONAP using JSON (option 1). High-volume data is to be encoded and serialized using Avro, where Avro data format are described using JSON (option 2) [8]_.
661
662  -  JSON plain text format is preferred for moderate volume data sets (option 1), as JSON has the advantage of having well-understood simple processing and being human-readable without additional decoding. Examples of moderate volume data sets include the fault alarms and performance alerts, heartbeat messages, measurements used for VNF scaling and syslogs.
663  -  Binary format using Avro is preferred for high volume data sets (option 2) such as mobility flow measurements and other high-volume streaming events (such as mobility signaling events or SIP signaling) or bulk data, as this will significantly reduce the volume of data to be transmitted. As of the date of this document, all events are reported using plain text JSON and REST.
664  -  Avro content is self-documented, using a JSON schema. The JSON schema is delivered along with the data content (http://avro.apache.org/docs/current/ ). This means the presence and position of data fields can be recognized automatically, as well as the data format, definition and other attributes. Avro content can be serialized as JSON tagged text or as binary. In binary format, the JSON schema is included as a separate data block, so the content is not tagged, further compressing the volume. For streaming data, Avro will read the schema when the stream is established and apply the schema to the received content.
665  -  In the future, we may consider support for other types of encoding & serialization (e.g., gRPC) based on industry demand.
666
667 **Reporting Frequency**
668
669 * R-98191 The VNF **MUST** vary the frequency that asynchronous data is delivered based on the content and how data may be aggregated or grouped together. For example, alarms and alerts are expected to be delivered as soon as they appear. In contrast, other content, such as performance measurements, KPIs or reported network signaling may have various ways of packaging and delivering content. Some content should be streamed immediately; or content may be monitored over a time interval, then packaged as collection of records and delivered as block; or data may be collected until a package of a certain size has been collected; or content may be summarized statistically over a time interval, or computed as a KPI, with the summary or KPI being delivered. 
670  
671   -  We expect the reporting frequency to be configurable depending on the virtual network function’s needs for management. For example, Service Provider may choose to vary the frequency of collection between normal and trouble-shooting scenarios.
672   -  Decisions about the frequency of data reporting will affect the size of delivered data sets, recommended delivery method, and how the data will be interpreted by ONAP. However, this should not affect deserialization and decoding of the data, which will be guided by the accompanying JSON schema.
673
674 **Addressing and Delivery Protocol**
675
676 ONAP destinations can be addressed by URLs for RESTful data PUT. Future data sets may also be addressed by host name and port number for TCP streaming, or by host name and landing zone directory for SFTP transfer of bulk files.
677
678 * R-88482 The VNF **SHOULD** use REST using HTTPS delivery of plain text JSON for moderate sized asynchronous data sets, and for high volume data sets when feasible.
679 * R-84879 The VNF **MUST** have the capability of maintaining a primary and backup DNS name (URL) for connecting to ONAP collectors, with the ability to switch between addresses based on conditions defined by policy such as time-outs, and buffering to store messages until they can be delivered. At its discretion, the service provider may choose to populate only one collector address for a VNF. In this case, the network will promptly resolve connectivity problems caused by a collector or network failure transparently to the VNF.
680 * R-81777 The VNF **MUST** be configured with initial address(es) to use at deployment time. After that the address(es) may be changed through ONAP-defined policies delivered from ONAP to the VNF using PUTs to a RESTful API, in the same way that other controls over data reporting will be controlled by policy.
681 * R-08312 The VNF **MAY** use other options which are expected to include
682  
683  -  REST delivery of binary encoded data sets.
684  -  TCP for high volume streaming asynchronous data sets and for other high volume data sets. TCP delivery can be used for either JSON or binary encoded data sets.
685  -  SFTP for asynchronous bulk files, such as bulk files that contain large volumes of data collected over a long time interval or data collected across many VNFs. This is not preferred. Preferred is to reorganize the data into more frequent or more focused data sets, and deliver these by REST or TCP as appropriate.
686  -  REST for synchronous data, using RESTCONF (e.g., for VNF state polling).
687
688 * R-03070 The VNF **MUST**, by ONAP Policy, provide the ONAP addresses as data destinations for each VNF, and may be changed by Policy while the VNF is in operation. We expect the VNF to be capable of redirecting traffic to changed destinations with no loss of data, for example from one REST URL to another, or from one TCP host and port to another.
689
690 **Asynchronous and Synchronous Data Delivery**
691
692 * R-06924 The VNF **MUST** deliver asynchronous data as data becomes available, or according to the configured frequency.
693 * R-73285 The VNF **MUST** must encode the delivered data using JSON or Avro, addressed and delivered as described in the previous paragraphs.
694 * R-42140 The VNF **MUST** respond to data requests from ONAP as soon as those requests are received, as a synchronous response.
695 * R-34660 The VNF **MUST** use the RESTCONF/NETCONF framework used by the ONAP configuration subsystem for synchronous communication.
696 * R-86585 The VNF **MUST** use the YANG configuration models and RESTCONF (https://tools.ietf.org/html/draft-ietf-netconf-restconf-09#page-46).
697 * R-11240 The VNF **MUST** respond with content encoded in JSON, as described in the RESTCONF specification. This way the encoding of a synchronous communication will be consistent with Avro.
698 * R-70266 The VNF **MUST** respond to an ONAP request to deliver the current data for any of the record types defined in Section 8.d “Data Model for Event Records” by returning the requested record, populated with the current field values. (Currently the defined record types include the common header record, technology independent records such as Fault, Heartbeat, State Change, Syslog, and technology specific records such as Mobile Flow, Signaling and Voice Quality records.  Additional record types will be added in the future as they are standardized and become available.)
699 * R-46290 The VNF **MUST** respond to an ONAP request to deliver granular data on device or subsystem status or performance, referencing the YANG configuration model for the VNF by returning the requested data elements.
700 * R-43327 The VNF **SHOULD** use “Modeling JSON text with YANG”, https://trac.tools.ietf.org/id/draft-lhotka-netmod-yang-json-00.html, If YANG models need to be translated to and from JSON. YANG configuration and content can be represented via JSON, consistent with Avro, as described in “Encoding and Serialization” section.   
701
702 **Security**
703
704 * R-42366 The VNF **MUST** support secure connections and transports.
705 * R-44290 The VNF **MUST** control access to ONAP and to VNFs, and creation of connections, through secure credentials, log-on and exchange mechanisms.
706 * R-47597 The VNF **MUST** carry data in motion only over secure connections.
707 * R-68165 The VNF **MUST** encrypt any content containing Sensitive Personal Information (SPI) or certain proprietary data, in addition to applying the regular procedures for securing access and delivery.
708
709 Data Model for Event Records 
710 -----------------------------
711
712 This section describes the data model for the collection of telemetry
713 data from VNFs by Service Providers (SPs) to manage VNF health and
714 runtime lifecycle. This data model is referred to as the VNF Event
715 Streaming (VES) specifications. While this document is focused on
716 specifying some of the records from the ONAP perspective, there may be
717 other external bodies using the same framework to specify additional
718 records. For example, OPNFV has a VES project [9]_ that is looking to
719 specify records for OpenStack’s internal telemetry to manage Application
720 (VNFs), physical and virtual infrastructure (compute, storage, network
721 devices), and virtual infrastructure managers (cloud controllers, SDN
722 controllers). Note that any configurable parameters for these data
723 records (e.g., frequency, granularity, policy-based configuration) will
724 be managed using the “Configuration” framework described in the prior
725 sections of this document.
726
727 The Data Model consists of:
728
729 -  Common Header Record: This data structure precedes each of the
730    Technology Independent and Technology Specific records sections of
731    the data model.
732
733 -  Technology Independent Records: This version of the document
734    specifies the model for Fault, Heartbeat, State Change, Syslog,
735    Threshold Crossing Alerts, and VF Scaling\* (short for
736    measurementForVfScalingFields) records. In the future, these may be
737    extended to support other types of technology independent records.
738    Each of these records allows additional fields (name/ value pairs)
739    for extensibility. The vendors can use these vendor-specific
740    additional fields to provide additional information that may be
741    relevant to the managing systems.
742
743 -  Technology Specific Records: This version of the document specifies
744    the model for Mobile Flow records, Signaling and Voice Quality
745    records. In the future, these may be extended to support other types
746    of records (e.g., Network Fabric, Security records, etc.). Each of
747    these records allows additional fields (name/value pairs) for
748    extensibility. The VNF vendors can use these VNF-specific additional
749    fields to provide additional information that may be relevant to the
750    managing systems. A placeholder for additional technology specific
751    areas of interest to be defined in the future documents has been
752    depicted.
753
754 |image0|
755 Figure 1. Data Model for Event Records
756
757 Event Records - Data Structure Description
758 ------------------------------------------
759
760 The data structure for event records consists of:
761
762 -  a Common Event Header block;
763
764 -  zero or more technology independent domain blocks; and
765
766    -  e.g., Fault domain, State Change domain, Syslog domain, etc.
767
768 -  zero or more technology specific domain blocks.
769
770    -  e.g., Mobile Flow domain, Signaling domain, Voice Quality domain,
771       etc.
772
773 Note: Heartbeat records would only have the Common Event Header block.
774 An optional heartbeat domain is available if required by the heartbeat
775 implementation.
776
777 Common Event Header
778 ~~~~~~~~~~~~~~~~~~~~~
779
780 The common header that precedes any of the domain-specific records
781 contains information identifying the type of record to follow,
782 information about the sender and other identifying characteristics
783 related to timestamp, sequence number, etc.
784
785 Technology Independent Records – Fault Fields
786 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
787
788 The Fault Record, describing a condition in the Fault domain, contains
789 information about the fault such as the entity under fault, the
790 severity, resulting status, etc.
791
792 Technology Independent Records – Heartbeat Fields
793 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
794
795 The Heartbeat Record provides an optional structure for communicating
796 information about heartbeat or watchdog signaling events. It can contain
797 information about service intervals, status information etc. as required
798 by the heartbeat implementation.
799
800 Technology Independent Records – State Change Fields
801 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
802
803 The State Change Record provides a structure for communicating
804 information about data flow through the VNF. It can contain information
805 about state change related to physical device that is reported by VNF.
806 As an example, when cards or port name of the entity that has changed
807 state.
808
809 Technology Independent Records – Syslog Fields
810 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
811
812 The Syslog Record provides a structure for communicating any type of
813 information that may be logged by the VNF. It can contain information
814 about system internal events, status, errors, etc.
815
816 Technology Independent Records – Threshold Crossing Alert Fields
817 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
818
819 The Threshold Crossing Alert (TCA) Record provides a structure for
820 communicating information about threshold crossing alerts. It can
821 contain alert definitions and types, actions, events, timestamps and
822 physical or logical details.
823
824 Technology Independent Records - VF Scaling Fields
825 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
826
827 The VF Scaling\* (short for measurementForVfScalingFields) Record
828 contains information about VF and VNF resource structure and its
829 condition to help in the management of the resources for purposes of
830 elastic scaling.
831
832 Technology Independent Records – otherFields
833 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
834
835 The otherFields Record defines fields for events belonging to the
836 otherFields domain of the Technology Independent domain enumeration.
837 This record provides a mechanism to convey a complex set of fields
838 (possibly nested or opaque) and is purely intended to address
839 miscellaneous needs such as addressing time-to-market considerations or
840 other proof-of-concept evaluations.  Hence, use of this record type is
841 discouraged and should be minimized.
842
843 Technology Specific Records – Mobile Flow Fields
844 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
845
846 The Mobile Flow Record provides a structure for communicating
847 information about data flow through the VNF. It can contain information
848 about connectivity and data flows between serving elements for mobile
849 service, such as between LTE reference points, etc.
850
851 Technology Specific Records – Signaling Fields
852 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
853
854 The Signaling Record provides a structure for communicating information
855 about signaling messages, parameters and signaling state. It can contain
856 information about data flows for
857 `signaling <https://en.wikipedia.org/wiki/Signaling_%28telecommunications%29>`__
858 and controlling
859 `multimedia <https://en.wikipedia.org/wiki/Multimedia>`__ communication
860 `session <https://en.wikipedia.org/wiki/Session_%28computer_science%29>`__\ s
861 such as `voice <https://en.wikipedia.org/wiki/Telephone_call>`__ and
862 `video calls <https://en.wikipedia.org/wiki/Video_call>`__.
863
864 Technology Specific Records – Voice Quality Fields
865 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
866
867 The Voice Quality Record provides a structure for communicating
868 information about voice quality statistics including media connection
869 information, such as transmitted octet and packet counts, packet loss,
870 packet delay variation, round-trip delay, QoS parameters and codec
871 selection.
872
873 Technology Specific Records – Future Domains
874 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
875
876 The futureDomains Record is a placeholder for additional technology
877 specific areas of interest that will be defined and described in the
878 future documents.
879
880 Data Structure Specification of the Event Record
881 ------------------------------------------------
882
883 For additional information on the event record formats of the data
884 structures mentioned above, please refer to `VES Event
885 Listener <https://github.com/att/evel-test-collector/tree/master/docs/att_interface_definition>`__.
886
887 .. [2]
888    https://github.com/mbj4668/pyang
889
890 .. [3]
891    Decision on which Chef Server instance associates with a VNF will be
892    made on a case-by-case basis depending on VNF, access requirements,
893    etc. and are outside the scope of this document. The specific
894    criteria for this would involve considerations like connectivity and
895    access required by the VNF, security, VNF topology and proprietary
896    cookbooks.
897
898 .. [4]
899    Recall that the Node Object **is required** to be identical across
900    all VMs of a VNF invoked as part of the action except for the “name”.
901
902 .. [5]
903    Decision on which Ansible Server to use may happen on a case-by-case
904    basis depending on VNF, access requirements etc. and are outside the
905    scope of this document. The specific criteria for this could involve
906    considerations like connectivity and access required by the VNF,
907    security, VNF topology and proprietary playbooks.
908
909 .. [6]
910    Upstream elements must provide the appropriate FQDN in the request to
911    ONAP for the desired action.
912
913 .. [7]
914    Multiple ONAP actions may map to one playbook.
915
916 .. [8]
917    This option is not currently supported in ONAP and it is currently
918    under consideration.
919
920 .. [9]
921    https://wiki.opnfv.org/display/PROJ/VNF+Event+Stream
922
923 .. [10]
924    The “name” field is a mandatory field in a valid Chef Node Object
925    JSON dictionary.
926
927 .. |image0| image:: Data_Model_For_Event_Records.png
928       :width: 7in
929       :height: 8in