Description of problem: Can't set parameter 'parallel.connections'. Version-Release number of selected component (if applicable): python3-libvirt-5.6.0-1.module+el8.1.0+3891+3b51c436.x86_64 How reproducible: 100% Steps to Reproduce: # python Python 3.6.8 (default, Aug 29 2019, 22:00:26) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn = libvirt.open() >>> dconn = libvirt.open("qemu+ssh://10.73.73.57/system") >>> dom = conn.lookupByName('test') >>> dom.migrateSetMaxSpeed(1, 0) 0 >>> params_list = {'parallel.connections': 5} >>> flags = libvirt.VIR_MIGRATE_LIVE | libvirt.VIR_MIGRATE_PARALLEL >>> dom.migrate3(dconn, params_list, flags) libvirt: error : invalid argument: invalid type 'ullong' for parameter 'parallel.connections', expected 'int' Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1670, in migrate3 if ret is None:raise libvirtError('virDomainMigrate3() failed', dom=self) libvirt.libvirtError: invalid argument: invalid type 'ullong' for parameter 'parallel.connections', expected 'int' Actual results: As description Expected results: Can set parameter 'parallel.connections' and migration succeeds.
Flag VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY accidentally works but is also missing from the list of hints in libvirt-python implementation.
Upstream commits: commit ebd352515d75036bc1dd2018669c3a5efb5bcf3d Author: Pavel Hrdina <phrdina> Date: Mon Sep 23 12:59:18 2019 +0200 virDomainMigrate3Params: add missing parallel connections param commit 1c206858313619672d6eebd3989be13cc8281d26 Author: Pavel Hrdina <phrdina> Date: Mon Sep 23 12:53:01 2019 +0200 virDomainMigrate3Params: add missing bandwidth postcopy param
Verify with python3-libvirt-5.6.0-2.module+el8.1.0+4286+bc7b622c.x86_64. 1. Set parallel connections number and using 'netstat -tunapc | grep 4915 | grep ESTABLISHED' command to check. # python Python 3.6.8 (default, Aug 29 2019, 22:00:26) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn = libvirt.open() >>> dom = conn.lookupByName('test') >>> dom.migrateSetMaxSpeed(100, 0) 0 >>> dconn = libvirt.open("qemu+ssh://10.16.216.141/system") >>> dom.migrate3(dconn, {'parallel.connections': 5}, flags) <== Migration succeeds and using 'netstat' to get connections number is 6 <libvirt.virDomain object at 0x7efd23fd74a8> >>> dom.migrate3(dconn, {}, flags) <== Migration succeeds and using 'netstat' to get connections number is 3 <libvirt.virDomain object at 0x7efd2413e0b8> >>> dom.migrate3(dconn, {'parallel.connections': -1}, flags) <== Migration succeeds and using 'netstat' to get connections number is 256 <libvirt.virDomain object at 0x7efd2413e0b8> >>> dom.migrate3(dconn, {'parallel.connections': 255}, flags) <== Migration succeeds and using 'netstat' to get connections number is 256 <libvirt.virDomain object at 0x7efd24802828> 2. Some negative tests. >>> dom.migrate3(dconn, {'parallel.connections': 256}, flags) libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'migrate-set-parameters': Parameter 'multifd_channels' expects is invalid, it should be in the range of 1 to 255 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1670, in migrate3 if ret is None:raise libvirtError('virDomainMigrate3() failed', dom=self) libvirt.libvirtError: internal error: unable to execute QEMU command 'migrate-set-parameters': Parameter 'multifd_channels' expects is invalid, it should be in the range of 1 to 255 >>> dom.migrate3(dconn, {'parallel.connections': 0}, flags) libvirt: QEMU Driver error : internal error: unable to execute QEMU command 'migrate-set-parameters': Parameter 'multifd_channels' expects is invalid, it should be in the range of 1 to 255 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1670, in migrate3 if ret is None:raise libvirtError('virDomainMigrate3() failed', dom=self) libvirt.libvirtError: internal error: unable to execute QEMU command 'migrate-set-parameters': Parameter 'multifd_channels' expects is invalid, it should be in the range of 1 to 255 >>> dom.migrate3(dconn, "{'parallel.connections': 5}", flags) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1669, in migrate3 ret = libvirtmod.virDomainMigrate3(self._o, dconn__o, params, flags) TypeError: migration params must be a dictionary >>> dom.migrate3(dconn, None, flags) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1669, in migrate3 ret = libvirtmod.virDomainMigrate3(self._o, dconn__o, params, flags) TypeError: migration params must be a dictionary
Add a missing parameter for test steps. >>> flags = libvirt.VIR_MIGRATE_LIVE | libvirt.VIR_MIGRATE_PARALLEL
Add test steps for 'bandwidth.postcopy' with python3-libvirt-5.6.0-2.module+el8.1.0+4286+bc7b622c.x86_64. 1. Start migration with 'bandwidth.postcopy' parameter. # python Python 3.6.8 (default, Aug 29 2019, 22:00:26) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn = libvirt.open() >>> dom = conn.lookupByName('test') >>> dconn = libvirt.open("qemu+ssh://10.16.216.141/system") >>> flags = libvirt.VIR_MIGRATE_LIVE | libvirt.VIR_MIGRATE_POSTCOPY >>> dom.migrate3(dconn, {"bandwidth.postcopy": 4}, flags) <== Migration succeeds. <libvirt.virDomain object at 0x7efd24802828> 2. On other terminal, switch to postcopy mode and check migration maximum speed. # python Python 3.6.8 (default, Aug 29 2019, 22:00:26) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn = libvirt.open() >>> dom = conn.lookupByName('test') >>> dom.migrateStartPostCopy(0) 0 >>> dom.migrateGetMaxSpeed(libvirt.VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY) 4
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. https://access.redhat.com/errata/RHBA-2019:3723