stack update fail when server has a port

Bug #1439708 reported by Ethan Lynn
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Ethan Lynn
Kilo
Fix Released
High
Angus Salkeld

Bug Description

If update image property of a server and this server has a port, stack update will fail with following error message.

2015-04-02 21:55:54.245 INFO heat.engine.resource [-] CREATE: Server "server" Stack "tt" [49c52e13-96ae-4da1-ac06-edb250bac653]
2015-04-02 21:55:54.245 TRACE heat.engine.resource Traceback (most recent call last):
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 489, in _action_recorder
2015-04-02 21:55:54.245 TRACE heat.engine.resource yield
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 559, in _do_action
2015-04-02 21:55:54.245 TRACE heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 295, in wrapper
2015-04-02 21:55:54.245 TRACE heat.engine.resource step = next(subtask)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 530, in action_handler_task
2015-04-02 21:55:54.245 TRACE heat.engine.resource handler_data = handler(*args)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/nova/server.py", line 693, in handle_create
2015-04-02 21:55:54.245 TRACE heat.engine.resource admin_pass=admin_pass)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/v2/servers.py", line 929, in create
2015-04-02 21:55:54.245 TRACE heat.engine.resource **boot_kwargs)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/v2/servers.py", line 557, in _boot
2015-04-02 21:55:54.245 TRACE heat.engine.resource return_raw=return_raw, **kwargs)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 152, in _create
2015-04-02 21:55:54.245 TRACE heat.engine.resource _resp, body = self.api.client.post(url, body=body)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 443, in post
2015-04-02 21:55:54.245 TRACE heat.engine.resource return self._cs_request(url, 'POST', **kwargs)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 418, in _cs_request
2015-04-02 21:55:54.245 TRACE heat.engine.resource resp, body = self._time_request(url, method, **kwargs)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 392, in _time_request
2015-04-02 21:55:54.245 TRACE heat.engine.resource resp, body = self.request(url, method, **kwargs)
2015-04-02 21:55:54.245 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 386, in request
2015-04-02 21:55:54.245 TRACE heat.engine.resource raise exceptions.from_response(resp, body, url, method)
2015-04-02 21:55:54.245 TRACE heat.engine.resource Conflict: Port d493ae33-369b-43ce-b65b-1b471deb2f94 is still in use. (HTTP 409) (Request-ID: req-b2d0ac59-c04d-463f-bfa1-dcfd94a353dc)

Revision history for this message
Ethan Lynn (ethanlynn) wrote :

As a temporary workaround, set IMAGE_UPDATE_POLICY default to REBUILD will avoid this problem.

Changed in heat:
assignee: nobody → Ethan Lynn (ethanlynn)
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/170145

Changed in heat:
status: New → In Progress
tags: added: kilo-rc-potential
Changed in heat:
importance: Undecided → High
milestone: none → next
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Actually https://review.openstack.org/170145 is fine on its own but lets call it a partial fix.

A port is an exclusive resource but during a stack-update server replacement there are 2 servers needing the same port until the old server is deleted.

Now that nova doesn't delete ports on detach, it may now be possible to call nova().servers.interface_detach on any port that is already attached before calling nova().servers.create.

The tricky bit will be doing an interface_attach on the old server during rollback, but maybe we'll need to wait for convergence to do the truly correct thing.

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

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

commit 9062453aa5aa0bb197623e80128f4ada63cd5fac
Author: Ethan Lynn <email address hidden>
Date: Thu Apr 2 18:34:37 2015 +0800

    Set IMAGE_UPDATE_POLICY default to REBUILD

    If a server network using port id, update image property will fail
    with error 'port is still in use'. Set IMAGE_UPDATE_POLICY to
    REBUILD will preserve the port information when update the image.

    Closes-Bug: #1439708
    Change-Id: I023ee076682bd5febb960dc8754d61986fd9bedf

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/176125

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/kilo)

Reviewed: https://review.openstack.org/176125
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=7dbaa72f591d420e1c979f27be3020b69815e461
Submitter: Jenkins
Branch: stable/kilo

commit 7dbaa72f591d420e1c979f27be3020b69815e461
Author: Ethan Lynn <email address hidden>
Date: Thu Apr 2 18:34:37 2015 +0800

    Set IMAGE_UPDATE_POLICY default to REBUILD

    If a server network using port id, update image property will fail
    with error 'port is still in use'. Set IMAGE_UPDATE_POLICY to
    REBUILD will preserve the port information when update the image.

    Closes-Bug: #1439708
    Change-Id: I023ee076682bd5febb960dc8754d61986fd9bedf
    (cherry picked from commit 9062453aa5aa0bb197623e80128f4ada63cd5fac)

Thierry Carrez (ttx)
tags: removed: kilo-rc-potential
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/179291

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)
Download full text (7.7 KiB)

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

commit b5c32027e5f207cca51796ee2aba346413ad48da
Author: Steven Hardy <email address hidden>
Date: Thu Apr 23 14:14:26 2015 +1000

    Fix ResourceGroup validate when there are removal_policies

    We can't call child_template() from a validate in ResourceGroup
    as it accesses nested(). So move the validation to validate_nested_stack()
    so we can control the test template used for validation.

    Unfortunately coverage for this got removed during recent test rework
    and it looks like the interface has got broken.

    Co-Authored-by: Angus Salkeld <email address hidden>
    Change-Id: Ibea738a343847736b041cc49a2c486fa71e562d9
    Closes-Bug: #1446861

commit c958ecb5b4b4fc5a0236b70c21d7d62864cd162b
Author: Ethan Lynn <email address hidden>
Date: Wed Apr 22 13:46:11 2015 +0800

    Fix unicodeerror when heat-engine start

    If change local language to other languages(like ja), heat-engine
    will failed to start.

    Closes-Bug: #1446958
    Change-Id: Ia3cbcebb86257bc1c52ea758c1583191e5a52a2d
    (cherry picked from commit 0b3dd7be3d3cd9842616a16843d03e6c13cdcb08)

commit 94c4ae56e0fece995659d718ed1ab6e56b2deb9f
Author: Ethan Lynn <email address hidden>
Date: Tue Apr 21 17:09:42 2015 +0800

    Add v6-fixed-ip support for nova server

    Now nova server fixed-ip only support ipv4 address,
    this patch add IPv6 fixed ip support for nova server.

    Closes-Bug: #1446532
    Change-Id: I647abeedd36352f053a043d00ab87a84ee2470f3
    (cherry picked from commit 3e1a6f3b826bbc2a638ed7ea239221d13678024c)

commit d07f91615a159663261091e672ce62f90e6ad607
Author: Angus Salkeld <email address hidden>
Date: Tue Apr 7 09:25:50 2015 +1000

    Persist parent_resource_name and make sure it's available

    We are persisting for a number of reasons:
    - so we don't have to pass this through ever rpc call
    - the API exposes parent_resource (currently always None as
      it is not persisted)

    Closes-bug: #1438978
    Change-Id: Id2db36c0234a085ec4f0ce2ab114ec483ea29d81
    (cherry picked from commit edf86aeac2f7b68243b0eccc3c49fa1a579e664b)

commit f944c86d4c26877f4d8dab56790815af8e83ba45
Author: Michal Rostecki <email address hidden>
Date: Wed Mar 25 06:47:33 2015 +0100

    Novaclient v2 instead of v1_1

    Nova API v1.1 is now deprecated and causes warnings.

    Change-Id: Ib4b57a308b7637f4015a07b4e888ccd6347cb947
    Closes-Bug: #1437158
    (cherry picked from commit d9d68cf52bd7027e7d1cafd023a399c2a342b2c5)

commit 370f3c98c5eccf8bce1be425acc31af5e7224171
Author: Zane Bitter <email address hidden>
Date: Thu Apr 16 17:20:05 2015 -0400

    Don't re-bind environment for get_file during stack update

    While we're in the process of updating a stack, we set the stack's
    environment to the new, updated values. However, we don't want to change
    existing resources' idea of their own values until we have explivitly done
    an update of them to bring them into line with th...

Read more...

Revision history for this message
Zane Bitter (zaneb) wrote :

Looks like this patch was merged right at the beginning of Liberty but the bug was never targeted for that.

Changed in heat:
milestone: next → liberty-rc2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-rc2 → 5.0.0
Revision history for this message
Chris (tollwilly) wrote :

I tried the workaround mentioned (image_update_policy: REBUILD) on Kilo and i aways get the port in use HTTP 409 error on my first stack-update attempt. Running the exact same stack-update command again results in a successful update (Update Complete). I am only changing user_data in the template. Looking at the neutron port that it complains about before and after the first attempt at an update the data is identical, but still the second stack-update attempt goes through while the first does not. I won't be updating to Liberty for some time so any suggestions on how to resolve this in Kilo are much appreciated!

-Chris

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.