Merge "[VNFRQTS] update appendix d for beijing"
[vnfrqts/requirements.git] / docs / Chapter7.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2017 AT&T Intellectual Property.  All rights reserved.
4
5
6 ONAP Management Requirements
7 ============================
8
9 The ONAP platform is the part of the larger Network Function
10 Virtualization/Software Defined Network (NFV/SDN) ecosystem that
11 is responsible for the efficient control, operation and management
12 of Virtual Network Function (VNF) capabilities and functions. It
13 specifies standardized abstractions and interfaces that enable
14 efficient interoperation of the NVF/SDN ecosystem components. It
15 enables product/service independent capabilities for design, creation
16 and runtime lifecycle management (includes all aspects of installation,
17 change management, assurance, and retirement) of resources in NFV/SDN
18 environment (see ECOMP white paper ). These capabilities are provided
19 using two major architectural frameworks: (1) a Design Time Framework
20 to design, define and program the platform (uniform onboarding), and
21 (2) a Runtime Execution Framework to execute the logic programmed in
22 the design environment (uniform delivery and runtime lifecycle
23 management). The platform delivers an integrated information model
24 based on the VNF package to express the characteristics and behavior
25 of these resources in the Design Time Framework. The information model
26 is utilized by Runtime Execution Framework to manage the runtime
27 lifecycle of the VNFs. The management processes are orchestrated
28 across various modules of ONAP to instantiate, configure, scale,
29 monitor, and reconfigure the VNFs using a set of standard APIs
30 provided by the VNF developers.
31
32 Although the guidelines and requirements specified in this document
33 were originally driven by the need to standardize and automate the
34 management of the virtualized environments (with VNFs) operated by
35 Service Providers, we believe that most of the requirements are equally
36 applicable to the operation of the physical network functions (PNFs),
37 those network functions provided by traditional physical network
38 elements (e.g. whitebox switches) or customized peripherals (e.g. a
39 video rendering engine for augmented reality). The primary area of
40 difference will be in how the network function is orchestrated into
41 place – VNFs can be much more dynamically created & placed by ONAP
42 to support varying geographic, availability and scalability needs,
43 whereas the PNFs have to be deployed a priori in specific locations
44 based on planning and engineering – their availability and scalability
45 will be determined by the capabilities offered by the PNFs.
46
47 **PNF** is a vendor-provided Network Function(s) implemented using a
48 bundled set of hardware and software while VNFs utilize cloud resources
49 to provide Network Functions through virtualized software modules.  PNF
50 can be supplied by a vendor as a Black BOX (provides no knowledge of its
51 internal characteristics, logic, and software design/architecture) or as
52 a White Box (provides detailed knowledge and access of its internal
53 components and logic) or as a Grey Box (provides limited knowledge and
54 access to its internal components).
55
56 * Requirements that equally apply to both VNFs and PNFs are defined as
57   "The xNF MUST/SHOULD/..."
58 * Requirements that only apply to VNFs are defined as "The VNF MUST/SHOULD/..."
59 * Requirements that only apply to PNFs are defined as "The PNF MUST/SHOULD/..."
60
61
62 Service Design
63 ------------------------------------
64
65 This section, Service Design, has been left intentionally blank. It
66 is out-of-scope for the VNF Requirements project for the Amsterdam
67 release and no numbered requirements are expected. Content may be
68 added in future updates of this document.
69
70 VNF On-boarding and package management
71 -----------------------------------------------------------------------------
72
73 Design Definition
74 ^^^^^^^^^^^^^^^^^^
75
76 The ONAP Design Time Framework provides the ability to design NFV
77 resources including VNFs, Services, and products. The VNF provider must
78 provide VNF packages that include a rich set of recipes, management and
79 functional interfaces, policies, configuration parameters, and
80 infrastructure requirements that can be utilized by the ONAP Design
81 module to onboard and catalog these resources. Initially this
82 information may be provided in documents, but in the near future a
83 method will be developed to automate as much of the transfer of data as
84 possible to satisfy its long term requirements.
85
86 The current VNF Package Requirement is based on a subset of the
87 Requirements contained in the ETSI Document: ETSI GS NFV-MAN 001 v1.1.1
88 and GS NFV IFA011 V0.3.0 (2015-10) - Network Functions Virtualization
89 (NFV), Management and Orchestration, VNF Packaging Specification.
90
91 Resource Description
92 ^^^^^^^^^^^^^^^^^^^^^^
93
94 * R-77707 The xNF provider **MUST** include a Manifest File that
95   contains a list of all the components in the xNF package.
96 * R-66070 The xNF Package **MUST** include xNF Identification Data to
97   uniquely identify the resource for a given xNF provider. The identification
98   data must include: an identifier for the xNF, the name of the xNF as was
99   given by the xNF provider, xNF description, xNF provider, and version.
100 * R-69565 The xNF Package **MUST** include documentation describing xNF
101   Management APIs, which must include information and tools for ONAP to
102   deploy and configure (initially and ongoing) the xNF application(s)
103   (e.g., NETCONF APIs) which includes a description of configurable
104   parameters for the xNF and whether the parameters can be configured
105   after xNF instantiation.
106 * R-00156 The xNF Package **MUST** include documentation describing xNF
107   Management APIs, which must include information and tools for ONAP
108   to monitor the health of the xNF (conditions that require healing
109   and/or scaling responses).
110 * R-00068 The xNF Package **MUST** include documentation which includes
111   a description of parameters that can be monitored for the xNF and
112   event records (status, fault, flow, session, call, control plane,
113   etc.) generated by the xNF after instantiation.
114 * R-12678 The xNF Package **MUST** include documentation which includes a
115   description of runtime lifecycle events and related actions (e.g.,
116   control responses, tests) which can be performed for the xNF.
117 * R-84366 The xNF Package **MUST** include documentation describing
118   xNF Functional APIs that are utilized to build network and
119   application services. This document describes the externally exposed
120   functional inputs and outputs for the xNF, including interface
121   format and protocols supported.
122 * R-36280 The xNF provider **MUST** provide documentation describing
123   xNF Functional Capabilities that are utilized to operationalize the
124   xNF and compose complex services.
125 * R-98617 The xNF provider **MUST** provide information regarding any
126   dependency (e.g., affinity, anti-affinity) with other xNFs and resources.
127
128 Resource Configuration
129 ^^^^^^^^^^^^^^^^^^^^^^^
130
131 * R-89571 The xNF **MUST** support and provide artifacts for configuration
132   management using at least one of the following technologies;
133   a) Netconf/YANG, b) Chef, or c) Ansible.
134
135   Note: The requirements for Netconf/YANG, Chef, and Ansible protocols
136   are provided separately and must be supported only if the corresponding
137   protocol option is provided by the xNF providor.
138
139 Configuration Management via NETCONF/YANG
140 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
141
142 * R-30278 The xNF provider **MUST** provide a Resource/Device YANG model
143   as a foundation for creating the YANG model for configuration. This will
144   include xNF attributes/parameters and valid values/attributes configurable
145   by policy.
146
147 Configuration Management via Chef
148 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149
150 * R-13390 The xNF provider **MUST** provide cookbooks to be loaded
151   on the appropriate Chef Server.
152 * R-18525 The xNF provider **MUST** provide a JSON file for each
153   supported action for the xNF.  The JSON file must contain key value
154   pairs with all relevant values populated with sample data that illustrates
155   its usage. The fields and their description are defined in Tables A1 and A2 in the Appendix.
156
157  Note: Chef support in ONAP is not currently available and planned for 4Q 2017.
158
159 Configuration Management via Ansible
160 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161
162 * R-75608 The xNF provider **MUST** provide playbooks to be loaded
163   on the appropriate Ansible Server.
164 * R-16777 The xNF provider **MUST** provide a JSON file for each
165   supported action for the xNF.  The JSON file must contain key value
166   pairs with all relevant values populated with sample data that illustrates
167   its usage. The fields and their description are defined in Table B1 in the Appendix.
168
169 * R-46567 The xNF Package **MUST** include configuration scripts
170   for boot sequence and configuration.
171 * R-16065 The xNF provider **MUST** provide configurable parameters
172   (if unable to conform to YANG model) including xNF attributes/parameters
173   and valid values, dynamic attributes and cross parameter dependencies
174   (e.g., customer provisioning data).
175
176 Resource Control Loop
177 ^^^^^^^^^^^^^^^^^^^^^^^
178
179 * R-22888 The xNF provider **MUST** provide documentation for the xNF
180   Policy Description to manage the xNF runtime lifecycle. The document
181   must include a description of how the policies (conditions and actions)
182   are implemented in the xNF.
183 * R-01556 The xNF Package **MUST** include documentation describing the
184   fault, performance, capacity events/alarms and other event records
185   that are made available by the xNF.
186 * R-16875 The xNF Package **MUST** include documentation which must include
187   a unique identification string for the specific xNF, a description of
188   the problem that caused the error, and steps or procedures to perform
189   Root Cause Analysis and resolve the issue.
190 * R-35960 The xNF Package **MUST** include documentation which must include
191   all events, severity level (e.g., informational, warning, error) and
192   descriptions including causes/fixes if applicable for the event.
193 * R-42018 The xNF Package **MUST** include documentation which must include
194   all events (fault, measurement for xNF Scaling, Syslogs, State Change
195   and Mobile Flow), that need to be collected at each VM, VNFC (defined in `VNF Guidelines <http://onap.readthedocs.io/en/latest/submodules/vnfrqts/guidelines.git/docs/vnf_guidelines/vnf_guidelines.html#a-glossary>`__ ) and for the overall xNF.
196 * R-27711 The xNF provider **MUST** provide an XML file that contains a
197   list of xNF error codes, descriptions of the error, and possible
198   causes/corrective action.
199 * R-01478 The xNF Package **MUST** include documentation describing all
200   parameters that are available to monitor the xNF after instantiation
201   (includes all counters, OIDs, PM data, KPIs, etc.) that must be
202   collected for reporting purposes.
203 * R-73560 The xNF Package **MUST** include documentation about monitoring
204   parameters/counters exposed for virtual resource management and xNF
205   application management.
206 * R-90632 The xNF Package **MUST** include documentation about KPIs and
207   metrics that need to be collected at each VM for capacity planning
208   and performance management purposes.
209 * R-86235 The xNF Package **MUST** include documentation about the monitoring
210   parameters that must include latencies, success rates, retry rates, load
211   and quality (e.g., DPM) for the key transactions/functions supported by
212   the xNF and those that must be exercised by the xNF in order to perform
213   its function.
214 * R-33904 The xNF Package **MUST** include documentation for each KPI, provide
215   lower and upper limits.
216 * R-53598 The xNF Package **MUST** include documentation to, when relevant,
217   provide a threshold crossing alert point for each KPI and describe the
218   significance of the threshold crossing.
219 * R-69877 The xNF Package **MUST** include documentation for each KPI,
220   identify the suggested actions that need to be performed when a
221   threshold crossing alert event is recorded.
222 * R-22680 The xNF Package **MUST** include documentation that describes
223   any requirements for the monitoring component of tools for Network
224   Cloud automation and management to provide these records to components
225   of the xNF.
226 * R-33694 The xNF Package **MUST** include documentation to when applicable,
227   provide calculators needed to convert raw data into appropriate reporting
228   artifacts.
229 * R-56815 The xNF Package **MUST** include documentation describing
230   supported xNF scaling capabilities and capacity limits (e.g., number
231   of users, bandwidth, throughput, concurrent calls).
232 * R-48596 The xNF Package **MUST** include documentation describing
233   the characteristics for the xNF reliability and high availability.
234 * R-74763 The xNF provider **MUST** provide an artifact per xNF that contains
235   all of the xNF Event Records supported. The artifact should include
236   reference to the specific release of the xNF Event Stream Common Event
237   Data Model document it is based on. (e.g.,
238   `VES Event Listener <https://github.com/att/evel-test-collector/tree/master/docs/att_interface_definition>`__)
239
240 Compute, Network, and Storage Requirements
241 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
242
243 * R-35851 The xNF Package **MUST** include xNF topology that describes
244   basic network and application connectivity internal and external to the
245   xNF including Link type, KPIs, Bandwidth, latency, jitter, QoS (if
246   applicable) for each interface.
247 * R-97102 The VNF Package **MUST** include VM requirements via a Heat
248   template that provides the necessary data for VM specifications
249   for all VNF components - for hypervisor, CPU, memory, storage.
250 * R-20204 The VNF Package **MUST** include VM requirements via a Heat
251   template that provides the necessary data for network connections,
252   interface connections, internal and external to VNF.
253 * R-44896 The VNF Package **MUST** include VM requirements via a Heat
254   template that provides the necessary data for high availability
255   redundancy model.
256 * R-55802 The VNF Package **MUST** include VM requirements via a Heat
257   template that provides the necessary data for scaling/growth VM
258   specifications.
259
260   Note: Must comply with the *Heat requirements in 5.b*.
261
262 * R-26881 The xNF provider **MUST** provide the binaries and images
263   needed to instantiate the xNF (xNF and VNFC images).
264 * R-96634 The xNF provider **MUST** describe scaling capabilities
265   to manage scaling characteristics of the xNF.
266
267
268 Testing
269 ^^^^^^^^^^
270
271 * R-43958 The xNF Package **MUST** include documentation describing
272   the tests that were conducted by the xNF providor and the test results.
273 * R-04298 The xNF provider **MUST** provide their testing scripts to
274   support testing.
275 * R-58775 The xNF provider **MUST** provide software components that
276   can be packaged with/near the xNF, if needed, to simulate any functions
277   or systems that connect to the xNF system under test. This component is
278   necessary only if the existing testing environment does not have the
279   necessary simulators.
280
281 Licensing Requirements
282 ^^^^^^^^^^^^^^^^^^^^^^^
283
284 * R-85653 The xNF **MUST** provide metrics (e.g., number of sessions,
285   number of subscribers, number of seats, etc.) to ONAP for tracking
286   every license.
287 * R-44125 The xNF provider **MUST** agree to the process that can
288   be met by Service Provider reporting infrastructure. The Contract
289   shall define the reporting process and the available reporting tools.
290 * R-40827 The xNF provider **MUST** enumerate all of the open
291   source licenses their xNF(s) incorporate.
292 * R-97293 The xNF provider **MUST NOT** require audits of
293   Service Provider’s business.
294 * R-44569 The xNF provider **MUST NOT** require additional
295   infrastructure such as a xNF provider license server for xNF provider
296   functions and metrics.
297 * R-13613 The VNF **MUST** provide clear measurements for licensing
298   purposes to allow automated scale up/down by the management system.
299 * R-27511 The VNF provider **MUST** provide the ability to scale
300   up a VNF provider supplied product during growth and scale down a
301   VNF provider supplied product during decline without “real-time”
302   restrictions based upon VNF provider permissions.
303 * R-85991 The xNF provider **MUST** provide a universal license key
304   per xNF to be used as needed by services (i.e., not tied to a VM
305   instance) as the recommended solution. The xNF provider may provide
306   pools of Unique xNF License Keys, where there is a unique key for
307   each xNF instance as an alternate solution. Licensing issues should
308   be resolved without interrupting in-service xNFs.
309 * R-47849 The xNF provider **MUST** support the metadata about
310   licenses (and their applicable entitlements) as defined in this
311   document for xNF software, and any license keys required to authorize
312   use of the xNF software.  This metadata will be used to facilitate
313   onboarding the xNF into the ONAP environment and automating processes
314   for putting the licenses into use and managing the full lifecycle of
315   the licenses. The details of this license model are described in
316   Tables C1 to C8 in the Appendix. Note: License metadata support in 
317   ONAP is not currently available and planned for 1Q 2018.
318
319 Configuration Management
320 ---------------------------------------------------
321
322 Controller Interactions With VNF
323 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
324
325 ONAP Controllers (such as APPC) expose a northbound API to clients
326 (such as SO) in order for the clients to initiate an activity
327 (aka command) on a VNF.   ONAP controllers interact with VNFs through
328 Network and Application Adapters to perform configuration and other
329 lifecycle management activities within NFV environment.
330 The standardized models, protocols and mechanisms by which network
331 functions are configured are equally applicable to VNFs and PNFs.
332
333 This section describes the list of commands that should be supported
334 by the VNF.   The following sections describe the standard protocols
335 that are supported (NETCONF, Chef, Ansible, and REST).
336
337 The commands below are expected to be supported on all VNF’s, unless
338 noted otherwise, either directly (via the NETCONF or REST interface)
339 or indirectly (via a Chef Cookbook or Ansible server).  Note that there
340 are additional commands offered to northbound clients that are not shown
341 below, as these commands either act internally on the Controller itself
342 or depend upon network cloud components for implementation (thus, these
343 actions do not put any special requirement on the VNF provider).
344
345 The commands allow for parametric data to be passed from the controller
346 to the VNF or Ansible/Chef server in the request.  The format of the
347 parameter data can be either xml (for NETCONF) or JSON (for Ansible,
348 Chef, or REST).
349
350 Configuration Commands
351 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
352
353 **Configure**: The Controller client is requesting that a post-instantiation
354 configuration be applied to the target VNF instance. After the Configure
355 action is completed, the VNF instance should be ready for service.
356 Note that customer specific configurations may need to be applied using
357 the ConfigModify action.
358
359 **ConfigModify**: The Controller client is requesting a configuration
360 update to a subset of the total configuration parameters of a VNF or to
361 apply customer specific configurations. The configuration update is
362 typically done while the VNF is in service and should not disrupt traffic.
363
364 **ConfigBackup**: The Controller client is requesting a backup of the
365 configuration parameters where the parameters are stored on the VNF.
366 This command is typically requested as part of an orchestration flow
367 for scenarios such as a software upgrade. The ConfigBackup is typically
368 done while the VNF is not in service (i.e., in a maintenance state).
369 When the ConfigBackup command is executed, the current VNF configuration
370 parameters are saved in storage that is preserved (if there is an existing
371 set of backed up parameters, they are overwritten).
372
373 **ConfigRestore**: The Controller client is requesting a restore action of
374 the configuration parameters to the VNF that were saved by ConfigBackup
375 command. This command is typically requested as part of an orchestration
376 flow for scenarios such as a software upgrade where the software upgrade
377 may have failed and the VNF needs to be rolled back to the prior configuration.
378 When the ConfigRestore command is executed, the VNF configuration parameters
379 which were backed to persistent preserved storage are applied to the VNF
380 (replacing existing parameters). The ConfigRestore is typically done while
381 the VNF is not in service (i.e., in a maintenance state).
382
383 **ConfigScaleOut**: The Controller client is requesting that a configuration
384 be applied after the VNF instance has been scaled out (i.e., one or more
385 additional VM’s instantiated to increase capacity). For some VNF’s,
386 ConfigScaleOut is not needed because the VNF is auto-configured after
387 scale-out. This command is being introduced in the Beijing release.
388
389 **Audit**: The Controller client is requesting that the current (last known
390 configuration update) is audited against the running configuration on the VNF.
391
392 * R-20741 The xNF **MUST** support ONAP Controller’s **Configure** command.
393 * R-19366 The xNF **MUST** support ONAP Controller’s **ConfigModify** command.
394 * R-32981 The xNF **MUST** support ONAP Controller’s **ConfigBackup** command.
395 * R-48247 The xNF **MUST** support ONAP Controller’s **ConfigRestore** command.
396 * R-94084 The xNF **MUST** support ONAP Controller’s **ConfigScaleOut**
397   command.
398 * R-56385 The xNF **MUST** support ONAP Controller’s **Audit** command.
399
400 LifeCycle Management Related Commands
401 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
402
403 **The following commands are needed to support various lifecycle management
404 flows where the VNF may need to be removed for service.**
405
406 **QuiesceTraffic**: The Controller client is requesting the VNF gracefully
407 stop traffic (aka block and drain traffic). The method for quiescing traffic
408 is specific to the VNF architecture. The action is completed when all
409 (in-flight transactions) traffic has stopped.   The VNF remains in an active
410 state where the VNF is able to process traffic (initiated using the
411 StartTraffic action).
412
413 **ResumeTraffic**: The Controller client is requesting the VNF resume
414 processing traffic. The method to resume traffic is specific to the VNF
415 architecture.
416
417 **StopApplication**: The Controller client is requesting that the application
418 running on the VNF is stopped gracefully (i.e., without traffic loss).
419 This is equivalent to quiescing the traffic and then stopping the application
420 processes. The processes can be restarted using the StartApplication command.
421
422 **StartApplication**: The Controller client is requesting that the application
423 running on the VNF is started. Get ready to process traffic.
424
425 **The following commands are needed to support software upgrades, in-place or
426 other type of software upgrade. The VNF instance may be removed from service
427 for the upgrade.**
428
429 **UpgradePrecheck**: The Controller client is requesting a confirmation that
430 the VNF can (and needs to) be upgraded to a specific software version
431 (specified in the request).
432
433 **UpgradeSoftware**: The Controller client is requesting that a (in-place)
434 software upgrade be performed on the VNF.  The software to be applied is
435 pre-loaded to a specified location.
436
437 **UpgradePostCheck**: The Controller client is requesting a confirmation that
438 the VNF software upgrade has been completed successfully (VNF upgraded to
439 the new software version).
440
441 **UpgradeBackup**: The Controller client is requesting that the VNF is backed
442 up prior to the UpgradeSoftware.
443
444 **UpgradeBackOut**: The Controller client is requesting that the VNF upgrade
445 is backed out (in the event that the SoftwareUpgrade or UpgradePostCheck
446 failed).
447
448 * R-12706 The xNF **MUST** support ONAP Controller’s **QuiesceTraffic**
449   command.
450 * R-07251 The xNF **MUST** support ONAP Controller’s **ResumeTraffic**
451   command.
452 * R-83146 The xNF **MUST** support ONAP Controller’s **StopApplication**
453   command.
454 * R-82811 The xNF **MUST** support ONAP Controller’s **StartApplication**
455   command.
456 * R-19922 The xNF **MUST** support ONAP Controller’s **UpgradePrecheck**
457   command.
458 * R-49466 The xNF **MUST** support ONAP Controller’s **UpgradeSoftware**
459   command.
460 * R-45856 The xNF **MUST** support ONAP Controller’s **UpgradePostCheck**
461   command.
462 * R-97343 The xNF **MUST** support ONAP Controller’s **UpgradeBackup**
463   command.
464 * R-65641 The xNF **MUST** support ONAP Controller’s **UpgradeBackOut**
465   command.
466
467 Virtual Function - Container Recovery Requirements
468 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
469
470 As part of life cycle management, for Cloud environment, VNFs need to
471 support a set of basic recovery capabilities to maintain the health
472 and extend the life of the VNF, eliminating and reducing the frequency
473 that an entire VNF needs to be rebuilt or re-instantiated to recover one
474 or more of its containers. For instance, a VNF in an Openstack environment
475 is composed of one or more containers called VMs (Virtual Machines). During
476 the life of a VNF it is expected that Cloud infrastructure hardware will
477 fail or they would need to be taken down for maintenance or hardware and
478 software upgrades (e.g. firmware upgrades, HostOS (Hypervisor), power
479 maintenance, power outages, etc.) To deal with such life cycle events
480 without having to rebuild entire VNFs or even entire sites these basic
481 recovery capabilities of individual containers, Virtual Machines or other,
482 must be supported.
483
484 * R-11790 The VNF **MUST** support ONAP Controller’s
485   **Restart (stop/start or reboot)** command.
486 * R-56218 The VNF **MUST** support ONAP Controller’s Migrate command that
487   moves container (VM) from a live Physical Server / Compute Node to
488   another live Physical Server / Compute Node.
489   
490 NOTE: Container migrations MUST be transparent to the VNF and no more
491 intrusive than a stop, followed by some down time for the migration to
492 be performed from one Compute Node / Physical Server to another, followed
493 by a start of the same VM with same configuration on the new Compute 
494 Node / Physical Server.
495   
496 * R-38001 The VNF MUST support ONAP Controller’s **Rebuild** command.
497 * R-76901 VNF MUST support a container rebuild mechanism based on existing
498   image (e.g. Glance image in Openstack environment) or a snapshot.
499   
500 HealthCheck and Failure Related Commands
501 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
502
503 **HealthCheck**: The Controller client is requesting a health check over the
504 entire scope of the VNF.  The VNF must be 100% healthy, ready to take requests
505 and provide services, with all VNF required capabilities ready to provide
506 services and with all active and standby resources fully ready with no open
507 MINOR, MAJOR or CRITICAL alarms.
508
509 Note: In addition to the commands above, the Controller supports a set of
510 Openstack failure recovery related commands that are executed on-demand or via
511 Control Loop at the VM level.  The VNF must support these commands in a fully
512 automated fashion.
513
514 * R-41430 The xNF **MUST** support ONAP Controller’s **HealthCheck**
515   command.
516
517 Notes On Command Support Using Controller Southbound Protocols
518 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
519
520 The ONAP Controllers are designed to support a standard set of protocols in
521 order to communicate with the VNF instance.  The supported protocols are
522 NETCONF, Ansible, Chef, and REST.
523
524 NETCONF and REST require the VNF to implement a server which supports the RPC
525 or REST calls.
526
527 Ansible and Chef require the use of a Ansible or Chef server which communicates
528 with the Controller (northbound) and the VNF VM’s (southbound).
529
530 The vendor must select which protocol to support for the commands listed above.
531 Notes:
532
533 * NETCONF is most suitable for configuration related commands
534
535 * Ansible and Chef are suitable for any command.
536   Ansible has the advantage that it is agentless.
537
538 * REST is specified as an option only for the HealthCheck.
539
540
541 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>`_.
542
543 NETCONF Standards and Capabilities
544 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
545
546 ONAP Controllers and their Adapters utilize device YANG model and
547 NETCONF APIs to make the required changes in the VNF state and
548 configuration. The VNF providers must provide the Device YANG model and
549 NETCONF server supporting NETCONF APIs to comply with target ONAP and
550 industry standards.
551
552 VNF Configuration via NETCONF Requirements
553 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
554
555 Configuration Management
556 +++++++++++++++++++++++++++
557
558 * R-88026 The xNF **MUST** include a NETCONF server enabling
559   runtime configuration and lifecycle management capabilities.
560 * R-95950 The xNF **MUST** provide a NETCONF interface fully defined
561   by supplied YANG models for the embedded NETCONF server.
562
563 NETCONF Server Requirements
564 ++++++++++++++++++++++++++++++
565
566 * R-73468 The xNF **MUST** allow the NETCONF server connection
567   parameters to be configurable during virtual machine instantiation
568   through Heat templates where SSH keys, usernames, passwords, SSH
569   service and SSH port numbers are Heat template parameters.
570 * R-90007 The xNF **MUST** implement the protocol operation:
571   **close-session()**- Gracefully close the current session.
572 * R-70496 The xNF **MUST** implement the protocol operation:
573   **commit(confirmed, confirm-timeout)** - Commit candidate
574   configuration datastore to the running configuration.
575 * R-18733 The xNF **MUST** implement the protocol operation:
576   **discard-changes()** - Revert the candidate configuration
577   datastore to the running configuration.
578 * R-44281 The xNF **MUST** implement the protocol operation:
579   **edit-config(target, default-operation, test-option, error-option,
580   config)** - Edit the target configuration datastore by merging,
581   replacing, creating, or deleting new config elements.
582 * R-60106 The xNF **MUST** implement the protocol operation:
583   **get(filter)** - Retrieve (a filtered subset of) the running
584   configuration and device state information. This should include
585   the list of xNF supported schemas.
586 * R-29488 The xNF **MUST** implement the protocol operation:
587   **get-config(source, filter)** - Retrieve a (filtered subset of
588   a) configuration from the configuration datastore source.
589 * R-11235 The xNF **MUST** implement the protocol operation:
590   **kill-session(session)** - Force the termination of **session**.
591 * R-02597 The xNF **MUST** implement the protocol operation:
592   **lock(target)** - Lock the configuration datastore target.
593 * R-96554 The xNF **MUST** implement the protocol operation:
594   **unlock(target)** - Unlock the configuration datastore target.
595 * R-29324 The xNF **SHOULD** implement the protocol operation:
596   **copy-config(target, source) -** Copy the content of the
597   configuration datastore source to the configuration datastore target.
598 * R-88031 The xNF **SHOULD** implement the protocol operation:
599   **delete-config(target) -** Delete the named configuration
600   datastore target.
601 * R-97529 The xNF **SHOULD** implement the protocol operation:
602   **get-schema(identifier, version, format) -** Retrieve the YANG schema.
603 * R-62468 The xNF **MUST** allow all configuration data to be
604   edited through a NETCONF <edit-config> operation. Proprietary
605   NETCONF RPCs that make configuration changes are not sufficient.
606 * R-01382 The xNF **MUST** allow the entire configuration of the
607   xNF to be retrieved via NETCONF's <get-config> and <edit-config>,
608   independently of whether it was configured via NETCONF or other
609   mechanisms.
610 * R-28756 The xNF **MUST** support **:partial-lock** and
611   **:partial-unlock** capabilities, defined in RFC 5717. This
612   allows multiple independent clients to each write to a different
613   part of the <running> configuration at the same time.
614 * R-83873 The xNF **MUST** support **:rollback-on-error** value for
615   the <error-option> parameter to the <edit-config> operation. If any
616   error occurs during the requested edit operation, then the target
617   database (usually the running configuration) will be left unaffected.
618   This provides an 'all-or-nothing' edit mode for a single <edit-config>
619   request.
620 * R-68990 The xNF **MUST** support the **:startup** capability. It
621   will allow the running configuration to be copied to this special
622   database. It can also be locked and unlocked.
623 * R-68200 The xNF **MUST** support the **:url** value to specify
624   protocol operation source and target parameters. The capability URI
625   for this feature will indicate which schemes (e.g., file, https, sftp)
626   that the server supports within a particular URL value. The 'file'
627   scheme allows for editable local configuration databases. The other
628   schemes allow for remote storage of configuration databases.
629 * R-20353 The xNF **MUST** implement both **:candidate** and
630   **:writable-running** capabilities. When both **:candidate** and
631   **:writable-running** are provided then two locks should be supported.
632 * R-11499 The xNF **MUST** fully support the XPath 1.0 specification
633   for filtered retrieval of configuration and other database contents.
634   The 'type' attribute within the <filter> parameter for <get> and
635   <get-config> operations may be set to 'xpath'. The 'select' attribute
636   (which contains the XPath expression) will also be supported by the
637   server. A server may support partial XPath retrieval filtering, but
638   it cannot advertise the **:xpath** capability unless the entire XPath
639   1.0 specification is supported.
640 * R-83790 The xNF **MUST** implement the **:validate** capability
641 * R-49145 The xNF **MUST** implement **:confirmed-commit** If
642   **:candidate** is supported.
643 * R-58358 The xNF **MUST** implement the **:with-defaults** capability
644   [RFC6243].
645 * R-59610 The xNF **MUST** implement the data model discovery and
646   download as defined in [RFC6022].
647 * R-87662 The xNF **SHOULD** implement the NETCONF Event Notifications
648   [RFC5277].
649 * R-93443 The xNF **MUST** define all data models in YANG [RFC6020],
650   and the mapping to NETCONF shall follow the rules defined in this RFC.
651 * R-26115 The xNF **MUST** follow the data model upgrade rules defined
652   in [RFC6020] section 10. All deviations from section 10 rules shall
653   be handled by a built-in automatic upgrade mechanism.
654 * R-10716 The xNF **MUST** support parallel and simultaneous
655   configuration of separate objects within itself.
656 * R-29495 The xNF **MUST** support locking if a common object is
657   being manipulated by two simultaneous NETCONF configuration operations
658   on the same xNF within the context of the same writable running data
659   store (e.g., if an interface parameter is being configured then it
660   should be locked out for configuration by a simultaneous configuration
661   operation on that same interface parameter).
662 * R-53015 The xNF **MUST** apply locking based on the sequence of
663   NETCONF operations, with the first configuration operation locking
664   out all others until completed.
665 * R-02616 The xNF **MUST** permit locking at the finest granularity
666   if a xNF needs to lock an object for configuration to avoid blocking
667   simultaneous configuration operations on unrelated objects (e.g., BGP
668   configuration should not be locked out if an interface is being
669   configured or entire Interface configuration should not be locked out
670   if a non-overlapping parameter on the interface is being configured).
671 * R-41829 The xNF **MUST** be able to specify the granularity of the
672   lock via a restricted or full XPath expression.
673 * R-66793 The xNF **MUST** guarantee the xNF configuration integrity
674   for all simultaneous configuration operations (e.g., if a change is
675   attempted to the BUM filter rate from multiple interfaces on the same
676   EVC, then they need to be sequenced in the xNF without locking either
677   configuration method out).
678 * R-54190 The xNF **MUST** release locks to prevent permanent lock-outs
679   when/if a session applying the lock is terminated (e.g., SSH session
680   is terminated).
681 * R-03465 The xNF **MUST** release locks to prevent permanent lock-outs
682   when the corresponding <partial-unlock> operation succeeds.
683 * R-63935 The xNF **MUST** release locks to prevent permanent lock-outs
684   when a user configured timer has expired forcing the NETCONF SSH Session
685   termination (i.e., product must expose a configuration knob for a user
686   setting of a lock expiration timer)
687 * R-10173 The xNF **MUST** allow another NETCONF session to be able to
688   initiate the release of the lock by killing the session owning the lock,
689   using the <kill-session> operation to guard against hung NETCONF sessions.
690 * R-88899 The xNF **MUST** support simultaneous <commit> operations
691   within the context of this locking requirements framework.
692 * R-07545 The xNF **MUST** support all operations, administration and
693   management (OAM) functions available from the supplier for xNFs using
694   the supplied YANG code and associated NETCONF servers.
695 * R-60656 The xNF **MUST** support sub tree filtering.
696 * R-80898 The xNF **MUST** support heartbeat via a <get> with null filter.
697 * R-25238 The xNF PACKAGE **MUST** validated YANG code using the open
698   source pyang [1]_ program using the following commands:
699
700 .. code-block:: python
701
702  $ pyang --verbose --strict <YANG-file-name(s)>
703  $ echo $!
704
705 * R-63953 The xNF **MUST** have the echo command return a zero value
706   otherwise the validation has failed
707 * R-26508 The xNF **MUST** support a NETCONF server that can be mounted on
708   OpenDaylight (client) and perform the operations of: modify, update,
709   change, rollback configurations using each configuration data element,
710   query each state (non-configuration) data element, execute each YANG
711   RPC, and receive data through each notification statement.
712
713
714 The following requirements provides the Yang models that suppliers must
715 conform, and those where applicable, that suppliers need to use.
716
717 * R-28545 The xNF **MUST** conform its YANG model to RFC 6060,
718   “YANG - A Data Modeling Language for the Network Configuration
719   Protocol (NETCONF)”
720 * R-29967 The xNF **MUST** conform its YANG model to RFC 6022,
721   “YANG module for NETCONF monitoring”.
722 * R-22700 The xNF **MUST** conform its YANG model to RFC 6470,
723   “NETCONF Base Notifications”.
724 * R-10353 The xNF **MUST** conform its YANG model to RFC 6244,
725   “An Architecture for Network Management Using NETCONF and YANG”.
726 * R-53317 The xNF **MUST** conform its YANG model to RFC 6087,
727   “Guidelines for Authors and Reviewers of YANG Data Model Documents”.
728 * R-33955 The xNF **SHOULD** conform its YANG model to RFC 6991,
729   “Common YANG Data Types”.
730 * R-22946 The xNF **SHOULD** conform its YANG model to RFC 6536,
731   “NETCONF Access Control Model”.
732 * R-10129 The xNF **SHOULD** conform its YANG model to RFC 7223,
733   “A YANG Data Model for Interface Management”.
734 * R-12271 The xNF **SHOULD** conform its YANG model to RFC 7223,
735   “IANA Interface Type YANG Module”.
736 * R-49036 The xNF **SHOULD** conform its YANG model to RFC 7277,
737   “A YANG Data Model for IP Management”.
738 * R-87564 The xNF **SHOULD** conform its YANG model to RFC 7317,
739   “A YANG Data Model for System Management”.
740 * R-24269 The xNF **SHOULD** conform its YANG model to RFC 7407,
741   “A YANG Data Model for SNMP Configuration”.
742
743 The NETCONF server interface shall fully conform to the following
744 NETCONF RFCs.
745
746 * R-33946 The xNF **MUST** conform to the NETCONF RFC 4741,
747   “NETCONF Configuration Protocol”.
748 * R-04158 The xNF **MUST** conform to the NETCONF RFC 4742,
749   “Using the NETCONF Configuration Protocol over Secure Shell (SSH)”.
750 * R-13800 The xNF **MUST** conform to the NETCONF RFC 5277,
751   “NETCONF Event Notification”.
752 * R-01334 The xNF **MUST** conform to the NETCONF RFC 5717,
753   “Partial Lock Remote Procedure Call”.
754 * R-08134 The xNF **MUST** conform to the NETCONF RFC 6241,
755   “NETCONF Configuration Protocol”.
756 * R-78282 The xNF **MUST** conform to the NETCONF RFC 6242,
757   “Using the Network Configuration Protocol over Secure Shell”.
758
759 VNF REST APIs
760 ^^^^^^^^^^^^^^^
761
762 HealthCheck is a command for which no NETCONF support exists.
763 Therefore, this must be supported using a RESTful interface
764 (defined in this section) or with a Chef cookbook/Ansible playbook
765 (defined in sections `Chef Standards and Capabilities`_ and
766 `Ansible Standards and Capabilities`_).
767
768 HealthCheck Definition: The VNF level HealthCheck is a check over
769 the entire scope of the VNF. The VNF must be 100% healthy, ready
770 to take requests and provide services, with all VNF required
771 capabilities ready to provide services and with all active and
772 standby resources fully ready with no open MINOR, MAJOR or CRITICAL
773 alarms.  NOTE: A switch may need to be turned on, but the VNF should
774 be ready to take service requests or be already processing service
775 requests successfully.
776
777 The VNF must provide a REST formatted GET RPCs to support HealthCheck
778 queries via the GET method over HTTP(s).
779
780 The port number, url, and other authentication information is provided
781 by the VNF provider.
782
783 REST APIs
784 ~~~~~~~~~
785
786 * R-31809 The xNF **MUST** support the HealthCheck RPC. The HealthCheck
787   RPC executes a xNF Provider-defined xNF HealthCheck over the scope of
788   the entire xNF (e.g., if there are multiple VNFCs, then run a health check,
789   as appropriate, for all VNFCs). It returns a 200 OK if the test completes.
790   A JSON object is returned indicating state (healthy, unhealthy), scope
791   identifier, time-stamp and one or more blocks containing info and fault
792   information. If the xNF is unable to run the HealthCheck, return a
793   standard http error code and message.
794
795 Examples of responses when HealthCheck runs and is able to provide a healthy
796 or unhealthy response:
797
798 .. code-block:: java
799
800  {
801    "identifier": "scope represented",
802    "state": "healthy",
803    "time": "01-01-1000:0000"
804  }
805
806  {
807    "identifier": "scope represented",
808    "state": "unhealthy",
809     {[
810    "info": "System threshold exceeded details",
811    "fault":
812      {
813        "cpuOverall": 0.80,
814        "cpuThreshold": 0.45
815      }
816      ]},
817    "time": "01-01-1000:0000"
818  }
819
820
821 Chef Standards and Capabilities
822 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
823
824 ONAP will support configuration of VNFs via Chef subject to the
825 requirements and guidelines defined in this section.
826
827 The Chef configuration management mechanism follows a client-server
828 model. It requires the presence of a Chef-Client on the VNF that will be
829 directly managed by a Chef Server. The Chef-client will register with
830 the appropriate Chef Server and are managed via ‘cookbooks’ and
831 configuration attributes loaded on the Chef Server which contain all
832 necessary information to execute the appropriate actions on the VNF via
833 the Chef-client.
834
835 ONAP will utilize the open source Chef Server, invoke the documented
836 Chef REST APIs to manage the VNF and requires the use of open source
837 Chef-Client and Push Jobs Client on the VNF
838 (https://downloads.chef.io/).
839
840 VNF Configuration via Chef Requirements
841 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
842
843 Chef Client Requirements
844 +++++++++++++++++++++++++
845
846 * R-79224 The xNF **MUST** have the chef-client be preloaded with
847   validator keys and configuration to register with the designated
848   Chef Server as part of the installation process.
849 * R-72184 The xNF **MUST** have routable FQDNs for all the endpoints
850   (VMs) of a xNF that contain chef-clients which are used to register
851   with the Chef Server.  As part of invoking xNF actions, ONAP will
852   trigger push jobs against FQDNs of endpoints for a xNF, if required.
853 * R-47068 The xNF **MAY** expose a single endpoint that is
854   responsible for all functionality.
855 * R-67114 The xNF **MUST** be installed with Chef-Client >= 12.0 and
856   Chef push jobs client >= 2.0.
857
858 Chef Roles/Requirements
859 ++++++++++++++++++++++++++
860
861 * R-27310 The xNF Package **MUST** include all relevant Chef artifacts
862   (roles/cookbooks/recipes) required to execute xNF actions requested by
863   ONAP for loading on appropriate Chef Server.
864 * R-26567 The xNF Package **MUST** include a run list of
865   roles/cookbooks/recipes, for each supported xNF action, that will
866   perform the desired xNF action in its entirety as specified by ONAP
867   (see Section 7.c, ONAP Controller APIs and Behavior, for list of xNF
868   actions and requirements), when triggered by a chef-client run list
869   in JSON file.
870 * R-98911 The xNF **MUST NOT** use any instance specific parameters
871   for the xNF in roles/cookbooks/recipes invoked for a xNF action.
872 * R-37929 The xNF **MUST** accept all necessary instance specific
873   data from the environment or node object attributes for the xNF
874   in roles/cookbooks/recipes invoked for a xNF action.
875 * R-62170 The xNF **MUST** over-ride any default values for
876   configurable parameters that can be set by ONAP in the roles,
877   cookbooks and recipes.
878 * R-78116 The xNF **MUST** update status on the Chef Server
879   appropriately (e.g., via a fail or raise an exception) if the
880   chef-client run encounters any critical errors/failures when
881   executing a xNF action.
882 * R-44013 The xNF **MUST** populate an attribute, defined as node
883   [‘PushJobOutput’] with the desired output on all nodes in the push job
884   that execute chef-client run if the xNF action requires the output of a
885   chef-client run be made available (e.g., get running configuration).
886 * R-30654 The xNF Package **MUST** have appropriate cookbooks that are
887   designed to automatically ‘rollback’ to the original state in case of
888   any errors for actions that change state of the xNF (e.g., configure).
889 * R-65755 The xNF **SHOULD** support callback URLs to return information
890   to ONAP upon completion of the chef-client run for any chef-client run
891   associated with a xNF action.
892
893 -  As part of the push job, ONAP will provide two parameters in the
894    environment of the push job JSON object:
895
896     -  ‘RequestId’ a unique Id to be used to identify the request,
897     -  ‘CallbackUrl’, the URL to post response back.
898
899 -  If the CallbackUrl field is empty or missing in the push job, then
900    the chef-client run need not post the results back via callback.
901
902 * R-15885 The xNF **MUST** Upon completion of the chef-client run,
903   POST back on the callback URL, a JSON object as described in Table
904   A2 if the chef-client run list includes a cookbook/recipe that is
905   callback capable. Failure to POST on the Callback Url should not be
906   considered a critical error. That is, if the chef-client successfully
907   completes the xNF action, it should reflect this status on the Chef
908   Server regardless of whether the Callback succeeded or not.
909
910 ONAP Chef API Usage
911 ~~~~~~~~~~~~~~~~~~~
912
913 This section outlines the workflow that ONAP invokes when it receives an
914 action request against a Chef managed VNF.
915
916 1. When ONAP receives a request for an action for a Chef Managed VNF, it
917    retrieves the corresponding template (based on **action** and
918    **VNF)** from its database and sets necessary values in the
919    “Environment”, “Node” and “NodeList” keys (if present) from either
920    the payload of the received action or internal data.
921
922 2. If “Environment” key is present in the updated template, it posts the
923    corresponding JSON dictionary to the appropriate Environment object
924    REST endpoint on the Chef Server thus updating the Environment
925    attributes on the Chef Server.
926
927 3. Next, it creates a Node Object from the “Node” JSON dictionary for
928    all elements listed in the NodeList (using the FQDN to construct the
929    endpoint) by replicating it  [2]_. As part of this process, it will
930    set the name field in each Node Object to the corresponding FQDN.
931    These node objects are then posted on the Chef Server to
932    corresponding Node Object REST endpoints to update the corresponding
933    node attributes.
934
935 4. If PushJobFlag is set to “True” in the template, ONAP requests a push
936    job against all the nodes in the NodeList to trigger
937    chef-client\ **.** It will not invoke any other command via the push
938    job. ONAP will include a callback URL in the push job request and a
939    unique Request Id. An example push job posted by ONAP is listed
940    below:
941
942 .. code-block:: java
943
944    {
945      "command": "chef-client",
946      "run\_timeout": 300,
947      "nodes”: [“node1.vnf\_a.onap.com”, “node2.vnf\_a.onap.com”],
948        "env": {
949                 “RequestId”:”8279-abcd-aksdj-19231”,
950                 “CallbackUrl”:”<callback>”
951               },
952    }
953
954 5. If CallbackCapable field in the template is not present or set to
955    “False” ONAP will poll the Chef Server to check completion status of
956    the push job.
957
958 6. If “GetOutputFlag” is set to “True” in the template and
959    CallbackCapable is not set to “True”, ONAP will retrieve any output
960    from each node where the push job has finished by accessing the Node
961    Object attribute node[‘PushJobOutput’].
962
963 Ansible Standards and Capabilities
964 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
965
966 ONAP will support configuration of VNFs via Ansible subject to the
967 requirements and guidelines defined in this section.
968
969 Ansible allows agentless management of VNFs/VMs/VNFCs via execution
970 of ‘playbooks’ over ssh. The ‘playbooks’ are a structured set of
971 tasks which contain all the necessary resources and execution capabilities
972 to take the necessary action on one or more target VMs (and/or VNFCs)
973 of the VNF. ONAP will utilize the framework of an Ansible Server that
974 will host all Ansible artifacts and run playbooks to manage VNFs that support
975 Ansible.
976
977 VNF Configuration via Ansible Requirements
978 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
979
980 Ansible Client Requirements
981 +++++++++++++++++++++++++++++
982
983 * R-32217 The xNF **MUST** have routable FQDNs that are reachable via
984   the Ansible Server for the endpoints (VMs) of a xNF on which playbooks
985   will be executed. ONAP will initiate requests to the Ansible Server
986   for invocation of playbooks against these end points [3]_.
987 * R-54373 The xNF **MUST** have Python >= 2.6 on the endpoint VM(s)
988   of a xNF on which an Ansible playbook will be executed.
989 * R-35401 The xNF **MUST** support SSH and allow SSH access by the
990   Ansible server for the endpoint VM(s) and comply with the Network
991   Cloud Service Provider guidelines for authentication and access.
992 * R-82018 The xNF **MUST** load the Ansible Server SSH public key onto xNF
993   VM(s) as part
994   of instantiation. This will allow the Ansible Server to authenticate
995   to perform post-instantiation configuration without manual intervention
996   and without requiring specific xNF login IDs and passwords.
997
998  CAUTION: For VNFs configured using Ansible, to eliminate the need
999  for manual steps, post-instantiation and pre-configuration, to upload
1000  of SSH public keys, SSH public keys loaded during (heat) instantiation shall
1001  be preserved and not removed by (heat) embedded (userdata) scripts.
1002
1003 * R-92866 The xNF **MUST** include as part of post-instantiation configuration
1004   done by Ansible Playbooks the removal/update of the SSH public key from
1005   /root/.ssh/authorized_keys, and  update of SSH keys loaded through
1006   instantiation to support Ansible. This may include download and install of
1007   new SSH keys and new mechanized IDs.
1008 * R-91745 The xNF **MUST** update the Ansible Server and other entities
1009   storing and using the SSH keys for authentication when the SSH keys used
1010   by Ansible are regenerated/updated.
1011
1012   NOTE: Ansible Server itself may be used to upload new SSH public keys
1013   onto supported VNFs.
1014
1015 Ansible Playbook Requirements
1016 +++++++++++++++++++++++++++++++
1017
1018 An Ansible playbook is a collection of tasks that is executed on the
1019 Ansible server (local host) and/or the target VM (s) in order to
1020 complete the desired action.
1021
1022 * R-40293 The xNF **MUST** make available playbooks that conform
1023   to the ONAP requirement.
1024 * R-49396 The xNF **MUST** support each ONAP (APPC) xNF action
1025   by invocation of **one** playbook [4]_. The playbook will be responsible
1026   for executing
1027   all necessary tasks (as well as calling other playbooks) to complete
1028   the request.
1029 * R-33280 The xNF **MUST NOT** use any instance specific parameters
1030   in a playbook.
1031 * R-48698 The xNF **MUST** utilize information from key value pairs
1032   that will be provided by the Ansible Server as "extra-vars" during
1033   invocation to execute the desired xNF action. If the playbook requires
1034   files, they must also be supplied using the methodology detailed in
1035   the Ansible Server API, unless they are bundled with playbooks, example,
1036   generic templates.
1037
1038 The Ansible Server will determine if a playbook invoked to execute a
1039 xNF action finished successfully or not using the “PLAY_RECAP” summary
1040 in Ansible log.  The playbook will be considered to successfully finish
1041 only if the “PLAY RECAP” section at the end of playbook execution output
1042 has no unreachable hosts and no failed tasks. Otherwise, the playbook
1043 will be considered to have failed.
1044
1045 * R-43253 The xNF **MUST** use playbooks designed to allow Ansible
1046   Server to infer failure or success based on the “PLAY_RECAP” capability.
1047   NOTE: There are cases where playbooks need to interpret results of a task
1048   and then determine success or failure and return result accordingly
1049   (failure for failed tasks).
1050 * R-50252 The xNF **MUST** write to a specific one text files that
1051   will be retrieved and made available by the Ansible Server if, as part
1052   of a xNF action (e.g., audit), a playbook is required to return any
1053   xNF information. The text files must be written in the same directory as
1054   the one from which the playbook is being executed. A text file must be
1055   created for the xNF playbook run targets/affects, with the name
1056   ‘<VNFname>_results.txt’ into which any desired output from each
1057   respective VM/xNF must be written.
1058 * R-51442 The xNF **SHOULD** use playbooks that are designed to
1059   automatically ‘rollback’ to the original state in case of any errors
1060   for actions that change state of the xNF (e.g., configure).
1061
1062  NOTE: In case rollback at the playbook level is not supported or possible,
1063  the xNF provider shall provide alternative locking mechanism (e.g., for a
1064  small xNF the rollback mechanism may rely on workflow to terminate and
1065  re-instantiate VNF VMs and then re-run playbook(s)). Backing up updated
1066  files also recommended to support rollback when soft rollback is feasible.
1067
1068 * R-58301 The xNF **SHOULD NOT** use playbooks that make requests to
1069   Cloud resources e.g. Openstack (nova, neutron, glance, heat, etc.);
1070   therefore, there is no use for Cloud specific variables like Openstack
1071   UUIDs in Ansible Playbooks.
1072
1073  Rationale: Flows that require interactions with Cloud services
1074  e.g. Openstack shall rely on workflows run by an Orchestrator
1075  (Change Management) or
1076  other capability (such as a control loop or Operations GUI) outside
1077  Ansible Server which can be executed by a Controller such as APPC.
1078  There are policies, as part of Control Loop models, that send remediation
1079  action requests to APPC; these are triggered as a response to an event
1080  or correlated events published to Event Bus.
1081
1082 * R-02651 The xNF **SHOULD** use the Ansible backup feature to save a
1083   copy of configuration files before implementing changes to support
1084   operations such as backing out of software upgrades, configuration
1085   changes or other work as this will help backing out of configuration
1086   changes when needed.
1087 * R-43353 The xNF **MUST** return control from Ansible Playbooks only
1088   after tasks are fully complete, signaling that the playbook completed
1089   all tasks. When starting services, return control only after all services
1090   are up. This is critical for workflows where the next steps are dependent
1091   on prior tasks being fully completed.
1092
1093  Detailed examples:
1094
1095  StopApplication Playbook – StopApplication Playbook shall return control
1096  and a completion status only after VNF application is fully stopped, all
1097  processes/services stopped.
1098  StartApplication Playbook – StartApplication Playbook shall return control
1099  and a completion status only after all VNF application services are fully up,
1100  all processes/services started and ready to provide services. NOTE: Start
1101  Playbook should not be declared complete/done after starting one or several
1102  processes that start the other processes.
1103
1104  HealthCheck Playbook:
1105
1106  SUCCESS – HealthCheck success shall be returned (return code 0) by a
1107  Playbook or Cookbook only when VNF is 100% healthy, ready to take requests
1108  and provide services, with all VNF required capabilities ready to provide
1109  services and with all active and standby resources fully ready with no
1110  open MINOR, MAJOR or CRITICAL alarms.
1111
1112  NOTE: In some cases, a switch may need to be turned on, but a VNF
1113  reported as healthy, should be ready to take service requests or be
1114  already processing service requests successfully.
1115
1116  A successful execution of a health-check playbook shall also create one
1117  file per VNF VM, named after the VNF instance name followed by
1118  “_results.txt (<vnf_instance>_results.txt) to indicate health-check was
1119  executed and completed successfully, example: vfdb9904v_results.txt,
1120  with the following contents:
1121
1122 .. code-block:: java
1123
1124   {
1125    "identifier": "VNF",
1126    "state": "healthy",
1127    "time": "2018-03-16:1139"
1128   }
1129
1130 Example:
1131
1132 .. code-block:: java
1133
1134   $ cat vfdb9904v_results.txt
1135   {
1136    "identifier": "VNF",
1137    "state": "healthy",
1138    "time": "2018-03-16:1139"
1139   }
1140 ..
1141
1142  FAILURE – A health check playbook shall return a non-zero return code in
1143  case VNF is not 100% healthy because one or more VNF application processes
1144  are stopped or not ready to take service requests or because critical or
1145  non-critical resources are not ready or because there are open MINOR, MAJOR
1146  or CRITICAL traps/alarms or because there are issues with the VNF that
1147  need attention even if they do not impact services provided by the VNF.
1148
1149  A failed health-check playbook shall also create one file per VNF,
1150  named after the VNF instance name, followed by
1151  “_results.txt to indicate health-check was executed and found issues
1152  in the health of the VNF. This is to differentiate from failure to
1153  run health-check playbook or playbook tasks to verify the health of the VNF,
1154  example: vfdb9904v_results.txt, with the following contents:
1155
1156 .. code-block:: java
1157
1158  {
1159   "identifier": "VNF",
1160   "state": "unhealthy",
1161   "info": "Error in following VM(s). Check hcstatus files
1162   under /tmp/ccfx9901v for details",
1163   "fault": [
1164     "vfdb9904vm001",
1165     "vfdb9904vm002"
1166   ],
1167   "time": "2018-03-16:4044"
1168  }
1169 ..
1170
1171  Example:
1172
1173 .. code-block:: java
1174
1175  $ cat vfdb9904v_results.txt
1176  {
1177   "identifier": "VNF",
1178   "state": "unhealthy",
1179   "info": "Error in following VM(s). Check hcstatus files
1180   under /tmp/ccfx9901v for details",
1181   "fault": [
1182     "vfdb9904vm001",
1183     "vfdb9904vm002"
1184   ],
1185   "time": "2018-03-16:4044"
1186  }
1187 ..
1188
1189  See `VNF REST APIs`_ for additional details on HealthCheck.
1190
1191 ONAP Controller / Ansible API Usage
1192 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1193
1194 This section outlines the workflow that ONAP Controller invokes when
1195 it receives an action request against an Ansible managed VNF.
1196
1197  #. When ONAP Controller receives a request for an action for an
1198     AnsibleManaged VNF, it retrieves the corresponding template (based
1199     on **action** and **VNF**) from its database and sets necessary
1200     values (such as an Id, NodeList, and EnvParameters) from either
1201     information in the request or data obtained from other sources.
1202     This is referred to as the payload that is sent as a JSON object
1203     to the Ansible server.
1204  #. The ONAP Controller sends a request to the Ansible server to
1205     execute the action.
1206  #. The ONAP Controller polls the Ansible Server for result (success
1207     or failure).  The ONAP Controllers has a timeout value which is
1208     contained in the template.   If the result is not available when the
1209     timeout is reached, the ONAP Controller stops polling and returns a
1210     timeout error to the requester.   The Ansible Server continues to
1211     process the request.
1212
1213
1214 Support of Controller Commands And Southbound Protocols
1215 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1216
1217 The following table summarizes the commands and possible protocols selected.
1218 Note that the HealthCheck can also be supported via REST.
1219
1220 Table 8. ONAP Controller APIs and NETCONF Commands
1221
1222 +-------------+--------------------+--------------------+--------------------+
1223 |**Command**  |**NETCONF Support** |**Chef Support**    |**Ansible**         |
1224 +=============+====================+====================+====================+
1225 |General      |For each RPC, the   |VNF Vendor must     |VNF Vendor must     |
1226 |Comments     |appropriate RPC     |provide any         |provide an Ansible  |
1227 |             |operation is listed.|necessary roles,    |playbook to retrieve|
1228 |             |                    |cookbooks, recipes  |the running         |
1229 |             |                    |to retrieve the     |configuration from a|
1230 |             |                    |running             |VNF and place the   |
1231 |             |                    |configuration from  |output on the       |
1232 |             |                    |a VNF and place it  |Ansible server in   |
1233 |             |                    |in the respective   |a manner aligned    |
1234 |             |                    |Node Objects        |with playbook       |
1235 |             |                    |‘PushJobOutput’     |requirements listed |
1236 |             |                    |attribute of all    |in this document.   |
1237 |             |                    |nodes in NodeList   |                    |
1238 |             |                    |when triggered      |The PlaybookName    |
1239 |             |                    |by a chef-client    |must be provided    |
1240 |             |                    |run.                |in the JSON file.   |
1241 |             |                    |                    |                    |
1242 |             |                    |The JSON file for   |NodeList must list  |
1243 |             |                    |this VNF action is  |IP addresses or DNS |
1244 |             |                    |required to set     |supported FQDNs of  |
1245 |             |                    |“PushJobFlag” to    |an example VNF      |
1246 |             |                    |“True” and          |on which to         |
1247 |             |                    |“GetOutputFlag” to  |execute playbook.   |
1248 |             |                    |“True”. The “Node”  |                    |
1249 |             |                    |JSON dictionary     |                    |
1250 |             |                    |must have the run   |                    |
1251 |             |                    |list populated      |                    |
1252 |             |                    |with the necessary  |                    |
1253 |             |                    |sequence of roles,  |                    |
1254 |             |                    |cookbooks, recipes. |                    |
1255 |             |                    |                    |                    |
1256 |             |                    |The Environment     |                    |
1257 |             |                    |and Node values     |                    |
1258 |             |                    |should contain all  |                    |
1259 |             |                    |appropriate         |                    |
1260 |             |                    |configuration       |                    |
1261 |             |                    |attributes.         |                    |
1262 |             |                    |                    |                    |
1263 |             |                    |NodeList must       |                    |
1264 |             |                    |list sample FQDNs   |                    |
1265 |             |                    |that are required to|                    |
1266 |             |                    |conduct a           |                    |
1267 |             |                    |chef-client run for |                    |
1268 |             |                    |this VNF Action.    |                    |
1269 +-------------+--------------------+--------------------+--------------------+
1270 |Audit        |The <get-config> is |Supported via a     |Supported via a     |
1271 |             |used to return the  |cookbook that       |playbook that       |
1272 |             |running             |returns the running |returns the running |
1273 |             |configuration.      |configuration.      |configuration.      |
1274 +-------------+--------------------+--------------------+--------------------+
1275 |Configure,   |The <edit-config>   |Supported via a     |Supported via a     |
1276 |ModifyConfig |operation loads all |cookbook that       |playbook that       |
1277 |             |or part of a        |updates the VNF     |updates the VNF     |
1278 |             |specified data set  |configuration.      |configuration.      |
1279 |             |to the specified    |                    |                    |
1280 |             |target database. If |                    |                    |
1281 |             |there is no         |                    |                    |
1282 |             |<candidate/>        |                    |                    |
1283 |             |database, then the  |                    |                    |
1284 |             |target is the       |                    |                    |
1285 |             |<running/> database.|                    |                    |
1286 |             |A <commit> follows. |                    |                    |
1287 +-------------+--------------------+--------------------+--------------------+
1288 |Other        |This command has no |Supported via a     |Supported via a     |
1289 |Configuration|existing NETCONF RPC|cookbook that       |playbook that       |
1290 |Commands     |action.             |performs            |performs            |
1291 |             |                    |the action.         |the action.         |
1292 +-------------+--------------------+--------------------+--------------------+
1293 |Lifecycle    |This command has no |Supported via a     |Supported via a     |
1294 |Management   |existing NETCONF RPC|cookbook that       |playbook that       |
1295 |Commands     |action.             |performs            |performs            |
1296 |             |                    |the action.         |the action.         |
1297 +-------------+--------------------+--------------------+--------------------+
1298 |Health Check |This command has no |Supported via a     |Supported           |
1299 |             |existing NETCONF RPC|cookbook            |via a               |
1300 |             |action.             |that                |playbook            |
1301 |             |                    |performs            |that                |
1302 |             |                    |a HealthCheck and   |performs            |
1303 |             |                    |returns the results.|the                 |
1304 |             |                    |                    |HealthCheck         |
1305 |             |                    |                    |and returns         |
1306 |             |                    |                    |the                 |
1307 |             |                    |                    |results.            |
1308 +-------------+--------------------+--------------------+--------------------+
1309
1310 Monitoring & Management
1311 --------------------------------------------------
1312
1313 This section addresses data collection and event processing
1314 functionality that is directly dependent on the interfaces
1315 provided by the VNFs’ APIs. These can be in the form of asynchronous
1316 interfaces for event, fault notifications, and autonomous data streams.
1317 They can also be synchronous interfaces for on-demand requests to
1318 retrieve various performance, usage, and other event information.
1319
1320 The target direction for VNF interfaces is to employ APIs that are
1321 implemented utilizing standardized messaging and modeling protocols
1322 over standardized transports. Migrating to a virtualized environment
1323 presents a tremendous opportunity to eliminate the need for proprietary
1324 interfaces for VNF provider equipment while removing the traditional
1325 boundaries between Network Management Systems and Element Management
1326 Systems. Additionally, VNFs provide the ability to instrument the
1327 networking applications by creating event records to test and monitor
1328 end-to-end data flow through the network, similar to what physical or
1329 virtual probes provide without the need to insert probes at various
1330 points in the network. The VNF providers must be able to provide the
1331 aforementioned set of required data directly to the ONAP collection
1332 layer using standardized interfaces.
1333
1334 Data Model for Event Records
1335 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1336
1337 This section describes the data model for the collection of telemetry
1338 data from VNFs by Service Providers (SPs) to manage VNF health and
1339 runtime lifecycle. This data model is referred to as the VNF Event
1340 Streaming (VES) specifications. While this document is focused on
1341 specifying some of the records from the ONAP perspective, there may
1342 be other external bodies using the same framework to specify additional
1343 records. For example, OPNFV has a VES project that is looking to specify
1344 records for OpenStack’s internal telemetry to manage Application (VNFs),
1345 physical and virtual infrastructure (compute, storage, network devices),
1346 and virtual infrastructure managers (cloud controllers, SDN controllers).
1347 Note that any configurable parameters for these data records (e.g.,
1348 frequency, granularity, policy-based configuration) will be managed
1349 using the “Configuration” framework described in the prior sections
1350 of this document.
1351
1352 The Data Model consists of:
1353
1354 -  Common Header Record: This data structure precedes each of the
1355    Technology Independent and Technology Specific records sections of
1356    the data model.
1357
1358 -  Technology Independent Records: This version of the document
1359    specifies the model for Fault, Heartbeat, State Change, Syslog,
1360    Threshold Crossing Alerts, and VNF Scaling* (short for
1361    measurementForVfScalingFields – actual name used in JSON
1362    specification) records. In the future, these may be extended to
1363    support other types of technology independent records. Each of
1364    these records allows additional fields (name/ value pairs) for
1365    extensibility. The VNF provider can use these VNF Provider-specific
1366    additional fields to provide additional information that may be
1367    relevant to the managing systems.
1368
1369 -  Technology Specific Records: This version of the document specifies
1370    the model for Mobile Flow records, Signaling and Voice Quality records.
1371    In the future, these may be extended to support other types of records
1372    (e.g. Network Fabric, Security records, etc.). Each of these records
1373    allows additional fields (name/value pairs) for extensibility. The VNF
1374    providers can use these VNF-specific additional fields to provide
1375    additional information that may be relevant to the managing systems.
1376    A placeholder for additional technology specific areas of interest to
1377    be defined in the future documents has been depicted.
1378
1379 |image0|
1380
1381 Figure 1. Data Model for Event Records
1382
1383 Event Records - Data Structure Description
1384 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1385
1386 The data structure for event records consists of:
1387
1388 -  a Common Event Header block;
1389
1390 -  zero or more technology independent domain blocks; and
1391
1392    -  e.g., Fault domain, State Change domain, Syslog domain, etc.
1393
1394 -  zero or more technology specific domain blocks.
1395
1396    -  e.g., Mobile Flow domain, Signaling domain, Voice Quality domain,
1397       etc.
1398
1399 Common Event Header
1400 ~~~~~~~~~~~~~~~~~~~~~
1401
1402 The common header that precedes any of the domain-specific records contains
1403 information identifying the type of record to follow, information about
1404 the sender and other identifying characteristics related to timestamp,
1405 sequence number, etc.
1406
1407 Technology Independent Records – Fault Fields
1408 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1409
1410 The Fault Record, describing a condition in the Fault domain, contains
1411 information about the fault such as the entity under fault, the
1412 severity, resulting status, etc.
1413
1414 Technology Independent Records – Heartbeat Fields
1415 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1416
1417 The Heartbeat Record provides an optional structure for communicating
1418 information about heartbeat or watchdog signaling events.  It can
1419 contain information about service intervals, status information etc.
1420 as required by the heartbeat implementation.
1421
1422 Note: Heartbeat records would only have the Common Event Header block.
1423 An optional heartbeat domain is available if required by the heartbeat
1424 implementation.
1425
1426 Technology Independent Records – State Change Fields
1427 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1428
1429 The State Change Record provides a structure for communicating information
1430 about data flow through the VNF. It can contain information about state
1431 change related to physical device that is reported by VNF. As an example,
1432 when cards or port name of the entity that has changed state.
1433
1434 Technology Independent Records – Syslog Fields
1435 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1436
1437 The Syslog Record provides a structure for communicating any type of
1438 information that may be logged by the VNF. It can contain information
1439 about system internal events, status, errors, etc.
1440
1441 Technology Independent Records – Threshold Crossing Alert Fields
1442 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1443
1444 The Threshold Crossing Alert (TCA) Record provides a structure for
1445 communicating information about threshold crossing alerts. It can
1446 contain alert definitions and types, actions, events, timestamps
1447 and physical or logical details.
1448
1449 Technology Independent Records - VNF Scaling Fields
1450 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1451
1452 The VNF Scaling\* (short for measurementForVfScalingFields –
1453 actual name used in JSON specification) Record contains information
1454 about VNF and VNF resource structure and its condition to help in
1455 the management of the resources for purposes of elastic scaling.
1456
1457 Technology Independent Records – otherFields
1458 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1459
1460 The otherFields Record defines fields for events belonging to the
1461 otherFields domain of the Technology Independent domain enumeration.
1462 This record provides a mechanism to convey a complex set of fields
1463 (possibly nested or opaque) and is purely intended to address
1464 miscellaneous needs such as addressing time-to-market considerations
1465 or other proof-of-concept evaluations. Hence, use of this record
1466 type is discouraged and should be minimized.
1467
1468 Technology Specific Records – Mobile Flow Fields
1469 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1470
1471 The Mobile Flow Record provides a structure for communicating
1472 information about data flow through the VNF. It can contain
1473 information about connectivity and data flows between serving
1474 elements for mobile service, such as between LTE reference points, etc.
1475
1476 Technology Specific Records – Signaling Fields
1477 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1478
1479 The Signaling Record provides a structure for communicating information
1480 about signaling messages, parameters and signaling state.  It can
1481 contain information about data flows for signaling and controlling
1482 multimedia communication sessions such as voice and video calls.
1483
1484 Technology Specific Records – Voice Quality Fields
1485 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1486 The Voice Quality Record provides a structure for communicating information
1487 about voice quality statistics including media connection information,
1488 such as transmitted octet and packet counts, packet loss, packet delay
1489 variation, round-trip delay, QoS parameters and codec selection.
1490
1491 Technology Specific Records – Future Domains
1492 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1493
1494 The futureDomains Record is a placeholder for additional technology
1495 specific areas of interest that will be defined and described
1496 in the future documents.
1497
1498 Data Structure Specification of the Event Record
1499 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1500
1501 For additional information on the event record formats of the data
1502 structures mentioned above, please refer to `VES Event
1503 Listener <https://github.com/att/evel-test-collector/tree/master/docs/att_interface_definition>`__.
1504
1505 Transports and Protocols Supporting Resource Interfaces
1506 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1507
1508 Delivery of data from VNFs to ONAP must use the common transport
1509 mechanisms and protocols for all VNFs as defined in this document.
1510 Transport mechanisms and protocols have been selected to enable both
1511 high volume and moderate volume datasets, as well as asynchronous and
1512 synchronous communications over secure connections. The specified
1513 encoding provides self-documenting content, so data fields can be
1514 changed as needs evolve, while minimizing changes to data delivery.
1515
1516 The term ‘Event Record’ is used throughout this document to represent
1517 various forms of telemetry or instrumentation made available by the
1518 VNF including, faults, status events, various other types of VNF
1519 measurements and logs. Headers received by themselves must be used
1520 as heartbeat indicators. Common structures and delivery protocols for
1521 other types of data will be given in future versions of this document
1522 as we get more insight into data volumes and required processing.
1523
1524 In the following sections, we provide options for encoding, serialization
1525 and data delivery. Agreements between Service Providers and VNF providers
1526 shall determine which encoding, serialization and delivery method to use
1527 for particular data sets. The selected methods must be agreed to prior to
1528 the on-boarding of the VNF into ONAP design studio.
1529
1530 VNF Telemetry using VES/JSON Model
1531 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1532
1533 The preferred model for data delivery from a VNF to ONAP DCAE is
1534 the JSON driven model as depicted in Figure 2.
1535
1536 |image1|
1537
1538 Figure 2. VES/JSON Driven Model
1539
1540 VNF providers will provide a YAML artifact to the Service Provider
1541 that describes:
1542
1543 * standard VES/JSON model information elements (key/values) that
1544   the VNF provides
1545 * any additional non-standard (custom) VES/JSON model information
1546   elements (key/values) that the VNF provides
1547
1548 Using the semantics and syntax supported by YAML, VNF providers
1549 will indicate specific conditions that may arise, and recommend
1550 actions that should be taken at specific thresholds, or if specific
1551 conditions repeat within a specified time interval.
1552
1553 Based on the VNF provider's recommendations, the Service Provider may
1554 create additional YAML artifacts (using ONAP design Studio), which
1555 finalizes Service Provider engineering rules for the processing of
1556 the VNF events.  The Service Provider may alter the threshold levels
1557 recommended by the VNF providor, and may modify and more clearly
1558 specify actions that should be taken when specified conditions arise.
1559 The Service Provider-created version of the YAML artifact will be
1560 distributed to ONAP applications by the Design framework.
1561
1562 VNF Telemetry using YANG Model
1563 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1564
1565 In addition to the JSON driven model described above, a YANG
1566 driven model can also be supported, as depicted in Figure 3.
1567
1568 |image2|
1569
1570 Figure 3. YANG Driven Model
1571
1572 VNF providers will provide to the Service Provider the following
1573 YANG model artifacts:
1574
1575 * common IETF YANG modules that support the VNF
1576 * native (VNF provider-supplied) YANG modules that support the VNF
1577 * open (OpenConfig) YANG modules and the following
1578   configuration-related information, including:
1579
1580   * telemetry configuration and operational state data; such as:
1581
1582     * sensor paths
1583     * subscription bindings
1584     * path destinations
1585     * delivery frequency
1586     * transport mechanisms
1587     * data encodings
1588
1589 * a YAML artifact that provides all necessary mapping relationships
1590   between YANG model data types to VES/JSON information elements
1591 * YANG helper or decoder functions that automate the conversion between
1592   YANG model data types to VES/JSON information elements
1593 * OPTIONAL: YANG Telemetry modules in JSON format per RFC 7951
1594
1595 Using the semantics and syntax supported by YANG, VNF providers
1596 will indicate specific conditions that may arise, and recommend
1597 actions that should be taken at specific thresholds, or if specific
1598 conditions repeat within a specified time interval.
1599
1600 Based on the VNF provider's recommendations, the Service Provider may
1601 create additional YAML artifacts (using ONAP design Studio), which
1602 finalizes Service Provider engineering rules for the processing of the
1603 VNF events.  The Service Provider may alter the threshold levels recommended
1604 by the VNF provider, and may modify and more clearly specify actions that
1605 should be taken when specified conditions arise.  The Service
1606 Provided-created version of the YAML will be distributed to ONAP
1607 applications by the Design framework.
1608
1609 Note: While supporting the YANG model described above, we are still
1610 leveraging the VES JSON based model in DCAE.  The purpose of the
1611 diagram above is to illustrate the concept only and not to imply a
1612 specific implementation.
1613
1614 VNF Telemetry using Google Protocol Buffers
1615 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616
1617 In addition to the data delivery models described above, support for
1618 delivery of VNF telemetry using Google Protocol Buffers (GPB) can
1619 also be supported, as depicted in Figure 4.
1620
1621 VNF providers will provide to the Service Provider the additional
1622 following artifacts to support the delivery of VNF telemetry to DCAE
1623 via the open-source gRPC mechanism using Google's Protocol Buffers:
1624
1625 * the YANG model artifacts described in support of the
1626   "VNF Telemetry using YANG Model"
1627 * valid definition file(s) for all GPB / KV-GPB encoded messages
1628 * valid definition file(s) for all gRPC services
1629 * gRPC method parameters and return types specified as Protocol
1630   Buffers messages
1631
1632 |image3|
1633
1634 Figure 4. Protocol Buffers Driven Model
1635
1636 Note: if Google Protocol Buffers are employed for delivery of VNF
1637 telemetry, Key-Value Google Protocol Buffers (KV-GPB) is the
1638 preferred serialization method.  Details of specifications and
1639 versioning corresponding to a release can be found at:
1640 `VES Event Listener <https://github.com/att/evel-test-collector/tree/master/docs/att_interface_definition>`__.
1641
1642 Note: While supporting the VNF telemetry delivery approach described above,
1643 we are still leveraging the VES JSON based model in DCAE.  The purpose of
1644 the diagram above is to illustrate the concept only and not to imply a
1645 specific implementation.
1646
1647 Monitoring & Management Requirements
1648 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1649
1650 VNF telemetry via standardized interface
1651 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1652
1653 * R-51910 The xNF **MUST** provide all telemetry (e.g., fault event
1654   records, syslog records, performance records etc.) to ONAP using the
1655   model, format and mechanisms described in this section.
1656
1657 Encoding and Serialization
1658 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
1659
1660 Content delivered from VNFs to ONAP is to be encoded and serialized using JSON:
1661
1662 JSON
1663 ~~~~~~~~~~~~~~~~~~
1664
1665 * R-19624 The xNF **MUST** encode and serialize content delivered to
1666   ONAP using JSON (RFC 7159) plain text format. High-volume data
1667   is to be encoded and serialized using `Avro <http://avro.apache.org/>`_, where the Avro [5]_ data format are described using JSON.
1668
1669   Note:
1670
1671   - JSON plain text format is preferred for moderate volume data sets
1672     (option 1), as JSON has the advantage of having well-understood simple
1673     processing and being human-readable without additional decoding. Examples
1674     of moderate volume data sets include the fault alarms and performance
1675     alerts, heartbeat messages, measurements used for xNF scaling and syslogs.
1676   - Binary format using Avro is preferred for high volume data sets
1677     (option 2) such as mobility flow measurements and other high-volume
1678     streaming events (such as mobility signaling events or SIP signaling)
1679     or bulk data, as this will significantly reduce the volume of data
1680     to be transmitted. As of the date of this document, all events are
1681     reported using plain text JSON and REST.
1682   - Avro content is self-documented, using a JSON schema. The JSON schema is
1683     delivered along with the data content
1684     (http://avro.apache.org/docs/current/ ). This means the presence and
1685     position of data fields can be recognized automatically, as well as the
1686     data format, definition and other attributes. Avro content can be
1687     serialized as JSON tagged text or as binary. In binary format, the
1688     JSON schema is included as a separate data block, so the content is
1689     not tagged, further compressing the volume. For streaming data, Avro
1690     will read the schema when the stream is established and apply the
1691     schema to the received content.
1692
1693 In addition to the preferred method (JSON), content can be delivered
1694 from xNFs to ONAP can be encoded and serialized using Google Protocol
1695 Buffers (GPB).
1696
1697 KV-GPB/GPB
1698 ~~~~~~~~~~~~~~~~~~
1699
1700 Telemetry data delivered using Google Protocol Buffers v3 (proto3)
1701 can be serialized in one of the following methods:
1702
1703 * Key-value Google Protocol Buffers (KV-GPB) is also known as
1704   self-describing GPB:
1705
1706   * keys are strings that correspond to the path of the system
1707     resources for the VNF being monitored.
1708   * values correspond to integers or strings that identify the
1709     operational state of the VNF resource, such a statistics counters
1710     and the state of a VNF resource.
1711
1712 * VNF providers must supply valid KV-GPB definition file(s) to allow
1713   for the decoding of all KV-GPB encoded telemetry messages.
1714
1715 * Native Google Protocol Buffers (GPB) is also known as compact GPB:
1716
1717   * keys are represented as integers pointing to the system resources for
1718     the VNF being monitored.
1719   * values correspond to integers or strings that identify the operational
1720     state of the VNF resource, such a statistics counters and the state
1721     of a VNF resource.
1722
1723 * Google Protocol Buffers (GPB) requires metadata in the form of .proto
1724   files. VNF providers must supply the necessary GPB .proto files such that
1725   GPB telemetry messages can be encoded and decoded.
1726
1727 * In the future, we may consider support for other types of
1728   encoding & serialization methods based on industry demand.
1729
1730
1731 Reporting Frequency
1732 ~~~~~~~~~~~~~~~~~~~~~
1733
1734 * R-98191 The xNF **MUST** vary the frequency that asynchronous data
1735   is delivered based on the content and how data may be aggregated or
1736   grouped together.
1737
1738   Note:
1739
1740   - For example, alarms and alerts are expected to be delivered as
1741     soon as they appear. In contrast, other content, such as
1742     performance measurements, KPIs or reported network signaling may have
1743     various ways of packaging and delivering content. Some content should
1744     be streamed immediately; or content may be monitored over a time interval,
1745     then packaged as collection of records and delivered as block; or data
1746     may be collected until a package of a certain size has been collected;
1747     or content may be summarized statistically over a time interval, or
1748     computed as a KPI, with the summary or KPI being delivered.
1749   - We expect the reporting frequency to be configurable depending
1750     on the virtual network function’s needs for management. For example,
1751     Service Provider may choose to vary the frequency of collection between
1752     normal and trouble-shooting scenarios.
1753   - Decisions about the frequency of data reporting will affect the
1754     size of delivered data sets, recommended delivery method, and how the
1755     data will be interpreted by ONAP. These considerations should not
1756     affect deserialization and decoding of the data, which will be guided
1757     by the accompanying JSON schema or GPB definition files.
1758
1759 Addressing and Delivery Protocol
1760 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1761
1762 ONAP destinations can be addressed by URLs for RESTful data PUT. Future
1763 data sets may also be addressed by host name and port number for TCP
1764 streaming, or by host name and landing zone directory for SFTP transfer
1765 of bulk files.
1766
1767 * R-88482 The xNF **SHOULD** use REST using HTTPS delivery of plain
1768   text JSON for moderate sized asynchronous data sets, and for high
1769   volume data sets when feasible.
1770 * R-84879 The xNF **MUST** have the capability of maintaining a primary
1771   and backup DNS name (URL) for connecting to ONAP collectors, with the
1772   ability to switch between addresses based on conditions defined by policy
1773   such as time-outs, and buffering to store messages until they can be
1774   delivered. At its discretion, the service provider may choose to populate
1775   only one collector address for a xNF. In this case, the network will
1776   promptly resolve connectivity problems caused by a collector or network
1777   failure transparently to the xNF.
1778 * R-81777 The xNF **MUST** be configured with initial address(es) to use
1779   at deployment time. Subsequently, address(es) may be changed through
1780   ONAP-defined policies delivered from ONAP to the xNF using PUTs to a
1781   RESTful API, in the same manner that other controls over data reporting
1782   will be controlled by policy.
1783 * R-08312 The xNF **MAY** use another option which is expected to include REST
1784   delivery of binary encoded data sets.
1785 * R-79412 The xNF **MAY** use another option which is expected to include TCP
1786   for high volume streaming asynchronous data sets and for other high volume
1787   data sets. TCP delivery can be used for either JSON or binary encoded data
1788   sets.
1789 * R-01033 The xNF **MAY** use another option which is expected to include SFTP
1790   for asynchronous bulk files, such as bulk files that contain large volumes of
1791   data collected over a long time interval or data collected across many xNFs.
1792   (Preferred is to reorganize the data into more frequent or more focused data
1793   sets, and deliver these by REST or TCP as appropriate.)
1794 * R-63229 The xNF **MAY** use another option which is expected to include REST
1795   for synchronous data, using RESTCONF (e.g., for xNF state polling).
1796 * R-03070 The xNF **MUST**, by ONAP Policy, provide the ONAP addresses
1797   as data destinations for each xNF, and may be changed by Policy while
1798   the xNF is in operation. We expect the xNF to be capable of redirecting
1799   traffic to changed destinations with no loss of data, for example from
1800   one REST URL to another, or from one TCP host and port to another.
1801
1802 Asynchronous and Synchronous Data Delivery
1803 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1804
1805 * R-06924 The xNF **MUST** deliver asynchronous data as data becomes
1806   available, or according to the configured frequency.
1807 * R-73285 The xNF **MUST** must encode, address and deliver the data
1808   as described in the previous paragraphs.
1809 * R-42140 The xNF **MUST** respond to data requests from ONAP as soon
1810   as those requests are received, as a synchronous response.
1811 * R-34660 The xNF **MUST** use the RESTCONF/NETCONF framework used by
1812   the ONAP configuration subsystem for synchronous communication.
1813 * R-86586 The xNF **MUST** use the YANG configuration models and RESTCONF
1814   [RFC8040] (https://tools.ietf.org/html/rfc8040).
1815 * R-11240 The xNF **MUST** respond with content encoded in JSON, as
1816   described in the RESTCONF specification. This way the encoding of a
1817   synchronous communication will be consistent with Avro.
1818 * R-70266 The xNF **MUST** respond to an ONAP request to deliver the
1819   current data for any of the record types defined in
1820   `Event Records - Data Structure Description`_ by returning the requested
1821   record, populated with the current field values. (Currently the defined
1822   record types include fault fields, mobile flow fields, measurements for
1823   xNF scaling fields, and syslog fields. Other record types will be added
1824   in the future as they become standardized and are made available.)
1825 * R-46290 The xNF **MUST** respond to an ONAP request to deliver granular
1826   data on device or subsystem status or performance, referencing the YANG
1827   configuration model for the xNF by returning the requested data elements.
1828 * R-43327 The xNF **SHOULD** use `Modeling JSON text with YANG
1829   <https://tools.ietf.org/html/rfc7951>`_, If YANG models need to be
1830   translated to and from JSON{RFC7951]. YANG configuration and content can
1831   be represented via JSON, consistent with Avro, as described in “Encoding
1832   and Serialization” section.
1833
1834 Security
1835 ~~~~~~~~~~
1836
1837 * R-42366 The xNF **MUST** support secure connections and transports such as
1838   Transport Layer Security (TLS) protocol
1839   [`RFC5246 <https://tools.ietf.org/html/rfc5246>`_] and should adhere to
1840   the best current practices outlined in
1841   `RFC7525 <https://tools.ietf.org/html/rfc7525>`_.
1842 * R-44290 The xNF **MUST** control access to ONAP and to xNFs, and creation
1843   of connections, through secure credentials, log-on and exchange mechanisms.
1844 * R-47597 The xNF **MUST** carry data in motion only over secure connections.
1845 * R-68165 The xNF **MUST** encrypt any content containing Sensitive Personal
1846   Information (SPI) or certain proprietary data, in addition to applying the
1847   regular procedures for securing access and delivery.
1848
1849
1850 .. [1]
1851    https://github.com/mbj4668/pyang
1852
1853 .. [2]
1854    Recall that the Node Object **is required** to be identical across
1855    all VMs of a VNF invoked as part of the action except for the “name”.
1856
1857 .. [3]
1858    Upstream elements must provide the appropriate FQDN in the request to
1859    ONAP for the desired action.
1860
1861 .. [4]
1862    Multiple ONAP actions may map to one playbook.
1863
1864 .. [5]
1865    This option is not currently supported in ONAP and it is currently
1866    under consideration.
1867
1868 .. [6]
1869    https://wiki.opnfv.org/display/PROJ/VNF+Event+Stream
1870
1871 .. |image0| image:: Data_Model_For_Event_Records.png
1872       :width: 7in
1873       :height: 8in
1874
1875
1876 .. |image1| image:: VES_JSON_Driven_Model.png
1877       :width: 5in
1878       :height: 3in
1879
1880 .. |image2| image:: YANG_Driven_Model.png
1881       :width: 5in
1882       :height: 3in
1883
1884 .. |image3| image:: Protocol_Buffers_Driven_Model.png
1885       :width: 4.74in
1886       :height: 3.3in
1887