Adding KVM Host

Hello,
I am having an issue adding a KVM host. It appears with an error. Here is the var/log/one error
[Z0][ONE][E]: Error monitoring Host kvm (3): error: failed to connect to the hypervisor
error: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock’: Permission denied
ERROR MESSAGE --8<------
Error executing kvm.rb
ERROR MESSAGE ------>8–
ARCH=x86_64
MODELNAME=“Intel® Xeon® CPU E5-2680 v3 @ 2.50GHz”

Below are the qemu.conf and libvirtd.conf configurations
grep -vE ‘^($|#)’ /etc/libvirt/qemu.conf
vnc_listen = "0.0.0.0"
user = "oneadmin"
group = "oneadmin"
dynamic_ownership = 1

[root@devcloud-sb ~]# grep -vE ‘^($|#)’ /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
mdns_adv = 0
unix_sock_group = "oneadmin"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = “none”

and then I start service libvirtd restart and same issue. Any thoughts?

what output of
ls -l /var/run/libvirt/libvirt-sock

ls -l /var/run/libvirt/libvirt-sock
srwxrwx— 1 root oneadmin 0 Jul 29 07:42 /var/run/libvirt/libvirt-sock

“id oneadmin”

PS. And have you disabled selinux?

not sure what you mean “id oneadmin”

correct, selinux is disabled

http://www.manpagez.com/man/1/id/

What versions of ONE and Linux do you have?
Is oneadmin member of oneadmin?
And have you tried not using unix_sock_group and unix_sock_rw_perms?

Hi,
Here is the output
id oneadmin
uid=9869(oneadmin) gid=9869(oneadmin) groups=9869(oneadmin),6(disk)

We are using open nebula 5

I tried it with the commented unix_sock_group and unix_sock_rw_perms

Sat Jul 30 07:33:17 2016 [Z0][ReM][D]: Req:7200 UID:0 HostPoolInfo invoked
Sat Jul 30 07:33:17 2016 [Z0][ReM][D]: Req:7200 UID:0 HostPoolInfo result SUCCESS, "<HOST_POOL><ID…"
Sat Jul 30 07:33:20 2016 [Z0][ReM][D]: Req:4800 UID:0 HostPoolInfo invoked
Sat Jul 30 07:33:20 2016 [Z0][ReM][D]: Req:4800 UID:0 HostPoolInfo result SUCCESS, "<HOST_POOL><ID…"
Sat Jul 30 07:33:27 2016 [Z0][ReM][D]: Req:1632 UID:1 DocumentPoolInfo invoked , -2, -1, -1, 100
Sat Jul 30 07:33:27 2016 [Z0][ReM][D]: Req:1632 UID:1 DocumentPoolInfo result SUCCESS, "<DOCUMENT_POOL></DOC…"
Sat Jul 30 07:33:37 2016 [Z0][ONE][E]: Error monitoring Host kvma (4): error: failed to connect to the hypervisor
error: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock’: Permission denied
ERROR MESSAGE --8<------
Error executing kvm.rb
ERROR MESSAGE ------>8–
ARCH=x86_64
MODELNAME=“Intel® Xeon® CPU E5-2680 v3 @ 2.50GHz”

Sorry,
Also here is the version information for the ONE server operating system
NAME="Red Hat Enterprise Linux Server"
VERSION="7.2 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.2"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.2:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL=“https://bugzilla.redhat.com/

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.2"
Red Hat Enterprise Linux Server release 7.2 (Maipo)
Red Hat Enterprise Linux Server release 7.2 (Maipo

Will it work with unix_sock_rw_perms = “0777” ?

As far as I remember in earlier versions of opennebula it was needed to have dynamic_ownership = 0 in qemu.conf.

1 Like

changed the dynamic ownership
vnc_listen = "0.0.0.0"
user = "oneadmin"
group = "oneadmin"
dynamic_ownership = 0

Still cannot add the host. I am not sure what’s happening.

Have you restarted libvirtd after changing dynamic_ownership? Are there any error messages in the logs?

Thanks for you response. Yes, I ran a “service libvirtd restart” and status
Here is my qemu.conf
grep -vE ‘^($|#)’ /etc/libvirt/qemu.conf
vnc_listen = "0.0.0.0"
user = "oneadmin"
group = "oneadmin"
dynamic_ownership = 0

Here is my libvirtd.conf
grep -vE ‘^($|#)’ /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
mdns_adv = 0
unix_sock_group = "oneadmin"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = “none”

Here is what the oned.log looks like(the error appears periodically);

Tue Aug 2 06:43:19 2016 [Z0][VMM][I]: --Mark–
Tue Aug 2 06:43:26 2016 [Z0][MKP][D]: Monitoring marketplace OpenNebula Public (0)
Tue Aug 2 06:43:26 2016 [Z0][MKP][D]: Marketplace OpenNebula Public (0) successfully monitored.
Tue Aug 2 06:43:28 2016 [Z0][ReM][D]: Req:1408 UID:0 VirtualMachinePoolInfo invoked , -2, -1, -1, -1
Tue Aug 2 06:43:28 2016 [Z0][ReM][D]: Req:1408 UID:0 VirtualMachinePoolInfo result SUCCESS, "<VM_POOL></VM_POOL>"
Tue Aug 2 06:43:28 2016 [Z0][ReM][D]: Req:8048 UID:0 VirtualMachinePoolInfo invoked , -2, -1, -1, -1
Tue Aug 2 06:43:28 2016 [Z0][ReM][D]: Req:8048 UID:0 VirtualMachinePoolInfo result SUCCESS, "<VM_POOL></VM_POOL>"
Tue Aug 2 06:43:37 2016 [Z0][ONE][E]: Error monitoring kvmhost (4): error: failed to connect to the hypervisor
error: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock’: Permission denied
ERROR MESSAGE --8<------
Error executing kvm.rb
ERROR MESSAGE ------>8–
ARCH=x86_64
MODELNAME="Intel® Xeon® CPU E5-2680 v3 @ 2.50GHz

This is resolved. On the KVM host, I added oneadmin to the libvirt group. Restarted the libvirt service and was able to add the host. Thank you for responding, I do appreciate the effort.