fix doc config files
[so.git] / docs / developer_info / ETSI_VNF_LCM_Setup_Guide.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 2021 Ericsson Software Technologies
4
5 SO ETSI VNF LCM Setup & Functionality
6 =================================================
7
8 Introduction
9 ------------
10
11 This guide will describe the steps required to execute the ETSI “Instantiate VNF” and “Terminate VNF” workflows using ONAP. The initial requirements you need for this guide are as follows:
12
13 - A stable ONAP Deployment
14 - ESR component enabled in ONAP installation.
15 - SO-ETSI-SOL003-Adapter component enabled ONAP in installation.
16 - A VNFM that is aligned to the Sol003 Interface (https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.03.01_60/gs_NFV-SOL003v020301p.pdf)
17 - A Sol004 Aligned VNF package (https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/004/02.03.01_60/gs_nfv-sol004v020301p.pdf)
18
19
20 Initial Configurations
21 ----------------------
22
23 The following configurations need to be completed in order to execute the ETSI workflows and instantiate through the SO-ETSI-SOL003-Adapter.
24
25 **Log into the MariaDB Database**
26
27 Find your Mariadb pod:
28
29 .. code-block:: bash
30
31     kubectl -n onap get pods | grep maria
32
33 Exec into a Mariadb-Galera pod (replace <PODNAME> with the Mariadb pod name):
34
35 .. code-block:: bash
36
37     kubectl -n onap -it exec <PODNAME> bash
38
39 Log into the SQL database and connect to the "catalogdb" database. Follow the next steps in order to configure your ONAP's Mariadb database.
40
41 **Enable the ETSI “Instantiate/Create” & “Terminate/Delete” building blocks.**
42
43 Firstly, you will need to add the ETSI Create & Delete building blocks, this is done by inserting them into the “building_block_detail” table in the Mariadb’s “catalogdb” database.
44
45 **Insert the ETSI Create Building Block:**
46
47 .. code-block:: bash
48
49     insert into building_block_detail(building_block_name, resource_type, target_action) values (“EtsiVnfInstantiateBB”, “VNF”, “ACTIVATE”);
50
51 **Insert ETSI Delete Building Block:**
52
53 .. code-block:: bash
54
55     insert into building_block_detail(building_block_name, resource_type, target_action) values (“EtsiVnfDeleteBB”, “VNF”, “DEACTIVATE”);
56
57 **View the “building_block_detail” table:**
58
59 .. code-block:: bash
60
61     select * from building_block_detail;
62
63 You should now have the entries in your “building_block_detail” table.
64
65
66
67 Update the orchestration_flow_reference table
68 ---------------------------------------------
69
70 Note: Standard VNF instantiation is unlikely to work once this step has been completed.
71
72 The next step is to set which building blocks are triggered on a VNF instantiate request. We will also be setting the correct sequence for these building blocks.
73
74 **View the VNF Create/Delete sequences from the “orchestration_flow_reference” table:**
75
76 .. code-block:: bash
77
78     select * from orchestration_flow_reference where COMPOSITE_ACTION="VNF-Create";
79     select * from orchestration_flow_reference where COMPOSITE_ACTION="VNF-Delete";
80
81 **Remove/Update current entries for “VNF-Create” & “VNF-Delete”:**
82
83 Retrieve “ID” from “northbound_request_ref_lookup” table. Take note of the “ID” value for “VNF-Create” and “VNF-Delete”:
84
85 .. code-block:: bash
86
87     select * from northbound_request_ref_lookup where REQUEST_SCOPE='Vnf' and IS_ALACARTE is true;
88
89 Remove current VNF-Insert and insert ETSI VNF-Create, replace <ID> with the corresponding value retrieved from the “northbound_request_ref_lookup” table:
90
91 .. code-block:: bash
92
93     delete from orchestration_flow_reference where COMPOSITE_ACTION = "VNF-Create";
94     insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Create",1,"AssignVnfBB",1,<ID>);
95     insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Create",2,"EtsiVnfInstantiateBB",1,<ID>);
96     insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Create",3,"ActivateVnfBB",1,<ID>);
97
98 Remove current VNF-Delete and insert ETSI VNF-Delete, replace <ID> with the corresponding value retrieved from the “northbound_request_ref_lookup” table:
99
100 .. code-block:: bash
101
102     delete from orchestration_flow_reference where COMPOSITE_ACTION = "VNF-Delete";
103     insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Delete",1,"EtsiVnfDeleteBB",1,<ID>);
104     insert into orchestration_flow_reference (COMPOSITE_ACTION,SEQ_NO,FLOW_NAME,FLOW_VERSION,NB_REQ_REF_LOOKUP_ID ) values ("VNF-Delete",2,"UnassignVnfBB",1,<ID>);
105
106
107 You have now enabled the ETSI building blocks and configured the sequence of building blocks to execute.
108
109 **Update the “orchestration_status_state_transition_directive” table**
110
111 The last step that needs to take in the MariaDB, is to update the state transition table, in order to allow our ETSI Create building blocks to correctly change the operation status of a VNF. If the operation status is not allowed to change correctly, then our ETSI building block will be skipped and will not be executed.
112
113 View the current “orchestration_status_state_transition_directive” setup.
114
115 .. code-block:: bash
116
117     select * from orchestration_status_state_transition_directive where RESOURCE_TYPE='VNF' and ORCHESTRATION_STATUS='Created';
118
119 Update the row that decides when a “VNF” with an orchestration status of “CREATED” has a target action of “ACTIVATE” to “CONTINUE” instead of “FAIL” using the following command:
120
121 .. code-block:: bash
122
123     update orchestration_status_state_transition_directive set FLOW_DIRECTIVE='CONTINUE' where RESOURCE_TYPE='VNF' and ORCHESTRATION_STATUS='CREATED' and TARGET_ACTION='ACTIVATE' and FLOW_DIRECTIVE='FAIL';
124
125 The transition directive is now set up correctly, allowing all of your ETSI building blocks to be executed correctly.
126
127
128 Adding your VNFM to ONAP ESR
129 ----------------------------
130
131 Now you will need to send a curl command to A&AI, in order to add the VNFM to ESR/A&AI.
132
133 Please ensure you have ESR added to your ONAP installation before attempting this step. Next, you will need to populate the ESR VNFM List with information relating to the VNFM that you want to instantiate your VNFs through.
134
135 **Adding your VNFM to ONAP ESR using CURL:**
136
137 In order to use the curl command method, you will need to log into an ONAP pod, that is within your ONAP network. (This prevents us needing to go and get the AAI service IP and external port.)
138
139 You can log into one of your pods with the following command (this example will use the BPMN-INFRA pod):
140
141 .. code-block:: bash
142
143     kubectl -n onap get pods | grep bpmn
144
145 Then take the full pod name and put it into this command instead of <PODNAME>:
146
147 .. code-block:: bash
148
149     kubectl -n onap exec -it <PODNAME> sh
150
151 Once Exec'ed into the pod you can run the following command which creates a VNFM, in ESR, with ID “ExampleVnfm”. (Edit this curl command to your needs before using it)
152
153 .. code-block:: bash
154
155     curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/esr-vnfm/ExampleVnfm -d '{"vnfmId": "ExampleVnfm", "name": "ExampleVnfmName", "type": "ExampleVnfmType", "vendor": "est"}'
156
157 One important thing to note in this curl command is the type: "ExampleVnfmType". This will be used in a later step for specifying which VNFM you want to instantiate through, take note of this.
158
159 Once you have entered the previous information you need to add the “service-url” to your “esr-system-info” section of this VNFM you just added. Please note, that the “service-url” in the following curl command was designed to work with the “so-vnfm-simulator”, you will need to change this to match your specific VNFM’s “service-url”.
160
161 You will need to put this data into the "external-system" and "cloud-infrastructure" API paths listed below. This is done with the following curl commands:
162
163 **AAI Cloud-Infrastructure**
164
165 .. code-block:: bash
166
167     curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/<CLOUD_OWNER>/<CLOUD_REGION_ID>/esr-system-info-list/esr-system-info/ExampleVnfm -d '{"name": "ExampleVnfm", "system-type": "ExampleVnfmType", "vimId": "myCloud", "vendor": "EST", "version": "V1.0", "certificateUrl": "", "url": "http://so-vnfm-simulator.onap:9095/vnflcm/v1/", "user-name": "testUser", "password": ""}'
168
169 Please note you will need to replace <CLOUD_OWNER> and <CLOUD_REGION_ID> with their respective values in your ONAP deployment.
170
171 **AAI External-System**
172
173 .. code-block:: bash
174
175     curl -X PUT -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/esr-vnfm/ExampleVnfm/esr-system-info-list/esr-system-info/ExampleEsrSystemInfo -d '{"esr-system-info-id": "ExampleEsrSystemInfo", "type": "ExampleVnfmType", "user-name": "user", "password": "password", "system-type": "VNFM", "service-url": "http://so-vnfm-simulator.onap:9095/vnflcm/v1"}'
176
177 You have now entered your VNFM into the ESR/AAI components.
178
179 Here are the equivalent GET commands for checking what is currently in your ESR/AAI list (change the IDs to match the IDs you used earlier):
180
181 .. code-block:: bash
182
183     curl -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/
184
185 .. code-block:: bash
186
187     curl -H 'Accept: application/json' -H 'Authorization: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==' -H 'Content-Type: application/json' -H 'X-FromAppId:12' -H 'X-TransactionId: 12' https://aai.onap:8443/aai/v15/external-system/esr-vnfm-list/esr-vnfm/ExampleVnfmId/esr-system-info-list/esr-system-info
188
189
190 Upload VNF Image to VNFM
191 ------------------------
192
193 Currently, there is no implementation of the package management interface in the SO-ETSI-SOL003-Adapter, this means that the VNF image needs to be onboarded to your VNFM before instantiation. The VNF image will then be selected by using the VNF descriptor, found in one of the artifacts within the SDC onboarding package, mentioned later in this guide ("descriptor.yaml").
194
195 This is an important step, which unfortunately can be drastically different depending on the specific vendor's VNFM.
196
197
198 Onboarding a Virtual Software Product (VSP) with an ETSI HEAT Template.
199 -----------------------------------------------------------------------
200
201 Onboard a VNF package along with a Network Service CSAR into SDC.
202 A video demonstration of this process "Onboarding ETSI Based NS" can be found under SO NFVO NS Onboarding and LCM Demonstrations
203 It is recommended that you view this video before/alongside this section of the guide.
204
205 **Step 1:**
206
207 Login to the ONAP Portal. (Link: https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm (where "portal.api.simpledemo.onap.org" is set as the IP of your VM/host of your Portal component.)
208
209 Login: cs0008
210 Password: demo123456!
211
212 **Step 2:**
213
214 Select the SDC App. It is possible that your browser will block the scripts run by the Portal, you will need to enable them if it does.
215
216 **Step 3:**
217
218 Onboarding your VNF:
219 1: Click the “ONBOARD” tab near the top of the window.
220 2: Create a “VLM” if you have not created a "VLM" before.
221
222 - From the “ONBOARD” page, click create VLM.
223 - Enter name and description, then select create.
224 - Click on the plus button beside Entitlement Pool.
225 - Add Name and Manufacturing Reference Number, then click save.
226 - Click on the plus button beside License Key Groups.
227 - Add Name and select type, then click save.
228 - Click on the plus button beside Feature Groups.
229 - In the general tab, add name, Description and Part Number. Move to the Entitlements Pools tab, select the entitlement pool you just created and click the rightward arrow. Move to the License Key Group tab, select the license key group you just created and click the rightward arrow. Once these three things are done, click save.
230 - Click on the plus button beside License Agreement.
231 - Add Name and select License Term. Next move to the Feature Groups tab, select the Feature Group you just created and click the rightward arrow. Lastly click save.
232 - On the overview page, select submit in the top right corner of the screen.
233 - Enter a commit comment and click Commit & Submit.
234
235 3: Create a Virtual Service Product (VSP)
236
237 - Click the “ONBOARD” tab near the top of the window.
238 - Click “CREATE NEW VSP” and fill in the required information. Make sure to select “Network Package” for the “ONBOARDING PROCEDURE” section. Then click “CREATE”.
239 - Click where it shows “! Missing” underneath “License Agreement”. Simply select a “Licensing Version” and “License Agreement/Feature Group” from the drop downs.
240 - Click the “Overview” tab on the left hand side. Then press “Select File” in the “SOFTWARE PRODUCT ATTACHMENTS” section and select your prepared VNF Package. If you are onboarding a supported zip, then click “PROCEED TO VALIDATION” once you can see your added files. You can safely ignore any warnings that come up at this step, but not any errors. (Note: The package validation does not support CSARs currently, they will still work however, providing they meet SDC requirements.)
241 - Now click “Submit”.
242
243 4: Then click “ONBOARD” in the top left. Hover your mouse over the small grey triangle that is just to the right of the “ONBOARD” tab and select “HOME”.
244
245 5: Hover over the “IMPORT” square and select “Import VSP”. Find your VSP, click the drop-down arrow beside it and then press the “Import VSP” icon at the far right of the line that drops down.
246
247 6: You will now be brought to the draft page of your VF. You can now Certify your VF, by clicking "Certify" in the top-right of the VF Page.
248
249 Creating/Configuring your SDC Service:
250 --------------------------------------
251
252 **Step 1:**
253
254 In the “HOME” tab of the SDC ONAP Portal, hover over the “ADD” square and select “ADD SERVICE”. Fill in the required fields, select the "Category" "Network Service" and press “Create” in the top right-hand corner.
255
256 **Step 2:**
257
258 You will be brought to the draft page of your Service. Go to the “Composition” tab on the left-hand side and drag/drop the VF, that you just created, into this service (you can search for the VF by name in the top left).
259
260 **Step 3:**
261
262 Now you will need to add the Network Service CSAR package to this service. You can do this by clicking in the blank whitespace of the composition, then on the right hand side of the page select the 2nd tab in order to add a deployment artifact. Click "ADD ARTIFACT" here, give an "Artifact Label" of "ns", any description value and ensure you choose a "Type" of "OTHER". Then click "DONE".
263
264 **Step 4:**
265
266 Finally you can click "Certify" in the top right hand corner, followed by "Distribute". Your Service will now distributed across ONAP.
267
268 Preloading SDNC (Optional)
269 --------------------------
270
271 This next step is optional, and is only required if a user needs to add "addiional-params" or "virtual-link" information. You will need to preload SDNC with the required attributes for your VNF. You will need to access the SDNC OpenDaylight RestConf API Documentation in order to add these attributes.
272
273 You will then be required to sign in once you access this site, the credentials are as follows, but may change in the future:
274
275 Username:     admin
276
277 Password:      Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
278
279 Next click on VNF-API.
280
281 Then use the following endpoint to post the preload JSON, found below.
282
283 Endpoint: restconf/operations/VNF-API:vnf-topology-operation
284
285 The following section of code is an example of the JSON that needs to be uploaded to the SDNC OpenDaylight RestConf API Documentation site.
286
287 Please note that you will need to set the attributes "generic-vnf-name" and "vnf-name" to the exact name that you will use when instantiating the VNF through VID. The attributes "generic-vnf-type" and "vnf-type" need to have the exact same name as the VSP that you imported to SDC, to create the VF.
288
289 **Preload for SDNC:**
290
291 .. code-block:: json
292
293     {
294         "input": {
295             "request-information": {
296                 "notification-url": "openecomp.org",
297                 "order-number": "1",
298                 "order-version": "1",
299                 "request-action": "PreloadVNFRequest",
300                 "request-id": "robot21"
301             },
302             "sdnc-request-header": {
303                 "svc-action": "reserve",
304                 "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
305                 "svc-request-id": "robot21"
306             },
307             "vnf-topology-information": {
308                 "vnf-assignments": {
309                     "availability-zones": [],
310                     "vnf-networks": [],
311                     "vnf-vms": []
312                 },
313                 "vnf-parameters": [{
314                     "vnf-parameter-name": "additionalParams",
315                     "vnf-parameter-value": "{\"key_1\": \"value_1\"}"
316                 }, {
317                     "vnf-parameter-name": "extVirtualLinks",
318                     "vnf-parameter-value": "{}"
319                 }],
320                 "vnf-topology-identifier": {
321                     "generic-vnf-name": "VnfInstantiateName",
322                     "generic-vnf-type": "VspPackageName",
323                     "service-type": "vCPE",
324                     "vnf-name": "VnfInstantiateName",
325                     "vnf-type": "VspPackageName"
326                 }
327             }
328         }
329     }
330
331
332 The datatype of "additionalParams" and "extVirtualLinks" can be found in the Sol003 Specifications.
333
334 The data must be JSON and contain only escaped strings. Here are examples of both:
335
336 **Example of additionalParameters parameter:**
337
338 .. code-block:: bash
339
340     {\"enableRollback\": \"false\"}
341
342
343 **Example of extVirtualLinks Parameter:**
344
345 .. code-block:: bash
346
347     [{\"id\":\"3b94d0be-6e37-4a01-920f-512e96803fc9\",\"tenant\":{\"cloudOwner\":\"CloudOwner\",\"regionName\":\"RegionOne\",\"tenantId\":\"f3d66580-7eff-4da5-8d27-91f984ad0c0b\"},\"resourceId\":\"e6e1a04d-c599-4b09-bc16-688834d0ac50\",\"extCps\":[{\"cpdId\":\"a83f86e0-7e9b-4514-9198-2d9eba91bd8e\",\"cpConfig\":[{\"cpInstanceId\":\"f966673d-fb96-41d4-8e5c-659f1c8c6bcc\",\"linkPortId\":null,\"cpProtocolData\":null}]}],\"extLinkPorts\":null}]
348
349
350 Using VID to send Instantiate Request
351 -------------------------------------
352
353 In order to access the VID (Virtual Infrastructure Deployment) component through the portal, you will need to login with the id “demo”. Once logged in to VID, first ensure that the GR-API is set. First we will need to instantiate the service, once this is done we can then instantiate the VNF. This will be when the ETSI Workflows are run.
354
355 **Deploy SDC Service**
356
357 You will need to select “Deploy an SDC Service” on the left-hand side of the GUI. You should see your distributed service in the list of services shown here. (Note: if you cannot see your services here then you will need to go back to SDC, to check the status of the distribution.)
358
359 - Press "Deploy" on the left-hand side of the service you have distributed.
360 - Fill out the required fields and press "Confirm".
361 - Wait for the Service to be instantiated.
362 - Press "Close" at bottom of pop-up window.
363
364 Now you should be brought to the "View/Edit Service Instance" page, focused on the service you just instantiated.
365
366 **Instantiate VNF:**
367
368 - Press "Add node instance" and select your VNF.
369 - Fill out the required fields and press "Confirm".
370 - Leave this VID page open, as this step can take quite some time, depending on a number of factors.
371 - Monitor the VNF instantiation through your VNFM GUI and back through the SO-ETSI-SOL003-Adapter logs and finally the BPMN logs.
372 - Upon success, your VNF should be instantiated correctly.
373
374
375 **Delete VNF:**
376
377 - Travel back to the service instance that you instantiated your VNF through.
378 - Simply select the red X on the right-hand side of the VNF instance.
379 - The VNF should begin terminating now, it may take quite some time, depending on a number of factors.
380 - Monitor the VNFM GUI and other logs until success.
381
382
383 Monitoring Logs (BPMN, SO-ETSI-SOL003-ADAPTER and VNFM)
384 -------------------------------------------------------
385
386 There are 3 stages of logs to monitor throughout the process of instantiating your service, and sending your request through the SO-ETSI-SOL003-Adapter, to your VNFM.
387
388 The initial service instantiation request will be recorded in the BPMN-INFRA pod’s logs. Logging into this pod will enable you to view them through the "debug.log" file.
389
390 The VNF instantiation request will appear first in the BPMN-INFRA pod’s logs, then once the ETSI Building Block is being executed you will see entries going through the SO-ETSI-SOL003-Adapter pod’s logs. Followed finally by the VNFM itself receiving a request from the SO-ETSI-SOL003-Adapter. This should all be recorded throughout the “debug.logs” on each of the mentioned pods.
391
392 The other areas to monitor would be your VNFM’s GUI (if applicable), your Openstack Tenant’s logs as well as it’s server list and the SO-Admin-Cockpit tool (in order to see the BPMN flow’s progress).
393
394 Example Zip VNF Package
395 -----------------------
396
397 Please follow the structure laid out below for creating your onboarding package.
398
399 **Structure:**
400
401 5 files (2 .yaml, 1 .meta, 1 .json, 1 .env)
402
403 - base.yaml
404 - descriptor.yaml
405 - base.env
406 - MANIFEST.json
407 - TOSCA.meta
408 - Compressed in a Zip folder.
409 - No directories. (Flat structure)
410
411 **Files:**
412
413 base.yaml - This file will be a very simple HEAT template, as it is just required in order to be able to instantiate the Service once its distributed.
414
415 descriptor.yaml - This file will contain the VNFD (Virtual Network Function Descriptor). It must be structured to match what the SO-ETSI-SOL003-Adapter searches for.
416
417 base.env - This file simply contains some environment variables for the base.yaml.
418
419 MANIFEST.json - This file lists all of the other files contained within it's package.
420
421 TOSCA.meta - This important file contains the path of the VNFD, which will be used by the SO-ETSI-SOL003-Adapter.
422
423
424 Please find example versions of the files below:
425
426 **base.yaml**
427
428 .. code-block:: bash
429
430     heat_template_version: 2013-05-23
431     description: Simple template to deploy a single compute instance
432
433     parameters:
434       simple_name_0:
435         type: string
436         label: Key Name
437         description: Name of key-pair to be used for compute instance
438       simple_key:
439         type: string
440         label: Key Name
441         description: Name of key-pair to be used for compute instance
442       simple_image_name:
443         type: string
444         label: Image ID
445         description: Image to be used for compute instance
446       simple_flavor_name:
447         type: string
448         label: Instance Type
449         description: Type of instance (flavor) to be used
450       vnf_id:
451         type: string
452         label: VNF ID
453         description: The VNF ID is provided by ONAP
454       vf_module_id:
455         type: string
456         label: vFirewall module ID
457         description: The vFirewall Module ID is provided by ONAP
458       simple_netid:
459         type: string
460         label: Netid
461         description: netid
462       public_net_id:
463         type: string
464         label: Netid
465         description: public NetId
466       ves_ip:
467         type: string
468         label: Netid
469         description: public ves_ip
470       node_ip:
471         type: string
472         label: Netid
473         description: public ves_ip
474
475     resources:
476
477       simple_0_private_port:
478         type: OS::Neutron::Port
479         properties:
480           network: { get_param: simple_netid }
481           fixed_ips:
482           - ip_address: { get_param: node_ip }
483
484       simple_0:
485         type: OS::Nova::Server
486         properties:
487           availability_zone: nova
488           key_name: { get_param: simple_key }
489           image: { get_param: simple_image_name }
490           flavor: { get_param: simple_flavor_name }
491           name: { get_param: simple_name_0 }
492           metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
493           networks:
494           - port: { get_resource: simple_0_private_port }
495           user_data_format: RAW
496           user_data:
497             str_replace:
498               params:
499                 __ves_ip__: { get_param: ves_ip }
500                 __vnfId__: { get_param: vnf_id }
501
502               template: |
503                 #!/bin/bash
504
505                 echo "the value we got for vndID was : __vnfId__" >> /tmp/vnfid.log
506
507     outputs:
508       oam_management_v4_address:
509         description: The IP address of the oam_management_v4_address
510         value: { get_param: node_ip  }
511
512
513 **descriptor.yaml**
514
515 .. code-block:: bash
516
517     tosca_definitions_version: tosca_simple_yaml_1_1
518
519     imports:
520         - etsi_nfv_sol001_vnfd_0_10_0_type.yaml
521
522     node_types:
523         Wiki.Demo.VnfmImageId:
524             derived_from: tosca.nodes.nfv.VNF
525             properties:
526                 descriptor_id:
527                     type: string
528                     constraints: [ valid_values: [ VnfmImageId ] ]
529                     default: VnfmImageId
530
531
532 The "descriptor.yaml" is the most important file within the package, as it provides the ID/Name of the VNF package for the VNFM to use when instantiating. It must follow the structure above, or the SO-ETSI-SOL003-Adapter will not be able to locate the VNFD. 
533
534 Don't forget to replace "VnfmImageId" with the ID of your VNF package.
535
536 **base.env**
537
538 .. code-block:: bash
539
540     parameters:
541       simple_image_name: UBUNTU16
542       simple_flavor_name: m1.small
543       simple_name_0: SIMPLEUBU
544       simple_key: demo-key
545       vnf_id: VESMED
546       vf_module_id: vfModuleId
547       simple_netid:  onap_vip
548       public_net_id: nova_floating
549       ves_ip: 172.55.10.10
550       node_ip: 172.55.10.10
551
552
553 **MANIFEST.json**
554
555 .. code-block:: json
556
557     {
558         "name": "MMEPackage",
559         "description": "Test",
560         "version": "0.0",
561         "data": [{
562             "isBase": true,
563             "file": "base.yaml",
564             "type": "HEAT",
565             "data": [{
566                 "file": "base.env",
567                 "type": "HEAT_ENV"
568             }]
569         },
570         {
571             "file": "descriptor.yaml",
572             "type": "OTHER"
573         },
574         {
575             "file": "TOSCA.meta",
576             "type": "OTHER"
577         }]
578     }
579
580
581 **TOSCA.meta**
582
583 .. code-block:: bash
584
585     TOSCA-Meta-File-Version: 1.0
586     CSAR-Version: 1.1
587     Created-by: Demo
588     Entry-Definitions: Artifacts/Deployment/OTHER/descriptor.yaml
589
590
591 The MANIFEST.json and TOSCA.meta are extremely important, if either are incorrectly formatted it will either fail to onboard or fail to distribute when you get to that step.
592
593 Ensure that the file names all match and your indentation/quotes are all correct, as it will save you a lot of time.
594
595