Merge "Fix NS scale serializers error"
[vfc/nfvo/lcm.git] / docs / platform / installation.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 VF-C Installation and Explaination
5 -----------------------------------
6 Describe the environment and steps to install VF-C components.
7
8 VF-C supports  vCPE use case in R3,  all VNFs are deployed through VF-C GVNFM .
9 This page describes how to use VF-C to instantiate NS
10
11
12 |image0|
13
14 .. |image0| image:: casrImage.png
15    :width: 1000px
16    :height: 600px
17
18
19 Environment
20 +++++++++++
21 VF-C components can run as docker, docker service should be installed before install VF-C components.
22
23 The following scripts show the docker service install commands in centos7.
24
25 ::
26
27   yum install docker
28   systemctl enable docker.service
29   systemctl start docker.service
30
31 Steps
32 +++++
33
34
35
36 If you want to  try VF-C,  the small project set should include: VF-C , Multicloud, MSB, A&AI.
37
38 VF-C components need to register to MSB when starting, so MSB components should be installed first,you can refer the following link to install MSB.
39
40 http://onap.readthedocs.io/en/latest/submodules/msb/apigateway.git/docs/platform/installation.html
41
42 Note: In the following steps, we use ${MSB_IP} as the IP of msb_apigateway component.
43
44 1. Install vfc-nfvo-db component
45
46 ::
47
48   docker run -d -p 3306:3306 -p 6379:6379 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db
49   we use  ${VFC_DB_IP} as the IP of vfc-db component.
50
51 2. Install vfc-nfvo-lcm component.
52
53 ::
54
55   docker run -d -p 8403:8403 --name vfc-nslcm -e MSB_ADDR=${MSB_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306
56   nexus3.onap.org:10001/onap/vfc/nslcm
57
58 3. Install vfc-nfvo-catalog component.
59
60 ::
61
62   docker run -d -p 8806:8806 --name vfc-catalog -e MSB_ADDR=${MSB_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/catalog
63
64 4. Install vfc-nfvo-gvnfmdriver component.
65
66 ::
67
68   docker run -d -p 8484:8484 --name vfc-gvnfmdriver -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/gvnfmdriver
69
70 5. Install vfc-gvnfm-vnflcm component.
71
72 ::
73
74   docker run -d -p 8801:8801 --name vfc-vnflcm -e MSB_ADDR=${MSB_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnflcm
75
76
77 ESR Registration
78 ++++++++++++++++
79
80
81 Before we instantiate a service, we need to register vim and vnfm which is used to deploy vnfs.
82   1.VIM Registration
83
84   |image1|
85
86   .. |image1| image:: vim.png
87    :width: 1000px
88    :height: 600px
89
90
91   2. GVNFM Registration
92
93   For VF-C, because we use GVNFM to deploy vnfs , so you can register GVNFM in esr gui as follows:
94
95   |image2|
96
97   .. |image2| image:: gvnfm.png
98    :width: 1000px
99    :height: 600px
100
101
102 Note: type should be gvnfmdriver which is the same with gvnfmdriver microservice
103 url is the msb-iag NodeIp:port 
104 vim corresponds to cloudowner_cloudregionid which registered in step1
105
106 Package Onboarding
107 ++++++++++++++++++
108
109
110 VF-C R3 support VNF/PNF/NS csar package upload from local csar file. VNF/PNF csar package should be uploaded first, then NS csar package can be uploaded.
111 Before onboarding a package,  should create one record first. 
112
113
114 1. Create VNF package record  in catalog DB
115
116 ::
117
118   curl -X POST \
119
120   http://172.30.3.104:30280/api/vnfpkgm/v1/vnf_packages \
121
122   -H 'Postman-Token: f9c45dea-b7bb-4acd-89e1-b9b1c3d70d8a' \
123   -H 'accept: application/json' \
124   -H 'cache-control: no-cache' \
125   -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
126   -F 'userDefinedData= "key2": "value2"'
127
128 Note:  
129   a. 172.30.3.104:30280 is the node IP and exposed port where the msb-iag pod is located. 
130   b. userDefinedData is the key value pair which defined for the vnf package we created
131
132 2. Upload VNF package to VF-C catalog
133
134 ::
135
136   curl -X PUT \
137   http://172.30.3.104:30280/api/vnfpkgm/v1/vnf_packages/38037a12-a0d4-4aa4-ac50-cd6b05ce0b24/package_content \
138   -H 'Postman-Token: 88ada218-86fd-4cd7-a06e-cc462f5df651' \
139   -H 'cache-control: no-cache'
140   -H 'accept: application/json' \
141   -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
142   -F 'file=@C:\ONAP\Integration\R3\vCPE\vnf-vsn.csar'
143
144 Note:
145   a.  38037a12-a0d4-4aa4-ac50-cd6b05ce0b24  is the vnf_pkg_id which we get from the first step
146   b.  -F is used to specify the local vnf package file
147
148 3. Create NS package record in catalog DB
149
150 ::
151
152   curl -X POST \
153
154   http://172.30.3.104:30280/api/nsd/v1/ns_descriptors \
155   -H 'Postman-Token: 71b11910-1708-471c-84bb-5b0dd8d214a2' \
156   -H 'accept: application/json' \
157   -H 'cache-control: no-cache' \
158   -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
159   -F 'userDefinedData= "key1": "value1"'
160
161 Note:
162   a. userDefinedData is the key value pair which defined for the ns package we created
163
164 4. Upload NS package to VF-C catalog
165
166 ::
167
168   curl -X PUT \
169   http://172.30.3.104:30280/api/nsd/v1/ns_descriptors/79ca81ec-10e0-44e4-bc85-ba968f345711/nsd_content \
170   -H 'Postman-Token: f16e4a54-a514-4878-b307-9b80c630166e' \
171   -H 'cache-control: no-cache'
172   -H 'accept: application/json' \
173   -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
174   -F 'file=@C:\ONAP\Integration\R3\vCPE\ns.csar'
175
176 Note:
177   a.  -F is used to specify the local ns package file
178
179
180 NS Life Cycle Management
181 ++++++++++++++++++++++++
182
183
184 Currently VF-C GVNFM support NS create/Instantiate/terminate/delete/heal.
185
186 VF-C R3 healing only suport restart a vm of an VNF. 
187
188 1. NS Create 
189
190 ::
191
192   curl -X POST \
193   http://172.30.3.104:30280/api/nslcm/v1/ns \
194   -H 'Postman-Token: 27e2c576-2d9b-4753-a6b0-6262a4a7ec86' \
195   -H 'accept: application/json' \
196   -H 'cache-control: no-cache' \
197   -H 'content-type: application/json' \
198   -d '{
199        "context": {
200                 "globalCustomerId": "global-customer-id-test1",
201                 "serviceType": "service-type-test1"
202         },
203         "csarId": "79ca81ec-10e0-44e4-bc85-ba968f345711",
204         "nsName": "ns_vsn",
205         "description": "description"
206         }'
207
208 Note:
209   a.  globalCustomerId  and serviceType is defined in A&AI
210   b. csar Id is the NS package id  which is consistent with the catalog ns package id
211   c. nsName is the NS name 
212
213 2. NS Instantiate
214
215 ::
216
217    curl -X POST \
218   http://172.30.3.104:30280/api/nslcm/v1/ns/f0b4c09f-c653-438a-b091-5218b0f806ec/instantiate \
219   -H 'Postman-Token: 2a9542b2-3364-4a40-8513-45e10b8ca2ce' \
220   -H 'accept: application/json' \
221   -H 'cache-control: no-cache' \
222   -H 'content-type: application/json' \
223     -d '{
224          "additionalParamForNs": {
225                 "sdnControllerId": "2"
226          },
227          "locationConstraints": [{
228                 "vnfProfileId": "45711f40-3f43-415b-bb45-46e5c6940735",
229                 "locationConstraints": {
230                       "vimId": "CPE-DC_RegionOne"
231                 }
232                 }]
233          }'
234
235 Note
236   a.  f0b4c09f-c653-438a-b091-5218b0f806ec  is the ns instance id which create in step 1 : NS create
237   b.  locationConstraints  is an array which contains all the vnfs included under NS locationConstraints is used to define the VIM( cloudOwner_cloudRegionId)  that the VNF will be deployed vnfProfileId is the vnf descriptor id which defined in NS template  under  node_templates . 
238
239
240  |image3|
241
242   .. |image3| image:: image2018-12-10_12-1-36.png
243    :width: 5.97047in
244    :height: 2.63208in
245
246   c.   before instantiate, you should create one volumntype which called root.
247
248 3. NS Heal
249
250 ::
251
252   curl -X PUT \
253    http://172.30.3.104:30280/api/nslcm/v1/ns/f0b4c09f-c653-438a-b091-5218b0f806ec/heal \
254   -H 'Content-Type: application/json' \
255   -H 'Postman-Token: f18754b8-ed68-43b0-ae55-b8b8780e5c6a' \
256   -H 'accept: application/json' \
257   -H 'cache-control: no-cache' \
258   -d '{   "vnfInstanceId": "044b705c-e44d-4733-ab64-987f46d9b567", 
259                     "cause": "restartvm",  
260                     "additionalParams": {    
261                                                         "action": "restartvm",  
262                                                          "actionvminfo": {   
263                                                          "vmid": "1623cd25-ae6f-4880-8132-15914367e47b",
264                                                          "vduid": "",    
265                                                           "vmname": "1623cd25-ae6f-4880-8132-15914367e47b"  
266         }}  
267         }'
268
269 Note:
270   a.  f0b4c09f-c653-438a-b091-5218b0f806ec  is the ns instance id which create in step 1 : NS create
271   b.   "vnfInstanceId": "044b705c-e44d-4733-ab64-987f46d9b567" is the VNF instanceId, we can get this from A&AI or VF-C DB
272   c.  action only support restartvm  in Casablanca release
273   d.  actionvminfo only supports to include one vm , vmid is the vmid which is the same with the vmid in cloud. 
274
275 4. NS Terminate
276
277 ::
278
279   curl -X POST \
280   http://172.30.3.104:30280/api/nslcm/v1/ns/f0b4c09f-c653-438a-b091-5218b0f806ec/terminate \
281   -H 'Postman-Token: 5190e46f-f612-432a-90d8-161ea67778b2' \
282   -H 'accept: application/json' \
283   -H 'cache-control: no-cache' \
284   -H 'content-type: application/json' \
285   -d 'gracefulTerminationTimeout: 600,
286   \terminationType: FORCEFUL'
287
288 Note:
289   a.  f0b4c09f-c653-438a-b091-5218b0f806ec  is the ns instance id which create in step 1 : NS create
290   b.  terminateType supports FORCEFUL and GRACEFULLc.  gracefulTerminationTimeout is the wait time before execute terminate.
291
292 5. NS delete
293
294 ::
295
296   curl -X DELETE \
297   http://172.30.3.104:30280/api/nslcm/v1/ns/f0b4c09f-c653-438a-b091-5218b0f806ec \
298   -H 'Postman-Token: 62b35de6-1785-40ed-8026-06d73f9770d8' \
299   -H 'cache-control: no-cache'
300
301 Note:
302   a.  f0b4c09f-c653-438a-b091-5218b0f806ec  is the ns instance id which create in step 1 : NS create