port disappears if the instance goes in error

Bug #1195490 reported by Armando Migliaccio
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Armando Migliaccio

Bug Description

Steps to reproduce:

- create a port with quantum port-create
- boot a VM passing the port id
- the VM goes in Error state (you may inject a fault into nova-compute to see this)
- Boom, your port is gone!

This happens on trunk

Changed in nova:
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Changed in neutron:
assignee: nobody → Armando Migliaccio (armando-migliaccio)
summary: - port disappears in the instance goes in error
+ port disappears if the instance goes in error
description: updated
Revision history for this message
yong sheng gong (gongysh) wrote :

I think we will have to add a new field into port to show if it is created by nova or not.
I suggest to do it in the extension portbinding extension.

Changed in neutron:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → havana-3
Changed in nova:
status: New → Confirmed
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

I thought about it, and adding metadata (i.e. bindings) to ports can turn out to be useful in a number of contexts, like the ones reported here:

https://bugs.launchpad.net/neutron/+bug/1158684
https://answers.launchpad.net/nova/+question/230868

However, in this specific case where the compute node fails to spawn an instance, it is enough to allow the compute clean-up logic to dispose of the port only if it was not created explicitly (as in I don't see the need to use the port binding extension).

So IMO, I could address this one in a small, fairly contained patch, and deal with the others in the way you suggested.

Thoughts?

Changed in nova:
importance: Undecided → Medium
milestone: none → havana-3
Changed in nova:
status: Confirmed → In Progress
no longer affects: neutron
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

is it worth backporting it?

tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit a141206e9dfd31955b9b31d9e5a7f73bbd8510ca
Author: armando-migliaccio <email address hidden>
Date: Mon Jul 8 19:47:34 2013 -0700

    Avoid deleting user-provided Neutron ports if VM spawn fails

    If the VM boot fails, resources like Neutron ports are destroyed.
    This is particularly bad if the failure is transient and a
    rescheduling attempt is made. In this case the port no longer exist
    and the failure becomes self-inflicted. To avoid this, during the
    deletion of VM resources, we look at the requested_networks passed
    by the user: if they contain port ids, we skip the destruction.

    An optional parameter is added to RPC method deallocate_for_instance.
    RPC Network API is bumped to 1.10 to reflect this change, but the
    change is backward compatible.

    Fixes bug #1195490

    Change-Id: Iade232267c58ae2cf3966829e660d3298070a3bf

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-3 → 2013.2
Alan Pevec (apevec)
tags: removed: grizzly-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.