SR-IOV agent fails to list vifs during heal and optimize flow

Bug #1691584 reported by Sridhar Venkat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-powervm
Fix Released
Undecided
Sridhar Venkat

Bug Description

SR-IOV agent's heal and optimize flow fails due to a problem in list_vifs (from utils module). The entire stack trace :
networking_powervm.plugins.ibm.agent.powervm.agent_base [req-c897f1b5-f3a0-4f7c-ab08-ad9aac365eec - - - - -] 'VNIC' object has no attribute 'vswitch_id'
networking_powervm.plugins.ibm.agent.powervm.agent_base Traceback (most recent call last):
networking_powervm.plugins.ibm.agent.powervm.agent_base File "/usr/lib/python2.7/dist packages/networking_powervm/plugins/ibm/agent/powervm/agent_base.py", line 415, in rpc_loop
networking_powervm.plugins.ibm.agent.powervm.agent_base self.heal_and_optimize()
networking_powervm.plugins.ibm.agent.powervm.agent_base File "/usr/lib/python2.7/dist-packages/networking_powervm/plugins/ibm/agent/powervm/sriov_agent.py", line 139, in heal_and_optimize
networking_powervm.plugins.ibm.agent.powervm.agent_base lpar_vnic_map = utils.list_vifs(self.adapter, self.vif_wrapper_class)
networking_powervm.plugins.ibm.agent.powervm.agent_base File "/usr/lib/python2.7/dist-packages/networking_powervm/plugins/ibm/agent/powervm/utils.py", line 236, in list_vifs
networking_powervm.plugins.ibm.agent.powervm.agent_base total_vifs[vm_wrap] = _find_vifs(adapter, vif_class, vm_wrap, vs_exclu)
networking_powervm.plugins.ibm.agent.powervm.agent_base File "/usr/lib/python2.7/dist-packages/pypowervm/utils/retry.py", line 237, in __retry
networking_powervm.plugins.ibm.agent.powervm.agent_base resp = func(*args, **kwds)
networking_powervm.plugins.ibm.agent.powervm.agent_base File "/usr/lib/python2.7/dist-packages/networking_powervm/plugins/ibm/agent/powervm/utils.py", line 280, in _find_vifs
networking_powervm.plugins.ibm.agent.powervm.agent_base and not getattr(vif, 'vswitch_id', None) in vs_exclu)]
networking_powervm.plugins.ibm.agent.powervm.agent_base AttributeError: 'VNIC' object has no attribute 'vswitch_id'
networking_powervm.plugins.ibm.agent.powervm.agent_base

vswitch_id is available only on CNA objects and not on VNICs objects.

Sridhar Venkat (svenkat)
Changed in networking-powervm:
status: New → In Progress
assignee: nobody → Sridhar Venkat (svenkat)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-powervm (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-powervm (master)

Reviewed: https://review.openstack.org/465761
Committed: https://git.openstack.org/cgit/openstack/networking-powervm/commit/?id=ace8c0ef0dd67de8884ed3ccda055b1363fc2db8
Submitter: Jenkins
Branch: master

commit ace8c0ef0dd67de8884ed3ccda055b1363fc2db8
Author: Sridhar Venkat <email address hidden>
Date: Wed May 17 19:04:27 2017 -0400

    Heal and optimize fails to retrieve vifs.

    heal_and_optimize flow retrieves a list of vifs
    using a method in util module. For SR-IOV agent,
    _find_vifs methid is invoked, it is common to CNA
    and VNIC objects. The vswitch_id is retrieved and
    validated, since vswitch_id is not present in VNIC
    object, getattr call fails. Since this method is
    common to both CNA and VNIC, a default return value
    of None should be included in the list of parameters.

    networking_powervm/plugins/ibm/agent/powervm/util.py
    _find_vifs method :
     Instead of getattr(vif, 'vswitch_id')
     getattr(vif, 'vswitch_id', None) should be used.

    Change-Id: I38f1662801ad773408ab581c77161677b1cb6b36
    Closes-Bug: #1691584

Changed in networking-powervm:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-powervm (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/466724

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-powervm (stable/ocata)

Reviewed: https://review.openstack.org/466724
Committed: https://git.openstack.org/cgit/openstack/networking-powervm/commit/?id=fc311de47a1f5cca6a158f6d909845d662bc15ef
Submitter: Jenkins
Branch: stable/ocata

commit fc311de47a1f5cca6a158f6d909845d662bc15ef
Author: Sridhar Venkat <email address hidden>
Date: Mon May 22 09:00:23 2017 -0400

    Heal and optimize fails to retrieve vifs.

    heal_and_optimize flow retrieves a list of vifs
    using a method in util module. For SR-IOV agent,
    _find_vifs methid is invoked, it is common to CNA
    and VNIC objects. The vswitch_id is retrieved and
    validated, since vswitch_id is not present in VNIC
    object, getattr call fails. Since this method is
    common to both CNA and VNIC, a default return value
    of None should be included in the list of parameters.

    networking_powervm/plugins/ibm/agent/powervm/util.py
    _find_vifs method :
     Instead of getattr(vif, 'vswitch_id')
     getattr(vif, 'vswitch_id', None) should be used.

    Change-Id: Ifcbf0a9b9d5eb9a326c93cac675b19a2fefca75c
    Closes-Bug: #1691584

tags: added: in-stable-ocata
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers