Comment 20 for bug 1158684

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

Reviewed: https://review.openstack.org/126309
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1153a46738fc3ffff98a1df9d94b5a55fdd58777
Submitter: Jenkins
Branch: master

commit 1153a46738fc3ffff98a1df9d94b5a55fdd58777
Author: Boden R <email address hidden>
Date: Fri Oct 3 13:48:08 2014 -0400

    Preserve preexisting ports on server delete

    When using the '--nic port-id' option for nova boot to bind
    a server to an existing port, nova deletes the preexisting
    port on server terminate (delete). This behavior is not correct
    since the user has preallocated the port object and will
    expect it to only be unbound from the server on delete.

    This patch allow the existing port to be unbound from the instance
    on server delete whereupon the port will still exist but not
    be associated with the instance in neutron (note the '--nic
    port-id' opt is only supported with neutron). The patch also
    adds unit tests to verify the behavior + changes.

    This patch also moves instance.info_cache.delete() to be called
    after _shutdown in the compute manager as shutdown calls
    deallocate_for_instance so the info_cache is still needed at this point.

    Based on original work from Aaron Rosen <email address hidden>
    for which you can see a stale patch review here:
    https://review.openstack.org/#/c/77043/

    UpgradeImpact:

    Existing applications that created neutron ports and assigned them to a running
    instance or to a instance that is created will need to be aware
    that they are now respponsible for the deletion of the ports and that these
    ports will not be deleted by nova when the instance is destroyed.

    Co-authored-by: Aaron Rosen <email address hidden>
    Co-authored-by: Davanum Srinivas <email address hidden>

    Change-Id: Ia5367cf064d40690670ffeac3c1f16998464c234
    Closes-bug: 1158684