vswitch should not be created if the query request timeout

Bug #1708321 reported by Ya Lian Pan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-zvm
New
Undecided
Unassigned

Bug Description

This is the case that an exception is raised due to the neutrn-zvm-agent tries to create a vswitch which is already existed. The agent did chceck whether the vswitch is existed before the creating, but got socket timeout error. This error is not been captured by the agent,which makes it continue to create the vswitch. That is the bug need to be fixed

See log below for details

2017-08-02 02:38:52.029 DEBUG neutron.plugins.zvm.common.xcatutils [-] Sending request to xCAT. xCAT-Server:10.32.203.220 Request-method:PUT URL:/xcatws/nodes/zhcp/dsh?userName=admin&format=json Headers:{'content-length': 84, 'content-type': 'text/plain'} Body:["command=/opt/zhcp/bin/smcli Virtual_Network_Vswitch_Query -T OPNCLOUD -s stgpriv"] {{(pid=6585) request /opt/stack/new/neutron/neutron/plugins/zvm/common/xcatutils.py:180}}
2017-08-02 02:42:52.946 DEBUG neutron.plugins.zvm.common.xcatutils [-] xCAT response: {'status': 200, 'reason': 'OK', 'message': '{"data":[{"data":["zhcp: Failed\\nzhcp: Return Code: -103\\nzhcp: Description: Socket timeout error\\nzhcp: "]},{"errorcode":["1"]}]}'} {{(pid=6585) request /opt/stack/new/neutron/neutron/plugins/zvm/common/xcatutils.py:197}}
2017-08-02 02:42:52.951 DEBUG neutron.plugins.zvm.common.xcatutils [-] no xCAT CA file specified, this is considered not secure {{(pid=6585) __init__ /opt/stack/new/neutron/neutron/plugins/zvm/common/xcatutils.py:119}}
2017-08-02 02:42:52.951 DEBUG neutron.plugins.zvm.common.xcatutils [-] Sending request to xCAT. xCAT-Server:10.32.203.220 Request-method:PUT URL:/xcatws/nodes/zhcp/dsh?userName=admin&format=json Headers:{'content-length': 131, 'content-type': 'text/plain'} Body:["command=/opt/zhcp/bin/smcli Virtual_Network_Vswitch_Create -T OPNCLOUD -n stgpriv -c 1 -q 8 -e 0 -t 2 -v 0 -p 0 -u 1 -G 0 -V -1"] {{(pid=6585) request /opt/stack/new/neutron/neutron/plugins/zvm/common/xcatutils.py:180}}
2017-08-02 02:42:54.226 DEBUG neutron.plugins.zvm.common.xcatutils [-] xCAT response: {'status': 200, 'reason': 'OK', 'message': '{"data":[{"data":["zhcp: Creating virtual switch stgpriv... Failed\\nzhcp: Return Code: 212\\nzhcp: Reason Code: 36\\nzhcp: Description: Virtual switch already exists",null]},{"errorcode":["1"]}]}'} {{(pid=6585) request /opt/stack/new/neutron/neutron/plugins/zvm/common/xcatutils.py:197}}
2017-08-02 02:42:54.232 CRITICAL neutron [-] Unhandled error: zvmException: zvmException: switch: stgpriv add failed, [[u'zhcp: Creating virtual switch stgpriv... Failed\nzhcp: Return Code: 212\nzhcp: Reason Code: 36\nzhcp: Description: Virtual switch already exists', None]]
2017-08-02 02:42:54.232 ERROR neutron Traceback (most recent call last):
2017-08-02 02:42:54.232 ERROR neutron File "/usr/bin/neutron-zvm-agent", line 25, in <module>
2017-08-02 02:42:54.232 ERROR neutron main()
2017-08-02 02:42:54.232 ERROR neutron File "/opt/stack/new/neutron/neutron/plugins/zvm/agent/zvm_neutron_agent.py", line 417, in main
2017-08-02 02:42:54.232 ERROR neutron agent = zvmNeutronAgent()
2017-08-02 02:42:54.232 ERROR neutron File "/opt/stack/new/neutron/neutron/plugins/zvm/agent/zvm_neutron_agent.py", line 64, in __init__
2017-08-02 02:42:54.232 ERROR neutron zvm_net = zvm_network.zvmNetwork()
2017-08-02 02:42:54.232 ERROR neutron File "/opt/stack/new/neutron/neutron/plugins/zvm/agent/zvm_network.py", line 50, in __init__
2017-08-02 02:42:54.232 ERROR neutron self._creat_networks()
2017-08-02 02:42:54.232 ERROR neutron File "/opt/stack/new/neutron/neutron/plugins/zvm/agent/zvm_network.py", line 64, in _creat_networks
2017-08-02 02:42:54.232 ERROR neutron self._vsws.append(zvmVswitch(self._zhcp, vsw, self._maps[vsw]))
2017-08-02 02:42:54.232 ERROR neutron File "/opt/stack/new/neutron/neutron/plugins/zvm/agent/zvm_network.py", line 40, in __init__
2017-08-02 02:42:54.232 ERROR neutron getattr(CONF.get(name), "rdev_list"), vid=vlan)
2017-08-02 02:42:54.232 ERROR neutron File "/opt/stack/new/neutron/neutron/plugins/zvm/common/xcatutils.py", line 285, in decorated_function
2017-08-02 02:42:54.232 ERROR neutron return function(*arg, **kwargs)
2017-08-02 02:42:54.232 ERROR neutron File "/opt/stack/new/neutron/neutron/plugins/zvm/common/utils.py", line 277, in add_vswitch
2017-08-02 02:42:54.232 ERROR neutron (name, result['data']))
2017-08-02 02:42:54.232 ERROR neutron zvmException: zvmException: switch: stgpriv add failed, [[u'zhcp: Creating virtual switch stgpriv... Failed\nzhcp: Return Code: 212\nzhcp: Reason Code: 36\nzhcp: Description: Virtual switch already exists', None]]
2017-08-02 02:42:54.232 ERROR neutron

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.