Tacker: Handle VNF Create using an invalid template

Bug #1468565 reported by Sridhar Ramaswamy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Low
Bob Haddleton

Bug Description

When VNF based on a TOSCA template is created and if the networks mentioned in the TOSCA is not already pre-created tacker-server returns bad API response. Instead it should return a proper error response back.

$ tacker vnf-create --name wrt1 --vnfd-id f8dba2d0-dc19-4dfe-8e0d-2667f0608011
Request Failed: internal server error while processing your request.

Also a VNF entry is left the VNF table in ERROR state. The proper behavior would be return granular error code on vnf-create API response without leaving any
entries in the VNF table.

[1]

$ tacker vnf-list
+--------------------------------+-------------------------------+--------------------------------------+-------------+----------+------+----------+--------+--------------------------------------+----------------------------------+
| attributes | description | id | instance_id | mgmt_url | name | services | status | template_id | tenant_id |
+--------------------------------+-------------------------------+--------------------------------------+-------------+----------+------+----------+--------+--------------------------------------+----------------------------------+
| {u'config': u'wrt-vnf-config'} | Virtual WRT opensource router | ac874b35-9009-45f0-a54c-7daf2fa57c78 | | | wrt1 | [] | ERROR | f8dba2d0-dc19-4dfe-8e0d-2667f0608011 | 83d4638eca9546ea8a60bd0cb1513770 |
+--------------------------------+-------------------------------+--------------------------------------+-------------+----------+------+----------+--------+--------------------------------------+----------------------------------+

Changed in tacker:
importance: Undecided → Low
summary: - Tacker: creating VNF using invalid TOSCA attributes returns internal
- error
+ Tacker: Error during VNF create returns internal error
description: updated
Changed in tacker:
assignee: nobody → Bob Haddleton (bob-haddleton)
Changed in tacker:
status: New → Confirmed
Revision history for this message
Bob Haddleton (bob-haddleton) wrote :

The internal error is caused by an Exception from the HeatClient because the Heat stack could not be created. When the template is invalid for any reason the HeatClient will raise an HTTPBadRequest exception that needs to be handled. The error message from this exception needs to be passed back to the client along with the appropriate API error response code.

summary: - Tacker: Error during VNF create returns internal error
+ Tacker: Handle VNF Create using an invalid template
Changed in tacker:
status: Confirmed → 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.openstack.org/200334

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.openstack.org/200334
Committed: https://git.openstack.org/cgit/stackforge/tacker/commit/?id=8dd49889ad07f9ea44cd8ee6783559a781295cbe
Submitter: Jenkins
Branch: master

commit 8dd49889ad07f9ea44cd8ee6783559a781295cbe
Author: Bob HADDLETON <email address hidden>
Date: Thu Jul 9 20:24:23 2015 -0500

    Error during VNF create returns internal error

          * When a user runs vnf-create with an invalid template, the
            client returns am Internal Server Error message instead of
            something useful. Also the failed VNF device is left in
            the database and must be manually deleted using vnf-delete

          * This patchset catches the heatclient.HTTPException and
            translates it into an HeatClientException subclass of
            TackerException which is able to be passed back to the
            client. It also deletes the failed VNF entry from the
            database so it does not need to be manually cleaned up.

          * Added device_dict parameter to _create_device_post() call
            when create_device() receives instance_id "None" from a
            failed call to _create_device(). This is an error
            leg that is not normally executed since there should have
            been an exception from the failed device create call.

    Closes-Bug: 1468565
    Change-Id: Ia2ee8590b7c3bb932328fa0def434ff43e6e52e8

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

Other bug subscribers