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