blob: ff330bb2f0ae122dd0905eaf489e7380a4953d7d [file] [log] [blame]
Haibin Huanged9fad82019-11-07 15:16:10 +08001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright (c) 2017-2018 VMware, Inc.
4
5==================================
6MultiCloud HPA Discovery Pluggable
7==================================
8
9To better support more HPA capabilities without modifying the implementation code
10for Multicloud. So we need to extract the HPA discovery part of the code and make
11it into many drivers(HPA Discovery Driver). if we want to add new HPA feature or
12modify the implementation code for the existing feature, we just need to modify
13HPA Discovery Driver code.
14
15Problem Description
16===================
17
18Currently, every time we add or modify an HPA feature, we need to modify the part
19of HPA discovery code, which will affect the other HPA features. It is difficult
20for device vendors to participate because they need to understand the entire ONAP
21process.
22In fact, we should design it so that it only requires the vendor to focus on both
23discovery and use.
24
25
26Propose Change
27==============
28
29Extract the original part of HPA discovery code and make it into many drivers. we
30need to add hooks in Openstack, Kubernetes and other plugins. then we develop
31drivers for various language. we will get below benefit:
32
33#. Each driver development is independent, and modifying the driver and adding
34the driver does not have any impact on each other.
35#. It is easier for vendors to participate in the development of ONAP. They no
36longer need to understand the whole working principle of ONAP, but only need to
37understand the interface of the driver.
38#. Any driver problem will not affect the HPA discovery process.
39#. The publishing difficulty of openstack package is reduced. Even if the latest
40driver has a little problem. We just need to point to the stable driver version
41of the pip package in the dockerfile.
42
43We plan to develop drivers in python language(in R6 release) and drivers in golang
44language(in R7 release).
45
46Add New Driver
47-------------------------------
48The hardware vendor determines whether upstream drivers. If vendor upstream driver,
49then submitted the driver code to multicloud/openstack repo. then He/She will also
50need package the driver and push to pip repo for distribution. In case that vendor
51doesn't upstream the driver, he/she could maintain the driver in local repo as well.
52
53 # Dockerfile(Example)
54
55 from multi-windriver:1.4.0
56
57 pip install <hpa-discovery-driver1(device vendor1)>
58
59 pip install <add hpa-discovery-driver2(device vendor2)>
60
61Driver Version Control
62----------------------
63
64We will make HPA discovery drivers as pip packages to release pip REPO. name like:
65
66onap-device-driver-<drivername>-<version>
67
68when we release the plugin, we will add the driver of pip package to the docker.
69
70Driver code Management
71----------------------
72For python language driver, we put it into multi-cloud openstack plugin.
73
74For golang language driver, we put it into multi-cloud kubernetes plugin.
75
76Security
77--------
78we solve one flavor each time, the result maximin is 1500 bytes. We will verify the
79validity of the data?
80
81CRUD
82----
83Driver don't write AAI, plugin will write AAI. driver just format data.
84
85Create
86^^^^^^
87Fill discover HPA data, transform data, format data in the driver, and then return
88the data, call AAI.
89
90Delete
91^^^^^^
92Driver don't write AAI and just return resource URL accord to flavor information.
93
94Update
95^^^^^^
96update flow is same as create flow.
97
98please see https://git.onap.org/multicloud/openstack/tree/share/common/msapi/helper.py L142
99
100Consume
101-------
102OOF can parse the AAI data, the driver just need to follow AAI schema. OOF output is
103oof_directives which is defined in https://git.onap.org/multicloud/framework/tree/docs/specs/multicloud_infra_workload.rst.
104
105check VIM capacity will store in driver. driver will get information from "Collectd". This will be completed in next release.
106
107FCAPS
108-----
109Driver with some issue: alarm(pool or other mode).
110if driver have some issues, the hpa capabilities will be empty.
111
112Usage
113=====
114Local use
115---------
116
117To integrate with multicloud openstack plugin, run below command
118
119 $ python setup.py build
120
121 $ python setup.py install
122
123based on pip package
124--------------------
125
126To integrate with multicloud openstack plugin, run below command in create docker image
127
128 $ pip install <package-name>
129
130Tests
131=====
132
133#. Unit Tests with tox.
134#. Integration test will use SRIOV-NIC as example.
135
136Reference
137=========
138https://wiki.onap.org/display/DW/Multicloud+HPA+Discovery+Pluggable