port is deleted when update server networks

Bug #1676821 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 a nova server, the template snippet as following:
***************************
th_server:
  type: OS::Nova::Server
  properties:
    networks:
      - port: {get_resource: th_port}
      - subnet: {get_param: sub}
    .... other properties
th_port:
  type: OS::Neutron::Port
  properties:
    network: {get_param: net}
****************************
2. the stack create success, list the resources of the stack:

 root@hth:/opt/stack/heat# heat resource-list ssk
WARNING (shell) "heat resource-list" is deprecated, please use "openstack stack resource list" instead
+---------------+--------------------------------------+-------------------+-----------------+----------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+
| port | 4f27803c-46b5-48a1-b303-cb6478fa927a | OS::Neutron::Port | CREATE_COMPLETE | 2017-03-28T09:56:33Z |
| th_server | cccb1b46-3600-4371-a273-eb6718fe091e | OS::Nova::Server | CREATE_COMPLETE | 2017-03-28T09:56:33Z |
+---------------+--------------------------------------+-------------------+-----------------+----------------------+

list the interfaces of the server:

root@hth:/opt/stack/heat# nova interface-list cccb1b46-3600-4371-a273-eb6718fe091e
/usr/local/lib/python2.7/dist-packages/novaclient/client.py:278: UserWarning: The 'tenant_id' argument is deprecated in Ocata and its use may result in errors in future releases. As 'project_id' is provided, the 'tenant_id' argument will be ignored.
  warnings.warn(msg)
+------------+--------------------------------------+--------------------------------------+-----------------------------------------------+-------------------+
| Port State | Port ID | Net ID | IP addresses | MAC Addr |
+------------+--------------------------------------+--------------------------------------+-----------------------------------------------+-------------------+
| ACTIVE | 4f27803c-46b5-48a1-b303-cb6478fa927a | 034364a0-08fc-419b-9b40-90eec14f10ee | 10.0.0.9,fd83:9bf1:3ab0:0:f816:3eff:fe7c:8ba5 | fa:16:3e:7c:8b:a5 |
| ACTIVE | bb08e0ee-98c7-4174-a386-8df53d0bf58f | 034364a0-08fc-419b-9b40-90eec14f10ee | 10.0.0.13,fd83:9bf1:3ab0:0:f816:3eff:fe8e:fc4 | fa:16:3e:8e:0f:c4 |
+------------+--------------------------------------+--------------------------------------+-----------------------------------------------+-------------------+

3. update the stack with template snippet to detach one nic from the server:
************************************
th_server:
  type: OS::Nova::Server
  properties:
    networks:
      - subnet: {get_param: sub}
    .... other properties
th_port:
  type: OS::Neutron::Port
  properties:
    network: {get_param: net}
*************************************
4. the stack update complete, but the port 4f27803c-46b5-48a1-b303-cb6478fa927a was deleted underlying, we deleted the port when update the nics of server.

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

Changed in heat:
status: New → In Progress
Changed in heat:
milestone: none → pike-1
tags: added: ocata-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit b194775ebeaf75a88e6b0b9623aa602cb8c32e0c
Author: huangtianhua <email address hidden>
Date: Tue Mar 28 19:19:50 2017 +0800

    Delete internal ports when detach them

    Make sure only to delete internal ports when user
    wants to detach them, and just do detach for
    external ports.

    Change-Id: I09e686d4e1603c6a8b388772eee900f06b1e775d
    Closes-Bug: #1676821

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

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/454005

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

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/454010

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 9.0.0.0b1

This issue was fixed in the openstack/heat 9.0.0.0b1 development milestone.

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

Reviewed: https://review.openstack.org/454005
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=434688b7c23717e7b7740f58e48bfb72d23cb28d
Submitter: Jenkins
Branch: stable/ocata

commit 434688b7c23717e7b7740f58e48bfb72d23cb28d
Author: huangtianhua <email address hidden>
Date: Tue Mar 28 19:19:50 2017 +0800

    Delete internal ports when detach them

    Make sure only to delete internal ports when user
    wants to detach them, and just do detach for
    external ports.

    Change-Id: I09e686d4e1603c6a8b388772eee900f06b1e775d
    Closes-Bug: #1676821
    (cherry picked from commit b194775ebeaf75a88e6b0b9623aa602cb8c32e0c)

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

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

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

Reviewed: https://review.openstack.org/454010
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=227077afae93f96ad83a0ac4ea04c2c6fed9089e
Submitter: Jenkins
Branch: stable/newton

commit 227077afae93f96ad83a0ac4ea04c2c6fed9089e
Author: huangtianhua <email address hidden>
Date: Tue Mar 28 19:19:50 2017 +0800

    Delete internal ports when detach them

    Make sure only to delete internal ports when user
    wants to detach them, and just do detach for
    external ports.

    Change-Id: I09e686d4e1603c6a8b388772eee900f06b1e775d
    Closes-Bug: #1676821
    (cherry picked from commit b194775ebeaf75a88e6b0b9623aa602cb8c32e0c)

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

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

Zane Bitter (zaneb)
tags: removed: ocata-backport-potential
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.