stack-update with OS::Nova::Server resource fails when using 'network name' rather than 'network id'

Bug #1439071 reported by Rabi Mishra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Rabi Mishra

Bug Description

When updating a stack to change the network of a server, it fails with the below error.

Sample Template:

heat_template_version: 2013-05-23
parameters:
  image:
    type: string
    default: cirros-0.3.1-x86_64-uec
  name:
    type: string
    default: server1
  key_name:
    type: string
    default: heat_key
resources:
  server:
    type: OS::Nova::Server
    properties:
      image: {get_param: image}
      networks: [{network: private}]
      flavor: 1
      key_name: {get_param: key_name}
      name: {get_param: name}
      image_update_policy: REBUILD

Changing the network to 'private1' results in the following error, as it looks for a network_id 'private1'.

2015-03-26 12:09:48.209 11751 INFO heat.engine.resource [-] UPDATE: Server "server" [3afa720f-d635-4930-8547-99ff5e5851b1] Stack "test_stack" [8a24d931-80fe-41c6-a640-7848ff2a3b09]
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource Traceback (most recent call last):
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 486, in _action_recorder
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource yield
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 751, in update
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource args=[after, tmpl_diff, prop_diff])
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 312, in wrapper
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource step = next(subtask)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 530, in action_handler_task
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource while not check(handler_data):
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/nova/server.py", line 1106, in check_update_complete
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource checker.start()
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 196, in start
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource result = self._task(*self._args, **self._kwargs)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/v1_1/servers.py", line 397, in interface_attach
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource return self.manager.interface_attach(self, port_id, net_id, fixed_ip)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/v1_1/servers.py", line 1221, in interface_attach
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource body, 'interfaceAttachment')
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 100, in _create
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource _resp, body = self.api.client.post(url, body=body)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 490, in post
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource return self._cs_request(url, 'POST', **kwargs)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 465, in _cs_request
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource resp, body = self._time_request(url, method, **kwargs)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 439, in _time_request
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource resp, body = self.request(url, method, **kwargs)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 433, in request
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource raise exceptions.from_response(resp, body, url, method)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource NotFound: Network private1 could not be found. (HTTP 404) (Request-ID: req-4cba5a53-bd2e-40a9-ae16-02f5142eea78)
2015-03-26 12:09:48.209 11751 TRACE heat.engine.resource

Rabi Mishra (rabi)
Changed in heat:
assignee: nobody → Rabi Mishra (rabi)
Revision history for this message
Sergey Kraynev (skraynev) wrote :

Looks like you really have not network with name "private1".
Will be useful to show output for command: neutron net-list

Revision history for this message
Rabi Mishra (rabi) wrote :

Nope, the network 'private1' exists and it's using the network name to look for the net_id. I've fixed the issue, I'll upload a patch soon.

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/169848

Changed in heat:
status: New → In Progress
Angus Salkeld (asalkeld)
Changed in heat:
importance: Undecided → High
milestone: none → kilo-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit d213a2414e26b8ce26838d16548b4cfabef20da1
Author: Rabi Mishra <email address hidden>
Date: Wed Apr 1 14:40:09 2015 +0530

    Fix stack-update for OS::Nova::Server resource

    This fixes stack-update for `OS::Nova::Server` resource, when
    network name rather than network id is used.

    Change-Id: I484f7f8890485eca42eaa31e034f6d19b369c72a
    Closes-Bug: #1439071

Changed in heat:
status: In Progress → Fix Committed
tags: added: kilo-rc-potential
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-rc1 → 2015.1.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.