Unable to store multiple deployment flavours of VNFD in DB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tacker |
Fix Released
|
Medium
|
Ayumu Ueha |
Bug Description
Bug Description:
When user tries to upload CSAR file with multiple flavours (eg: simple, complex) of VNFD, it only stores one flavour detail in DB.
Following is the format of CSAR file.
csar
|
Definitions
|
etsi_
etsi_
helloworld
helloworld
helloworld
helloworld
TOSCA-Metadata
|
TOSCA.meta
Steps to reproduce:
1) create a VNF package using : POST /vnfpkgm/
2) Upload VNF package with multiple flavours (eg: simple, complex) csar file using :
PUT /vnfpkgm/
Or
POST /vnf_packages/
3) Verify the DB data.
It is expected to have two entries, one for simple flavour_id and another for complex flavour_id.
But it has only one entry for the simple flavour_id, it ignores the complex flavor data.
mysql > use tacker;
mysql> select package_uuid, flavour_id from vnf_deployment_
+------
| package_uuid | flavour_id |
+------
| 654a827d-
+------
1 rows in set (0.00 sec)
Please refer the attached csar file to reproduce the above issue.
Observation -
1) After parsing the CSAR file using toscaparser there is only one object for simple VNFD defintion in tosca.nested_
summary: |
- Unable to store mutliple flavours of VNFD in DB from CSAR file + Unable to store multiple deployment flavours of VNFD in DB |
Changed in tacker: | |
assignee: | nobody → Ayumu Ueha (ueha) |
status: | New → In Progress |
Changed in tacker: | |
importance: | Undecided → Medium |
Based on analysis of tacker and tosca-parser code, here is my observation:-
In tacker, the extraction of flavours from tosca is currently based on ``nested_ tosca_templates _with_topology` ` but it contains only one nested tosca template of ``simple`` flavor. The reason why tosca-parser adds only one nested tosca template is because of method ``_is_sub_ mapped_ node`` returns false as it finds sub_mapping_ tosca_template
is already set.
To solve this problem on tacker side, we can make use of ``nested_ tosca_tpls_ with_topology` ` instead of ``nested_ tosca_templates _with_topology` `. It contains information of both deployment flavours ``simple`` and ``complex`` but the data is in plain dictionary format so it will have a huge impact on refactoring ``_get_ flavour_ data`` method from tacker/ common/ csar_utils. py.