I've got a server with multiple guests, and wanted to quickly check how
many of them had snapshots (and in turn, how many snapshots).
So I quickly wrote the below script to enumerate the snapshots using the
virDomainSnapshotListNames() API, and it turned out, one of the guests
had 1329 snaphots (created by a script for testing):
libvirt.libvirtError: too many remote undefineds: 1329 > 1024
DanPB on IRC said we could likely raise that limit:
"we can likely increase that limit, since the rpc message size would
allow many more before the ultimate limit is hit"
He also points out the error message could be improved and is a sign of
a bug:
"'undefined' is a perl NULL that must come from a bug in the rpc
generator"
* * *
Script I used to test:
[ Version: libvirt-daemon-kvm-3.2.0-1.fc25.x86_64 ]
-----------------------------------------------------------------------
#!/usr/bin/python
import libvirt
import sys
conn = libvirt.openReadOnly('qemu:///system')
if conn == None:
print 'Failed to open connection to the hypervisor'
sys.exit(1)
domains = conn.listAllDomains(0)
for name in domains:
try:
dom = conn.lookupByName(name.name())
except libvirt.libvirtError:
print "Domain %s not found" % name
sys.exit(1)
print("Name: %s, ID: %d, OSType: %s" % (name.name(), dom.ID(),
dom.OSType()))
# print(dom.listAllSnapshots())
print(dom.snapshotListNames())
-----------------------------------------------------------------------
Executing the above script throws (since the 'ostack1' guest apparently
had 1329 snapshots):
[...]
Name: cirros, ID: -1, OSType: hvm
[]
Name: compute, ID: -1, OSType: hvm
[]
Name: ostack1, ID: -1, OSType: hvm
Traceback (most recent call last):
File "enumerate-snapshots.py", line 23, in <module>
print(dom.snapshotListNames())
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2527, in
snapshotListNames
if ret is None: raise libvirtError ('virDomainSnapshotListNames() failed',
dom=self)
libvirt.libvirtError: too many remote undefineds: 1329 > 1024
[...]
--
/kashyap