Ironic: unplugging of instance VIFs fails if no VIFs associated with port

Bug #1292733 reported by Adam Gandelman
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ironic
Invalid
Medium
Unassigned
OpenStack Compute (nova)
Fix Released
Low
Lucas Alvares Gomes

Bug Description

During instance spawn, Ironic attempts to unplug any plugged VIFs from ports associated with an instance. If there are no associated VIFs to unplug, instance spawn fails with a nova-compute errror:

2014-03-14 21:15:35.907 16640 TRACE nova.openstack.common.loopingcall HTTPBadRequest: Couldn't apply patch '[{'path': '/extra/vif_port_id', 'op': 'remove'}]'. Reason: u'vif_port_id'

The driver should be only attempt to unplug VIFs from ports that actually have them associated.

Tags: ironic
Changed in ironic:
status: New → Invalid
Revision history for this message
Robert Collins (lifeless) wrote :

2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall BadRequest: Couldn't apply patch '[{'path': '/extra/vif_port_id', 'op': 'remove'}]'. Reason: can't remove non-existent object 'vif_port_id' (HTTP 400)

tada, just triggered this :)

2014-07-07 01:50:46.181 5764 ERROR nova.openstack.common.loopingcall [-] in fixed duration looping call
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall Traceback (most recent call last):
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall File "/opt/stack/venvs/nova/local/lib/python2.7/site-packages/nova/openstack/common/loopingcall.py", line 76, in _inner
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall self.f(*self.args, **self.kw)
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall File "/opt/stack/venvs/nova/local/lib/python2.7/site-packages/ironic/nova/virt/ironic/driver.py", line 169, in _request_api
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall func(*args)
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall File "/opt/stack/venvs/nova/local/lib/python2.7/site-packages/ironicclient/v1/port.py", line 57, in update
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall return self._update(self._path(port_id), patch)
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall File "/opt/stack/venvs/nova/local/lib/python2.7/site-packages/ironicclient/common/base.py", line 68, in _update
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall resp, body = self.api.json_request(method, url, body=body)
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall File "/opt/stack/venvs/nova/local/lib/python2.7/site-packages/ironicclient/common/http.py", line 186, in json_request
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall resp, body_iter = self._http_request(url, method, **kwargs)
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall File "/opt/stack/venvs/nova/local/lib/python2.7/site-packages/ironicclient/common/http.py", line 169, in _http_request
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall error_json.get('debuginfo'), method, url)
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall BadRequest: Couldn't apply patch '[{'path': '/extra/vif_port_id', 'op': 'remove'}]'. Reason: can't remove non-existent object 'vif_port_id' (HTTP 400)
2014-07-07 01:50:46.181 5764 TRACE nova.openstack.common.loopingcall

Changed in ironic:
status: Invalid → Triaged
Revision history for this message
Robert Collins (lifeless) wrote :

Though I'll note I triggered it on delete.

Dmitry Tantsur (divius)
Changed in ironic:
importance: Undecided → Medium
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

The fix is quite simply but we need to wait until J3 ends because the fix affects the driver and it's right now being reviewing by the nova team

Changed in ironic:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
milestone: none → next
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

The driver is now in nova, so the fix should go there

Changed in nova:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
Changed in ironic:
status: Triaged → Invalid
tags: added: ironic
Changed in ironic:
assignee: Lucas Alvares Gomes (lucasagomes) → nobody
Sean Dague (sdague)
summary: - unplugging of instance VIFs fails if no VIFs associated with port
+ Ironic: unplugging of instance VIFs fails if no VIFs associated with
+ port
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/124394
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d3acac0f5bffca59441d9a4a12c89db1d45ec4cf
Submitter: Jenkins
Branch: master

commit d3acac0f5bffca59441d9a4a12c89db1d45ec4cf
Author: Lucas Alvares Gomes <email address hidden>
Date: Fri Sep 26 13:53:44 2014 +0100

    Ironic: Do not try to unplug VIF if not associated

    During instance spawn, Ironic attempts to unplug any plugged VIFs from
    ports associated with an instance. If there are no associated VIFs
    to unplug, this would raise an exeception that would be logged into
    n-cpu. This patch fix that behavior by making the driver check if the
    port has an VIF associated with it before trying to remove it.

    Change-Id: I5608b9eec625452edda9a0c9eb366ece2a95800f
    Closes-Bug: #1292733

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-1 → 2015.1.0
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.