failed to allocate fixed ip because old deleted one exists

Bug #996482 reported by yong sheng gong on 2012-05-08
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
John Tran
Essex
Medium
Vish Ishaya
nova (Ubuntu)
Undecided
Unassigned
Nominated for Precise by Yolanda Robla

Bug Description

reproduce steps:
1. nova-manage network create private 4.4.4.0/24
2. nova-manage network delete --uuid='xxx'
3. nova-manage network create private 4.4.4.0/24
4. nova boot

the instance will have no fixed ip assigned right because of the deleted fixed address:
nova/db/api.py:
def fixed_ip_update(context, address, values):
    session = get_session()
    with session.begin():
        fixed_ip_ref = fixed_ip_get_by_address(context,
                                               address,
                                               session=session)
        fixed_ip_ref.update(values)
        fixed_ip_ref.save(session=session)

def fixed_ip_get_by_address(context, address, session=None):
    result = model_query(context, models.FixedIp, session=session,
                         read_deleted="yes").\
                     filter_by(address=address).\
                     first()
    if not result:
        raise exception.FixedIpNotFoundForAddress(address=address)

    # NOTE(sirp): shouldn't we just use project_only here to restrict the
    # results?
    if is_user_context(context) and result['instance_id'] is not None:
        instance = instance_get(context, result['instance_id'], session)
        authorize_project_context(context, instance.project_id)

    return result

the deleted remarked ip will always be updated instead of the right twin.

Vish Ishaya (vishvananda) wrote :

hmm, looks like we need to change _fixed_ip_get_by_address to take read_deleted from context and pass it in when we need it.

Changed in nova:
importance: Undecided → Medium
status: New → Triaged
John Tran (jtran) on 2012-05-14
Changed in nova:
assignee: nobody → John Tran (jtran)

Fix proposed to branch: master
Review: https://review.openstack.org/7515

Changed in nova:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/7515
Committed: http://github.com/openstack/nova/commit/c1e54e1968faa23dfa26796fdb8f3f8d9ba79367
Submitter: Jenkins
Branch: master

commit c1e54e1968faa23dfa26796fdb8f3f8d9ba79367
Author: John Tran <email address hidden>
Date: Tue May 15 10:00:36 2012 -0700

    fixed_ip_get_by_address read_deleted from context

    Fixes bug 996482. by default fixed_ip_get_by_address
    always sets read_deleted='yes'. Changed it to accept
    read_deleted value from context.
    updated .mailmap to rewrite my old email to new email

    Change-Id: If94251972df7bbcfdeebc226613edac0a3f41186

Changed in nova:
status: In Progress → Fix Committed
Devin Carlen (devcamcar) on 2012-05-22
Changed in nova:
milestone: none → folsom-1
Thierry Carrez (ttx) on 2012-05-23
Changed in nova:
status: Fix Committed → Fix Released
Tomoe Sugihara (tomoe) wrote :

I'd like this to be back ported to stable/essex.

Thierry Carrez (ttx) on 2012-09-27
Changed in nova:
milestone: folsom-1 → 2012.2

Reviewed: https://review.openstack.org/13681
Committed: http://github.com/openstack/nova/commit/20f98c5785bfc074caaaa5542d19b7f361597e30
Submitter: Jenkins
Branch: stable/essex

commit 20f98c5785bfc074caaaa5542d19b7f361597e30
Author: John Tran <email address hidden>
Date: Tue May 15 10:00:36 2012 -0700

    fixed_ip_get_by_address read_deleted from context

    Fixes bug 996482. by default fixed_ip_get_by_address
    always sets read_deleted='yes'. Changed it to accept
    read_deleted value from context.
    updated .mailmap to rewrite my old email to new email

    Change-Id: If94251972df7bbcfdeebc226613edac0a3f41186
    (cherry picked from commit c1e54e1968faa23dfa26796fdb8f3f8d9ba79367)

Changed in nova (Ubuntu):
status: New → Fix Released

Hello yong, or anyone else affected,

Accepted nova into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/nova/2012.1.3+stable-20130423-e52e6912-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed

Please find the attached test log from the Ubuntu Server Team's CI infrastructure. As part of the verification process for this bug, Nova has been deployed and configured across multiple nodes using precise-proposed as an installation source. After successful bring-up and configuration of the cluster, a number of exercises and smoke tests have be invoked to ensure the updated package did not introduce any regressions. A number of test iterations were carried out to catch any possible transient errors.

Please Note the list of installed packages at the top and bottom of the report.

For records of upstream test coverage of this update, please see the Jenkins links in the comments of the relevant upstream code-review(s):

Trunk review: https://review.openstack.org/7515
Stable review: https://review.openstack.org/13681

As per the provisional Micro Release Exception granted to this package by the Technical Board, we hope this contributes toward verification of this update.

Yolanda Robla (yolanda.robla) wrote :

Test coverage log.

Yolanda Robla (yolanda.robla) wrote :

Please find the attached test log from the Ubuntu Server Team's CI infrastructure. As part of the verification process for this bug, Nova has been deployed and configured across multiple nodes using precise-proposed as an installation source. After successful bring-up and configuration of the cluster, a number of exercises and smoke tests have be invoked to ensure the updated package did not introduce any regressions. A number of test iterations were carried out to catch any possible transient errors.

Please Note the list of installed packages at the top and bottom of the report.

For records of upstream test coverage of this update, please see the Jenkins links in the comments of the relevant upstream code-review(s):

Trunk review: https://review.openstack.org/7515
Stable review: https://review.openstack.org/13681

As per the provisional Micro Release Exception granted to this package by the Technical Board, we hope this contributes toward verification of this update.

Yolanda Robla (yolanda.robla) wrote :

Test coverage log.

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers