Fix for Penetration test _ Session and cookie management
[vid.git] / docs / instantiate.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0
2    International License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. _instantiate:
5
6 Instantiate Service, VNF, VF modules and Network
7 ================================================
8
9
10 Overview
11 --------
12
13 Using VID with A-La-Carte method means that the user needs to performed
14 by himself the instantiation of each object: service, VNF(s), VF module(s),
15 network(s).
16
17 ONAP to VIM interactions will occurs when instantiating/deleting VF module(s)
18 or Network(s). In case of an Openstack VIM, Heat Stack(s) will
19 be created/deleted.
20
21 In the following description, the service model in SDC was composed of 1 VF
22 and 1 Virtual Link (Generic Neutron Network)
23
24 .. note::
25    For doing this make sure that while Service Design drag the created VF and Generic NetronNet Virtual Link (under Generic/Network Elemntes list) from the
26    Elements palette to the canvas then connect as mentoned in Create Service section of Service Design under Composition
27
28 To be able to instantiate VF-module or Network object, some data need to be
29 declared in ONAP SDNC using SDNC Rest API. It is the place where to put
30 the instance specific values such as an IP address value specific
31 to the VNF instance for example.
32
33 In VID, terminologies are sometimes different than in other components:
34
35 VNF in VID  = VF in SDC
36
37 Node instance = VF in SDC
38
39 Network = Virtual Link in SDC
40
41
42 Pre-requisites
43 --------------
44
45 Pre-instantiation operations must have been performed in AAI and VID,
46 via Rest API, to declare some values for:
47
48 - Subscriber Name (= customer in AAI)
49 - Service Type or product family (= service subscription in AAI)
50 - Project
51 - Owning Entity
52 - Line Of Business
53 - Platform
54 - LCP Region (= CloudOwner/RegionId in AAI)
55 - Tenant
56
57 See, in the ONAP User Guides, section about adding a CloudSite
58 and section about pre-instantiation Operations
59
60 .. note::
61    Robot demo script will be used to populate demo models automatically with Demonstration as Subscriber Name in VID by running "demo-k8s.sh onap init"
62
63 Access to VID portal
64 --------------------
65
66 .. figure:: images/onap-portal.png
67    :align: center
68
69 Select the VID icon
70
71 .. figure:: images/vid-icon-on-portal.png
72    :align: center
73
74
75 Here after, the VID Home page starts
76
77 .. figure:: images/home.png
78    :align: center
79
80
81 SDNC API selection
82 ------------------
83
84 Select the API for "A-la-carte"
85
86 There are two choices:
87
88 - VNF_API (old) : VID will use the (old) "VNF" SDNC API
89   to get/check some parameters
90 - GR_API (new) : VID will use the "Generic Resource"
91   SDNC API to get/check some parameters
92
93 .. figure:: images/API_selection.png
94    :align: center
95
96
97
98 Instantiate Service in "A-la-carte" mode
99 ----------------------------------------
100
101 Click Browse SDC Service Models and search for the service to instantiate.
102
103 The view show only service models in the DISTRIBUTED state.
104
105 .. figure:: images/browse-service-models.png
106    :align: center
107
108
109 Select a service and click Deploy.
110
111 A dialog box displays.
112
113 Complete the fields indicated by the red star and click Confirm.
114
115 .. figure:: images/create-service-instance-alacarte.png
116    :align: center
117
118 A status box appears that shows the ONAP SO instantiation progress
119 as well as any messages associated with the process.
120
121 .. figure:: images/create-service-instance-alacarte-success.png
122    :align: center
123
124 A Service object is created in ONAP.
125
126 Click Close and next screen should appear.
127 It will allow to declare VNF(s) and Network(s)
128 that are part of the service model composition.
129
130 .. figure:: images/create-service-instance-alacarte-VNF-network.png
131    :align: center
132
133
134 Instantiate a VNF
135 -----------------
136
137 From previous screen, it is possible to declare a VNF: click on
138 "Add node instance" and select the VNF you want to instantiate in the list
139
140 The  following screen should appear:
141
142 .. figure:: images/create-vnf-instance-alacarte.png
143    :align: center
144
145 Complete the fields indicated by the red star and click Confirm.
146
147 A VNF object will be declared in ONAP.
148
149 Once, ONAP SO process is finished, click on close button.
150
151 The following screen then should appear:
152
153
154 .. figure:: images/create-service-instance-alacarte-after-vnf-instantiated.png
155    :align: center
156
157
158 Warning: a this step, no VNF instance (e.g. VM) is created on the Cloud Platform.
159
160 Click on "i" blue button to obtain VNF instance display information.
161
162 From this screen, it will be possible to get:
163
164 - the service instance id value
165 - the VNF Type value
166
167 Those information will be necessary for the "SDNC preload" step
168 to instantiate the VF module
169
170 Close that screen
171
172
173 Instantiate VF Module
174 ---------------------
175
176 It is now possible to declare a VF Module: click on
177 "Add VF-Module" and select the VF-module you want to instantiate in the list
178
179 The  following screen should appear:
180
181 .. figure:: images/create-vfmodule-instance-alacarte.png
182    :align: center
183
184 From this screen, it will be possible to get:
185
186 - "Model Name" value
187
188 At this step, with this "A-La-Carte" method, it is necessary to declare
189 some information in ONAP SDNC.
190
191 SDNC needs to be aware about the VNF before trying to use ONAP SO
192 to instantiate the VF-module.
193
194 This group of data is usually called "SDNC preload" and will contain:
195
196 - vf-module instance Name
197 - vnf instance Name
198 - service instance id
199 - the list of vnf parameters with values, when not using the default values
200
201 .. note::
202    Get all the required vnf-parameters values as listed in HEAT package and populate all the key-values in an example SDNC preload curl command to run
203
204 Some of the vnf-parameters in SDNC preload are related to openstack.
205 Follow the below steps on openstack to get the values and update those values in SDNC preload template accordingly.
206
207 - download the image from cloud images (ubuntu-14.04 as per HEAT env) and create an image
208 - create the flavor with m1.medium (suggested as per HEAT env)
209 - create OAM_NETWORK ID  & OAM_SUBNET ID (use subnet range from base_vfw.env file)
210 - execute openstack security group rule to open all ports for onap
211
212 Here is an example of SDNC preload for VNF, using "curl" tool
213 to push those data using SDNC Rest API:
214
215 ::
216
217     curl -k -X POST \
218     https://sdnc.api.simpledemo.onap.org:30267/restconf/operations/VNF-API:preload-vnf-topology-operation \
219     -H 'Accept: application/json' \
220     -H 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \
221     -H 'Content-Type: application/json' \
222     -H 'X-FromAppId: API client' \
223     -H 'X-TransactionId: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
224     -H 'cache-control: no-cache' \
225     -d '{
226         "input": {
227             "request-information": {
228                 "notification-url": "onap.org",
229                 "order-number": "1",
230                 "order-version": "1",
231                 "request-action": "PreloadVNFRequest",
232                 "request-id": "test"
233             },
234             "sdnc-request-header": {
235                 "svc-action": "reserve",
236                 "svc-notification-url": "http:\/\/onap.org:8080\/adapters\/rest\/SDNCNotify",
237                 "svc-request-id": "test"
238             },
239             "vnf-topology-information": {
240                 "vnf-assignments": {
241                     "availability-zones": [],
242                     "vnf-networks": [],
243                     "vnf-vms": []
244                 },
245                 "vnf-parameters": [
246                     {
247                         "vnf-parameter-name": "oam_net_id",
248                         "vnf-parameter-value": "oam_network_tXWW"
249                     }
250                 ],
251                 "vnf-topology-identifier": {
252                     "generic-vnf-name": "my-vnf-instance-01",
253                     "generic-vnf-type": "Service-model-with-VNF-and-Virtual-Link/FreeRadius_VF 0",
254                     "service-type": "09f9ffad-1069-43fa-97e8-da7b9a439601",
255                     "vnf-name": "my_vf_module-instance-01",
256                     "vnf-type": "FreeradiusVf..base_freeRadius..module-0"
257                 }
258             }
259         }
260     }'
261
262
263 Data mapping between ONAP SDNC terminology and ONAP SO
264
265 - "generic-vnf-name" value must be equal to the VNF instance name value
266   (see VNF instance detail screen)
267 - "generic-vnf-type" value must be equal to VNF Type value
268   (see VNF instance detail screen)
269 - "service-type" value must be equal to the service instance id value
270   (see VNF instance detail screen)
271 - "vnf-name" value must be equal to the VF module instance name value
272 - "vnf-type" value must be equal to the "Model Name" value
273   (see create VF module screen)
274
275
276 If there is a need for an instance specific value
277 of a VNF parameter (for example : an OAM network id value,
278 specific to this VNF instance),
279 the "vnf-parameters" must be completed with a list of name/value.
280
281 Once the "SDNC preload" is completed, send it to SDNC using any Rest API Tool.
282
283 Then, continue on VID and complete the fields indicated by the red star
284 and click "Confirm".
285
286 Warning : be very careful to use exactly the same VF module instance name
287 on this screen and in the "SDNC preload"
288
289 Wait for success and close the popup screen.
290
291 The following screen should appear:
292
293 .. figure:: images/create-service-instance-alacarte-after-vfmodule-instantiated.png
294    :align: center
295
296 At that point, the VNF is now instantiated in the cloud platform.
297
298
299 Instantiate Network
300 -------------------
301
302 Instantiating a network is quite similar to vf-module instantiation
303 (there is also the need for a "SDNC preload")
304
305 Click on "Add Network" and select the Network you want
306 to instantiate in the list
307
308 The  following screen should appear:
309
310 .. figure:: images/create-network-instance-alacarte.png
311    :align: center
312
313
314 Prepare the "SDNC preload" with:
315
316 - "network-role": provide any value,
317 - "network-technology": use "neutron" as this example will instantiate
318   a network using openstack neutron application
319 - "service-type": value must be equal to "Service Name"
320   (=service model name) displayed on VID screen
321 - "network-name": value must be equal to the desired network instance name,
322 - "network-type": value must be equal to "Model Name""Generic NeutronNet"
323   displayed on VID screen
324
325 In addition:
326
327 - in "provider-network-information" section, it is possible to indicate
328   some network characteristics
329 - it is possible to add a section about "subnets"
330
331 Here after, an "SDNC preload" example that can be use for Network
332 instantiation.
333
334 ::
335
336     curl -k -X POST \
337     https://sdnc.api.simpledemo.onap.org:30267/restconf/operations/VNF-API:preload-network-topology-operation \
338     -H 'Accept: application/json' \
339     -H 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \
340     -H 'Content-Type: application/json' \
341     -H 'X-FromAppId: API client' \
342     -H 'X-TransactionId: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
343     -H 'cache-control: no-cache' \
344     -d '{
345     "input": {
346         "request-information": {
347         "request-id": "postman001",
348         "notification-url": "http://so.onap.org",
349         "order-number": "postman001",
350         "request-sub-action": "SUPP",
351         "request-action": "PreloadNetworkRequest",
352         "source": "postman",
353         "order-version": "1.0"
354         },
355         "network-topology-information": {
356         "network-policy": [],
357         "route-table-reference": [],
358         "vpn-bindings": [],
359         "network-topology-identifier": {
360             "network-role": "integration_test_net",
361             "network-technology": "neutron",
362             "service-type": "Service-model-with-VNF-and-Virtual-Link",
363             "network-name": "my-network-instance-001",
364             "network-type": "Generic NeutronNet"
365         },
366         "provider-network-information": {
367             "is-external-network": "false",
368             "is-provider-network": "false",
369             "is-shared-network": "false"
370         },
371         "subnets": [
372             {
373             "subnet-name": "my-sub_network-instance-001",
374             "subnet-role": "OAM",
375             "start-address": "192.168.90.0",
376             "cidr-mask": "24",
377             "ip-version": "4",
378             "dhcp-enabled": "Y",
379             "dhcp-start-address": "",
380             "dhcp-end-address": "",
381             "gateway-address": "192.168.90.1",
382             "host-routes":[]
383             }
384                 ]
385         },
386         "sdnc-request-header": {
387         "svc-action": "reserve",
388         "svc-notification-url": "http://so.onap.org",
389         "svc-request-id": "postman001"
390         }
391     }
392     }
393     '
394
395 Once the "SDNC preload" is completed, send it to SDNC using any Rest API Tool.
396
397 Then, continue on VID and complete the fields indicated by the red star
398 and click "Confirm".
399
400 Warning : be very careful to use exactly the same network instance name
401 on this screen and in the "SDNC preload"
402
403 Wait for success and close the popup screen.
404
405 The  following screen should appear:
406
407 .. figure:: images/create-network-instance-alacarte-after-instantiated.png
408    :align: center
409
410 At that point, the Network and subnets are now instantiated
411 in the cloud platform.
412
413 Also, all those network information are available in ONAP AAI,
414 under the terminology
415 "l3-network", with the "neutron-network-id" and the "neutron-subnet-id"
416 provided by
417 the openstack platform.
418
419
420 Deleting Network, VF module, VNF, Service
421 -----------------------------------------
422
423 To delete a service instance using VID, it is necessary to delete objects
424 in the following sequence:
425
426 - delete VF module(s)
427 - delete VNF instance(s)
428 - delete Network(s)
429 - delete service instance
430
431 To proceed those deletion, from VID Home screen
432
433 - search for existing service instance
434 - edit/view the service instance you want to delete
435 - click on red button with white cross and confirm for each object