Unable to store multiple deployment flavours of VNFD in DB

Bug #1881219 reported by nitin uikey
6
This bug affects 1 person
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_nfv_sol001_common_types.yaml
     etsi_nfv_sol001_vnfd_types.yaml
     helloworld3_df_complex.yaml
     helloworld3_df_simple.yaml
     helloworld3_top.vnfd.yaml
     helloworld3_types.yaml
  TOSCA-Metadata
      |
     TOSCA.meta

Steps to reproduce:

1) create a VNF package using : POST /vnfpkgm/v1/vnf_packages

2) Upload VNF package with multiple flavours (eg: simple, complex) csar file using :

   PUT /vnfpkgm/v1/vnf_packages/{vnf_package_id}/package_content
   Or
   POST /vnf_packages/{vnf_package_id}/package_content/upload_from_uri

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_flavours where package_uuid = '654a827d-fae7-4c95-8b0c-2471ba27511e';
+--------------------------------------+------------+
| package_uuid | flavour_id |
+--------------------------------------+------------+
| 654a827d-fae7-4c95-8b0c-2471ba27511e | simple |
+--------------------------------------+------------+
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_tosca_templates_with_topology but the tacker code is expecting two objects, one for simple VNFD definition and other for complex VNFD definition.

Revision history for this message
nitin uikey (nitinuikey) wrote :
description: updated
Tushar Patil (tpatil)
summary: - Unable to store mutliple flavours of VNFD in DB from CSAR file
+ Unable to store multiple deployment flavours of VNFD in DB
Revision history for this message
Tushar Patil (tpatil) wrote :

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.

Ayumu Ueha (ueha)
Changed in tacker:
assignee: nobody → Ayumu Ueha (ueha)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.opendev.org/734784

Revision history for this message
Ayumu Ueha (ueha) wrote :

I suggested to tosca-parser project that this issue is causeed by tosca-parser's bug and
should fixed by tosca-parser side.

I reported this issue to tosca-parser and push fixed code.

launchpad: https://bugs.launchpad.net/tosca-parser/+bug/1883220
gerrit: https://review.opendev.org/#/c/735311/

Wait for tosca-parser team's response,

Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tacker (master)

Change abandoned by Ayumu Ueha (<email address hidden>) on branch: master
Review: https://review.opendev.org/734784
Reason: Abandon this patch because of fixed patch
 merged to tosca-parser project.
https://review.opendev.org/#/c/735311/

Revision history for this message
Itsuro Oda (oda-g) wrote :

Fix Released.

Changed in tacker:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.