Heat fails to create trove instance when using neutron port

Bug #1484010 reported by zhufeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
zhufeng

Bug Description

Using the following HOT template,heat fails to create a trove instance.

Template:
----------
heat_template_version: 2013-05-23
description: create a database by trove
parameters:
  net_id:
    type: string
    default: ce48665d-e694-4d1f-999e-98457154b86b
    constraints:
      - custom_constraint: neutron.network
resources:
  port:
    type: OS::Neutron::Port
    properties:
      replacement_policy: AUTO
      network: {get_param: net_id}
  mysql_database:
    type: OS::Trove::Instance
    properties:
      databases:
        - name: database_test
      users:
        - databases:
             - mysqltest
         name: user
         password: user_password
      datastore_type: "mysql"
      datastore_version: "5.5"
      flavor: "m1.small"
      name: instance_test
      networks:
        - port: {get_resource: port}
      size: 2

Stack Traceback info from heat-engine.log:
-------------------------------------------
2015-08-12 15:21:07.392 1408 INFO heat.engine.resource [-] CREATE: OSDBInstance "mysql_database" Stack "trove_port" [5e305f71-7ded-4dae-b96a-f0be3ea96074]
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource Traceback (most recent call last):
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/opt/heat/heat/engine/resource.py", line 625, in _action_recorder
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource yield
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/opt/heat/heat/engine/resource.py", line 696, in _do_action
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/opt/heat/heat/engine/scheduler.py", line 303, in wrapper
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource step = next(subtask)
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/opt/heat/heat/engine/resource.py", line 667, in action_handler_task
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource handler_data = handler(*args)
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/opt/heat/heat/engine/resources/openstack/trove/os_database.py", line 343, in handle_create
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource self.properties, self.PORT, 'port')
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/opt/heat/heat/engine/clients/os/neutron.py", line 73, in find_neutron_resource
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource self.client(), key_type, props.get(key))
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 109, in find_resourceid_by_name_or_id
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource cmd_resource, parent_id)
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 57, in find_resourceid_by_id
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource match = re.match(UUID_PATTERN, resource_id)
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource File "/usr/lib/python2.7/re.py", line 137, in match
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource return _compile(pattern, flags).match(string)
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource TypeError: expected string or buffer
2015-08-12 15:21:07.392 1408 ERROR heat.engine.resource

zhufeng (gfl1998)
Changed in heat:
assignee: nobody → zhufeng (gfl1998)
description: updated
description: updated
Changed in heat:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/214939
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=a3ea77d1a9a31cbb9b613e87c7fafe9e80239fd9
Submitter: Jenkins
Branch: master

commit a3ea77d1a9a31cbb9b613e87c7fafe9e80239fd9
Author: zhufeng <gfl1998@163.com>
Date: Thu Aug 20 09:25:26 2015 +0800

    Fix create trove instance with a neutron port failed

    Heat fails to create a trove instance with a neutron port, because it try to
    get 'port' attribute from the instance properties, while the 'port' attribute
    is in attribute 'networks' of instance properties.

    Change-Id: I44b1f04398519cfc300cd8183148e8128d3d8fc8
    Closes-Bug: #1484010

Changed in heat:
status: In Progress → Fix Committed
Changed in heat:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-3 → 5.0.0
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.