Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Requests are very slow(10-20s) when enabling libvirt polkit
Version-Release number of selected component (if applicable):
cockpit-machines-195.8-1.el7_8.noarch
libvirt-dbus-1.3.0-1.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Prepare a RHEL7.8 env with cockpit&libvirt. Login the cockpit web console with root, prepare 22 VMs.
I use guestfish do this:
# cd /tmp
# for (( i=1; i<=22; i++ )); do { guestfish -N test$i.img=fs & }; done
2. Create user sysadmin and add it to libvirt and libvirtdbus groups:
# useradd -G libvirt,libvirtdbus sysadmin
# passwd sysadmin
3. Login the cockpit web console use sysadmin, can see and manage the VM (Pause).
4. Change configuration in libvirt.conf:
# vi /etc/libvirt/libvirtd.conf
access_drivers = [ "polkit" ]
5. Restart libvirtd:
# systemctl restart libvirtd
6. Refresh the cockpit page several times, try to Pause the vm, it can not manage the vm and there will be an error message"access denied:'QEMU' denied access" .
Actual results:
Refresh the cockpit page,takes 10-20s to see the VMs on the page.
Expected results:
Vms can be listed faster
Additional info:
More info please refer to bug: https://bugzilla.redhat.com/show_bug.cgi?id=1780400
The same problem with different root cause,so file a new bug to track it.
The vms can not be listed at all occasionally , see bug: https://bugzilla.redhat.com/show_bug.cgi?id=1820469
Comment 3RHEL Program Management
2021-10-03 07:27:03 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.
Comment 10RHEL Program Management
2022-04-08 07:27:23 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.
I think the bug is getting better on RHEL9:
Packages:
cockpit-machines-269-1.el9.noarch
cockpit-269-1.el9.x86_64
libvirt-8.4.0-1.el9.x86_64
libvirt-dbus-1.4.1-5.el9.x86_64
1. Login the cockpit web console with root, prepare 25 VMs.
Use follow script to create multiple VMs
#!/bin/bash
time=$(date "+%Y-%-m-%-d")
a='B'
while [ $a != '_' ];do
vmName="fedora33-$time-$a"
diskPath="/var/lib/libvirt/images/$vmName.qcow2"
touch $diskPath
virt-install --name $vmName --os-variant fedora33 --memory 1 --wait -1 --disk $diskPath --print-xml=1 > /tmp/xml && virsh define /tmp/xml && virsh start $vmName
a=`echo $a | tr B-Z C-Z_`
done
2. Create user sysadmin and add it to libvirt and libvirtdbus groups:
# useradd -G libvirt,libvirtdbus sysadmin
3. Login the cockpit web console use sysadmin, can see and manage the VM (Pause).
4. Change configuration in libvirt.conf:
on RHEL9:
# vi /etc/libvirt/virtqemud.conf
access_drivers = [ "polkit" ]
5. On RHEL9, restart virtqemud:
# systemctl restart virtqemud
6. Refresh the cockpit page
There will be no vm listed
7. Add rules:
# cat /usr/share/polkit-1/rules.d/libvirt-dbus.rules
// Allow libvirt-dbus running in dedicated account to use libvirt
polkit.addRule(function(action, subject) {
if ((action.id == "org.libvirt.unix.manage" || action.id.indexOf("org.libvirt.api.") == 0) &&
subject.user == "libvirtdbus") {
return polkit.Result.YES;
}
});
6. Refresh the cockpit page, vms can be listed now, and it took several seconds to see the VMs on the page which is acceptable
Try to manage the vm, it can be managed .
I tried 2 env, one need about 5s to start to list vms, and totally 10s to see all the vms.
The other one need about 8s to start to list vms, and totally 15s to see all the vms.
7. Clear the vms:
# for arg in `virsh list --all| grep -i fedora33 |awk -F" " '{print $2}' `; do virsh destroy $arg ; done
Comment 16Jaroslav Suchanek
2022-06-29 14:49:08 UTC
Description of problem: Requests are very slow(10-20s) when enabling libvirt polkit Version-Release number of selected component (if applicable): cockpit-machines-195.8-1.el7_8.noarch libvirt-dbus-1.3.0-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Prepare a RHEL7.8 env with cockpit&libvirt. Login the cockpit web console with root, prepare 22 VMs. I use guestfish do this: # cd /tmp # for (( i=1; i<=22; i++ )); do { guestfish -N test$i.img=fs & }; done 2. Create user sysadmin and add it to libvirt and libvirtdbus groups: # useradd -G libvirt,libvirtdbus sysadmin # passwd sysadmin 3. Login the cockpit web console use sysadmin, can see and manage the VM (Pause). 4. Change configuration in libvirt.conf: # vi /etc/libvirt/libvirtd.conf access_drivers = [ "polkit" ] 5. Restart libvirtd: # systemctl restart libvirtd 6. Refresh the cockpit page several times, try to Pause the vm, it can not manage the vm and there will be an error message"access denied:'QEMU' denied access" . Actual results: Refresh the cockpit page,takes 10-20s to see the VMs on the page. Expected results: Vms can be listed faster Additional info: More info please refer to bug: https://bugzilla.redhat.com/show_bug.cgi?id=1780400 The same problem with different root cause,so file a new bug to track it. The vms can not be listed at all occasionally , see bug: https://bugzilla.redhat.com/show_bug.cgi?id=1820469