Neutron port replaced when switching network from name->ID

Bug #1526014 reported by Steven Hardy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
In Progress
High
Steven Hardy

Bug Description

When updating an OS::Neutron::Port resource, it should be possible to move the "network" property value from a name, to the ID of the same network without replacing the port.

Other neutron resources probably have the same problem.

E.g

heat_template_version: 2015-04-30

parameters:
  NeutronControlPlaneID:
    default: 'ctlplane'
    type: string
    description: Neutron ID or name for ctlplane network.

resources:
  ControlVirtualIP:
    type: OS::Neutron::Port
    properties:
      name: test123
      network: {get_param: NeutronControlPlaneID}
      replacement_policy: AUTO

heat stack-create test123 -f neutron-port.yaml

$ heat resource-list test123
+------------------+--------------------------------------+-------------------+-----------------+---------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+------------------+--------------------------------------+-------------------+-----------------+---------------------+
| ControlVirtualIP | 84b47f21-f3ad-4844-bb6c-40e9f871078e | OS::Neutron::Port | CREATE_COMPLETE | 2015-12-14T17:59:45 |
+------------------+--------------------------------------+-------------------+-----------------+---------------------+

$ neutron net-list
+--------------------------------------+----------+---------------------------------------------------+
| id | name | subnets |
+--------------------------------------+----------+---------------------------------------------------+
| 750132e9-d1a3-45bd-abf5-0c6a9757fbd8 | ctlplane | 8759707e-e84e-4639-bcaf-0ea88fe67dd3 192.0.2.0/24 |
+--------------------------------------+----------+---------------------------------------------------+

$ neutron port-list | grep test123
| 84b47f21-f3ad-4844-bb6c-40e9f871078e | test123 | fa:16:3e:7b:8d:94 | {"subnet_id": "8759707e-e84e-4639-bcaf-0ea88fe67dd3", "ip_address": "192.0.2.12"} |

heat stack-update -x test123 -P"NeutronControlPlaneID=750132e9-d1a3-45bd-abf5-0c6a9757fbd8"

$ heat resource-list test123
+------------------+--------------------------------------+-------------------+-----------------+---------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+------------------+--------------------------------------+-------------------+-----------------+---------------------+
| ControlVirtualIP | 750cd9c1-e9ce-4532-a72a-6fb7f68b30de | OS::Neutron::Port | CREATE_COMPLETE | 2015-12-14T18:01:22 |
+------------------+--------------------------------------+-------------------+-----------------+---------------------+

$ neutron port-list | grep test123
| 750cd9c1-e9ce-4532-a72a-6fb7f68b30de | test123 | fa:16:3e:17:91:21 | {"subnet_id": "8759707e-e84e-4639-bcaf-0ea88fe67dd3", "ip_address": "192.0.2.13"} |

Steven Hardy (shardy)
Changed in heat:
assignee: nobody → Steven Hardy (shardy)
status: New → Triaged
importance: Undecided → High
milestone: none → mitaka-2
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/257581

Changed in heat:
status: Triaged → In Progress
Revision history for this message
huangtianhua (huangtianhua) wrote :

I proposed a bug https://bugs.launchpad.net/heat/+bug/1514680 before, and I plan to propose a spec of general approach for resources.

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

Not only neutron , this issue is generic across all resources i.e image/flavor properties of OS::Nova:Server. Probably a solution that can handle all these cases?

Revision history for this message
Steven Hardy (shardy) wrote :

@Rabi, @huangtianhua - thanks, yes it would be good to make this generic if possible - huangtianhua I'll mark this as a duplicate of bug 1514680. Do you have any code yet, or are you open to landing the neutron fix as a Partial-Bug fix, then potentially refactoring to make it more general later?

I'm happy to help us get to the generic solution, but right now I'm trying to fix a specific issue related to TripleO.

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

@Steve, no issues with the current fix. Just wanted to point out that we've more issues of this type:).

Revision history for this message
Steven Hardy (shardy) wrote :

@Rabi, thanks I've updated the fix to be a little more generic, but we can consider how to reach the full generic solution via a subsequent patch.

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.