Not need to do prepare_for_replace if port hasn't create yet

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

Bug Description

1. create a stack with a neutron port resource

***********************************
heat_template_version: 2014-10-16
resources:
  port:
    type: OS::Neutron::Port
    properties:
      network: 3447dd80-14ef-4059-8ea6-35f4fd60ba26
      name: port_hth
      mac_address: 00-B0-D0-86-BB-E7
      replacement_policy: REPLACE_ALWAYS

2. update the stack with the same template. Enter port UpdateReplacement, but the new port can't be created, due the mac_address is in-use, the stack went to UPDATE_FAILED.
3. update the stack to set another mac_address(00-B0-D0-86-BB-F1), an error raised(NeutronClientException: 404 Not Found) in prepare_for_replace(), and also the stack state remain in UPDATE_IN_PROGRESS

There are two problems:
1. no need to do the prepare_for_replace() for the port, if the port has not been created yet
2. we should catch the exception and then set stack to FAILED(not leave it to UPDATE_IN_PROGRESS), this bug reported in https://bugs.launchpad.net/heat/+bug/1492433

So this bug we fix the first problem.

Changed in heat:
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/239375

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

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

commit 9ea7250f3daeb8e8cf8b9e7f3deea639569ab790
Author: huangtianhua <email address hidden>
Date: Mon Oct 26 16:40:38 2015 +0800

    Do nothing in prepare_for_replace if port not created

    There is no need to reset 'fixed_ips' for an non-existent
    port when prepare for update replace.

    Change-Id: I212e3ff73e41c6bffc5e76457d8e2aaf360f5ceb
    Closes-Bug: #1509977

Changed in heat:
status: In Progress → Fix Committed
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/240750

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

I don't think fixing bug 1492433 is sufficient to resolve the general case of exceptions in prepare_for_update()/restore_prev_rsrc(), as it would still leave the resource IN_PROGRESS (and not record the error in the right place). I created bug 1512496 as well to track this.

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

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

commit 3d82e6801189ac0f6ecf164621438bf0a158bf16
Author: huangtianhua <email address hidden>
Date: Mon Oct 26 16:40:38 2015 +0800

    Do nothing in prepare_for_replace if port not created

    There is no need to reset 'fixed_ips' for an non-existent
    port when prepare for update replace.

    Closes-Bug: #1509977
    (cherry picked from commit 9ea7250f3daeb8e8cf8b9e7f3deea639569ab790)

    Conflicts:
     heat/tests/neutron/test_neutron_port.py

    Change-Id: I212e3ff73e41c6bffc5e76457d8e2aaf360f5ceb

tags: added: in-stable-liberty
tags: removed: liberty-backport-potential
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b1

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

Changed in heat:
status: Fix Committed → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/heat 5.0.1

This issue was fixed in the openstack/heat 5.0.1 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.