Upload VNF package fails when softwareImage properties in VNFD template has fraction values

Bug #1879436 reported by Shubham Potale
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
High
Keiko Kuriu

Bug Description

There are two issues while Uploading of vnf package using [1],[2]

1. Uploading of VNF Package fails if 'sw_image_data' properties 'min_size', 'min_ram' and 'size' has fraction values.

Consider following snippet of VNFD for sw_image_data, 'min_disk' has value in fraction.

sw_image_data:
 name: VrtualStorage
 version: '0.4.0'
 checksum:
 algorithm: sha-256
 hash: b9c3036539fd7a5f87a1bf38eb05fdde8b556a1a7e664dbeda90ed3cd74b4f9d
 container_format: bare
 disk_format: qcow2
 min_disk: 1.5 GB
 min_ram: 8192 MB
 size: 2 GB

Please checkout link [3] for error log.

2. Units not stored in DB for 'min_size', 'min_ram' and 'size'

Consider following snippet of VNFD for sw_image_data, for 'min_size', 'min_ram' and 'size'

sw_image_data:
 name: VrtualStorage
 version: '0.4.0'
 checksum:
 algorithm: sha-256
 hash: b9c3036539fd7a5f87a1bf38eb05fdde8b556a1a7e664dbeda90ed3cd74b4f9d
 container_format: bare
 disk_format: qcow2
 min_disk: 2000 MB
 min_ram: 8192 MB
 size: 2000 MB

 'min_size', 'min_ram' and 'size' data saved in `tacker` DB table `vnf_software_images` does not contain the unit information.
 i.e. why it is hard to find whether the stored data is in TB/GB/MB etc.
 Please checkout the link [4] to see select query result of 'vnf_software_images' table.

Proposed solutions -
1. Convert min_ram/min_disk/size values to specific units and also mention it in the api documentation.
2. To store the fraction value we can change the DB datatype of `min_disk`, `min_ram` and `size` to `FLOAT`. But ETSI specs [5] 9.5.3.2 Type: VnfPackageSoftwareImageInfo defined `min_disk`, `min_ram` and `size` as UnsignedInt, so the solution may break the response type.

[1]/vnfpkgm/v1/vnf_packages/{vnf_package_id}/package_content
[2]/vnfpkgm/v1/vnf_packages/{vnf_package_id}/package_content/upload_from_uri
[3]http://paste.openstack.org/show/793763/
[4]http://paste.openstack.org/show/793755/
[5]https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/005/02.06.01_60/gs_NFV-SOL005v020601p.pdf

sample command:
openstack vnf package upload --path samples/vnf_packages/sample_vnf_pkg.zip f0a726c1-6d18-4e2a-8c3f-8001d0231ae0

Changed in tacker:
assignee: nobody → Shubham Potale (shubhamp)
description: updated
Tushar Patil (tpatil)
description: updated
nitin uikey (nitinuikey)
description: updated
summary: - The unit of min_ram, min_disk and size of vnf_software_images are not
- stored in tacker DB
+ Upload VNF package fails when softwareImage properties in VNFD template
+ has fraction values
nitin uikey (nitinuikey)
description: updated
nitin uikey (nitinuikey)
description: updated
Changed in tacker:
assignee: Shubham Potale (shubhamp) → nobody
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/731636

Changed in tacker:
assignee: nobody → Prashant Bhole (pbhole)
status: New → In Progress
Changed in tacker:
assignee: Prashant Bhole (pbhole) → Keiko Kuriu (keiko-k)
Changed in tacker:
assignee: Keiko Kuriu (keiko-k) → Cong Phuoc Hoang (hoangphuoc)
Changed in tacker:
assignee: Cong Phuoc Hoang (hoangphuoc) → Keiko Kuriu (keiko-k)
Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.opendev.org/731636
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=01cf3efd4c23d8f54744c3b08e2ddaec00686c63
Submitter: Zuul
Branch: master

commit 01cf3efd4c23d8f54744c3b08e2ddaec00686c63
Author: Shubham <email address hidden>
Date: Thu May 7 11:43:44 2020 +0530

    Convert software image properties to byte

    Convert softwareImage properties such as 'min_disk', 'min_ram' and
    'size' to bytes before storing it to 'vnf_software_images' db table.
    Since the size in bytes will be a large number, the type of
    'min_disk' and 'min_ram' columns of 'vnf_software_images' tables has
    been changed to BigInt.

    Closes-Bug: #1879436
    Co-Authored-By: Prashant Bhole <email address hidden>
    Change-Id: I3bf839783863f84f507d9b15c6eab6250d9f5d30

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 5.0.0.0rc1

This issue was fixed in the openstack/tacker 5.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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