Can't replace nova server with same port

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

Bug Description

1. create a stack with nova server:
************************************
heat_template_version: 2013-05-23
parameters:
  net_id:
    type: string
    default: 4c6d3e5e-2bf2-444d-ac50-33b16a4cb6b6
resources:
  port:
    type: OS::Neutron::Port
    properties:
      network: {get_param: net_id}
  myserver:
    type: OS::Nova::Server
    properties:
      flavor: "m1.tiny"
      image: cirros-0.3.0-x86_64-disk
      name: test
      key_name: live
      networks:
        - port: {get_resource: port}
************************************

2. stack create success, and nova server in active
3. update the stack, remove the property 'key_name', so heat will enter updatereplacement, although we provide 'prepare_for_repalce' to reset the ip of server port, but in fact the port is still in-use, stack update failed while create a new server:
Conflict: Port bebebf12-b255-4ee1-be1a-d7bcdb1d26cd is still in use. The details: http://paste.openstack.org/show/483527/

Changed in heat:
importance: Undecided → Medium
assignee: nobody → huangtianhua (huangtianhua)
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/274976

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

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

commit 163d46bdc8bbfa2e7da2989f5a5d608826de2dcc
Author: huangtianhua <email address hidden>
Date: Wed Jan 13 14:17:57 2016 +0800

    Fix prepare_for_replace/restore_prev_rsrc handing for server

    Now, we set 'fixed_ips' to [] for server ports when prepare
    for server replacement, but the ports are still in-use if only
    set 'fixed_ips' to []. So this patch will to detach the ports from
    nova server to make sure same ports can be attached to new one in
    prepare_for_replace(). Also, when restoring server, we need to detach
    ports from existing server, and then to attach them to previous
    server.

    We check the interface attach/detach complete by list the
    server.interfaces, this change will use 'retry' wrapper to re-poll
    the server interfaces for several times (by new config option
    'max_interface_check_attempts', default is 10), then will raise
    exception if the attach/detach still not complete.

    Closes-Bug: #1533076
    Change-Id: I7b322f9cf16c100dcd0365bc3091c289f00f0548

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0rc1

This issue was fixed in the openstack/heat 6.0.0.0rc1 release candidate.

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/361978

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

Reviewed: https://review.openstack.org/361978
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=d83ab28e32da1c17ffc05fe3d10369c91a5e5cdb
Submitter: Jenkins
Branch: stable/liberty

commit d83ab28e32da1c17ffc05fe3d10369c91a5e5cdb
Author: huangtianhua <email address hidden>
Date: Wed Jan 13 14:17:57 2016 +0800

    Fix prepare_for_replace/restore_prev_rsrc handing for server

    Now, we set 'fixed_ips' to [] for server ports when prepare
    for server replacement, but the ports are still in-use if only
    set 'fixed_ips' to []. So this patch will to detach the ports from
    nova server to make sure same ports can be attached to new one in
    prepare_for_replace(). Also, when restoring server, we need to detach
    ports from existing server, and then to attach them to previous
    server.

    We check the interface attach/detach complete by list the
    server.interfaces, this change will use 'retry' wrapper to re-poll
    the server interfaces ten times, then will raise
    exception if the attach/detach still not complete.

    Closes-Bug: #1533076
    (cherry picked from commit 163d46bdc8bbfa2e7da2989f5a5d608826de2dcc)

    Change-Id: I7b322f9cf16c100dcd0365bc3091c289f00f0548

tags: added: in-stable-liberty
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 5.0.3

This issue was fixed in the openstack/heat 5.0.3 release.

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.