RFE: Introduce tacker-validate template validation for VNFD

Bug #1483953 reported by vishwanath jayaraman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Won't Fix
Low
Neeldhwaj Pathak

Bug Description

It would also be useful to add some "validate only" command in tacker. Validation is very useful when editing/creating complex template files, so users can validate the template without actually creating a VNFD... Command could look like this for example:

  tacker vnfd-template-validate --template-file <path-to-template>

This could be done similar as in heat template-validate command.

Tags: rfe
Revision history for this message
vishwanath jayaraman (vishwanathj) wrote :
Revision history for this message
Bob Haddleton (bob-haddleton) wrote :

The same issue exists for the command line vnfd-create command. There is no template validation performed until the template is deployed. This capability might need to wait until the heat-translator interface is implemented since the existing YAML decoder is pretty basic.

Changed in tacker:
importance: Undecided → Wishlist
Revision history for this message
Sridhar Ramaswamy (srics-r) wrote :
Download full text (5.1 KiB)

A similar error shows up with an non-well-formatted VNFD. For e.g. with a multi-line description attr without leading whitespace,

template_name: sample-vnfd
description: Parameterized VNF descriptor that supports
fixed IP addresses with IP address values passed using
the format show in vnf_cirros_param_values_ipaddr.yaml
file

service_properties:
  Id: sample-vnfd
  vendor: tacker
  version: 1

vdus:
...

We need simple error handling in,

2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/vm/drivers/heat/heat.py", line 87, in create_device_template_pre
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource vnfd_dict = yaml.load(vnfd_yaml)

Full traceback here,

2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/vm/plugin.py", line 684, in create_vnfd
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource new_dict = self.create_device_template(context, vnfd)
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/vm/plugin.py", line 207, in create_device_template
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource context=context, device_template=device_template)
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/common/driver_manager.py", line 75, in invoke
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource return getattr(driver, method_name)(**kwargs)
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/common/log.py", line 34, in wrapper
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource return method(*args, **kwargs)
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/vm/drivers/heat/heat.py", line 87, in create_device_template_pre
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource vnfd_dict = yaml.load(vnfd_yaml)
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/yaml/__init__.py", line 71, in load
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource return loader.get_single_data()
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource node = self.get_single_node()
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource document = self.compose_document()
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/yaml/composer.py", line 55, in compose_document
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource node = self.compose_node(None, None)
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource node = self.compose_mapping_node(anchor)
2015-09-30 12:33:22.285 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/yaml/composer.py", line 127, in co...

Read more...

Changed in tacker:
importance: Wishlist → Low
tags: added: low-hanging-fruit
removed: tacker
Revision history for this message
Sridhar Ramaswamy (srics-r) wrote :

Another comment from Bob captured here as a reference for future developer(s) taking this up,

all of the yaml/parameter processing should be handled outside of the driver so it is common for all drivers. Future effort.

(via https://review.openstack.org/#/c/230169/1/tacker/vm/drivers/heat/heat.py,unified)

Revision history for this message
Luka Krajger (luka-krajger) wrote :

After server-side validation is implemented, it would also be useful to add some "validate only" command in tacker client.

Validation is very useful when editing/creating complex template files, so users can validate the template without actually creating a VNFD... Command could look like this for example:

  tacker vnfd-template-validate --template-file <path-to-template>

This could be done similar as in heat template-validate command.

Revision history for this message
Sridhar Ramaswamy (srics-r) wrote :

Since basic TOSCA template validation is already in place with tosca-parser, I'm changing this to an RFE for the above ask from Luka which IMO will be a nice capability in Tacker.

tags: added: rfe
removed: low-hanging-fruit
description: updated
summary: - Validation check missing for VNFD template
+ RFE: Introduce template validation for VNFD
summary: - RFE: Introduce template validation for VNFD
+ RFE: Introduce tacker-validate template validation for VNFD
Neeldhwaj Pathak (neel)
Changed in tacker:
assignee: nobody → Neeldhwaj Pathak (neel)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.openstack.org/333852

Changed in tacker:
status: New → In Progress
Revision history for this message
Neeldhwaj Pathak (neel) wrote :

python-tackerclient side changes

Introduce tacker vnfd-template-validate command.
Review: https://review.openstack.org/333853

Revision history for this message
dharmendra (dharmendra-kushwaha) wrote :

As tosca already in place. Closing this.

Changed in tacker:
status: In Progress → Won't Fix
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.