Bug 869557

Summary: Can't add more than 256 logical networks
Product: Red Hat Enterprise Linux 6 Reporter: Meni Yakove <myakove>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.4CC: abaron, acathrow, bazulay, cpelland, danken, dyasny, dyuan, iheim, jdenemar, lpeer, mavital, mzhan, rvaknin, rwu, weizhan, whuang, ydu, ykaul, zhpeng
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: network scale
Fixed In Version: libvirt-0.10.2-1.el6 Doc Type: Bug Fix
Doc Text:
Previously, the fixed limit for the maximum size of an RPC message that could be supplied to the libvirtd daemon (65536 bytes) was not always sufficient. Consequently, messages that were longer than that could be dropped, leaving a client unable to fetch important data. With this update, the buffer for incoming messages has been made dynamic and libvirtd now allocates as much memory as is needed for a given message, thus allowing to send much bigger messages.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:10:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 869650    
Attachments:
Description Flags
vdsm.log none

Description Meni Yakove 2012-10-24 08:54:26 UTC
Created attachment 632622 [details]
vdsm.log

Description of problem:
libvirt version < 0.9.13 limit the network number to 256, If we add more then 256 networks libvirt return:
virsh -r net-list
error: Failed to list active networks
error: too many remote undefineds: 257 > 256
error: Reconnected to the hypervisor

and VDSM fails to report vdsCaps:
vdsClient -s 0 getVdsCaps
Unexpected exception 

Version-Release number of selected component (if applicable):
vdsm-4.9.6-38.0.el6_3.x86_64
libvirt-0.9.10-21.el6_3.5.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Create 260 networks and attache them to the host.

  
Actual results:
libvirt limit networks to 256 and VDSM non responsive.

Expected results:
Should be able to create more then 256 networks on libvirt and VDSM should be responsive even if libvirt fail.

Additional info:

Thread-3620::ERROR::2012-10-23 17:14:12,590::BindingXMLRPC::883::vds::(wrapper) libvirt error
Traceback (most recent call last):
  File "/usr/share/vdsm/BindingXMLRPC.py", line 879, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/BindingXMLRPC.py", line 288, in getCapabilities
    ret = api.getCapabilities()
  File "/usr/share/vdsm/API.py", line 1039, in getCapabilities
    c = caps.get()
  File "/usr/share/vdsm/caps.py", line 247, in get
    caps.update(netinfo.get())
  File "/usr/lib64/python2.6/site-packages/vdsm/netinfo.py", line 249, in get
    nets = networks()
  File "/usr/lib64/python2.6/site-packages/vdsm/netinfo.py", line 72, in networks
    for name in conn.listNetworks():
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 3240, in listNetworks
    messages.  Failure to do so may result in connections being closed
libvirtError: Cannot write data: Broken pipe
Thread-3621::ERROR::2012-10-23 17:14:13,093::BindingXMLRPC::883::vds::(wrapper) libvirt error
Traceback (most recent call last):
  File "/usr/share/vdsm/BindingXMLRPC.py", line 879, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/BindingXMLRPC.py", line 288, in getCapabilities
    ret = api.getCapabilities()
  File "/usr/share/vdsm/API.py", line 1039, in getCapabilities
    c = caps.get()
  File "/usr/share/vdsm/caps.py", line 247, in get
    caps.update(netinfo.get())
  File "/usr/lib64/python2.6/site-packages/vdsm/netinfo.py", line 249, in get
    nets = networks()
  File "/usr/lib64/python2.6/site-packages/vdsm/netinfo.py", line 72, in networks
    for name in conn.listNetworks():
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 3240, in listNetworks
    messages.  Failure to do so may result in connections being closed
libvirtError: Cannot write data: Broken pipe

Comment 1 Antoni Segura Puimedon 2012-10-24 08:59:52 UTC
The libvirt patch that lifts this arbitrary limit is:
eb635de - rpc: Size up RPC limits — Michal Privoznik

And it is included in libvirt 0.9.13. Thus, to fix this bug, we shall move the required libvirt version to >=0.9.13.

Comment 7 Jiri Denemark 2012-10-24 12:19:12 UTC
Fixed by v0.9.12-146-geb635de taken in when we rebased to 0.10.2:

commit eb635de1fed3257c5c62b552d1ec981c9545c1d7
Author: Michal Privoznik <mprivozn>
Date:   Fri Apr 27 14:49:48 2012 +0200

    rpc: Size up RPC limits
    
    Since we are allocating RPC buffer dynamically, we can increase limits
    for max. size of RPC message and RPC string. This is needed to cover
    some corner cases where libvirt is run on such huge machines that their
    capabilities XML is 4 times bigger than our current limit. This leaves
    users with inability to even connect.

Comment 10 Rami Vaknin 2012-10-26 19:24:13 UTC
Verified.

I reproduced this bug on RHEL6.3 with libvirt-0.9.10-21.el6_3.5.x86_64, then I've updated libvirt to libvirt-0.10.2-1.el6.x86_64, and I was able to attach much more than 256 vlan networks to host's nic:

At the moment:
# virsh -r net-list | wc -l
763

Comment 11 errata-xmlrpc 2013-02-21 07:10:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0276.html