[one-users] OpenNebula 3.4.1 - Error creating host for kvm

fc lists fclists at pr-z.info
Tue May 15 11:38:34 PDT 2012


In my environment i run it like this

Note that i run OPENNEBULA-3.4.1 ... your link point to 3.0 so if you are
running that it might be different:

/etc/libvirt/libvirtd.conf:
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
log_level = 2

/etc/libvirt/qemu.conf:
user = "oneadmin"
group = "oneadmin"
dynamic_ownership = 0

also:
# id oneadmin
uid=495(oneadmin) gid=495(oneadmin)
groups=495(oneadmin),6(disk),36(kvm),107(qemu)

[root at one-vmhost1 libvirt]# id qemu
uid=107(qemu) gid=107(qemu) groups=107(qemu),6(disk),36(kvm)

This gives me:

# ls -la /var/run/libvirt/|grep sock
srwxrwxrwx   1 root root    0 May 14 17:51 libvirt-sock
srwxrwxrwx   1 root root    0 May 14 17:51 libvirt-sock-ro

# ps -auxwww|grep -i libvirtd
Warning: bad syntax, perhaps a bogus '-'? See
/usr/share/doc/procps-3.2.8/FAQ
root     14857  1.4  0.7 1014556 14468 ?       Sl   May14  21:33 libvirtd
--daemon --listen
root     20922  0.0  0.0 103292   872 pts/0    S+   18:36   0:00 grep -i
libvirtd

and

oneadmin 23975 44.7  8.1 964248 167836 ?       Sl   May14 535:03
/usr/bin/kvm -S -M rhel6.2.0 -enable-kvm ... .... ...

As you can see my libvirtd run as root and starts kvm VM as oneadmin.

Hope it helps ... honestly i am not sure i really like it like this, i
tried to get libvirtd less privileges but i failed so far and just wanted
to get it running and test it.

If you can try upgrading to 3.4.1 (or whatever is latest now) and fix the
few conf like that.

Good luck :)

-FC



On Thu, May 10, 2012 at 8:37 AM, Mohit Dhingra <mohitdhingras at gmail.com>wrote:

> Hi,
>
> Thanks for your reply. /var/run/libvirt/  was accesible to the oneadmin.
> Going through the further search, we found the following:
>
> When we run the following executable, ( which is called by kvm.rb
>
> oneadmin at cloud:/var/tmp/one/im> ./run_probes kvm 21 cloud
>
> error: unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may
> need to be started: Connection refused
> error: failed to connect to the hypervisor
> ERROR MESSAGE --8<------
> Error executing kvm.rb
> ERROR MESSAGE ------>8--
> ARCH=x86_64 MODELNAME="Six-Core AMD Opteron(tm) Processor 2431"
> oneadmin at cloud:/var/tmp/one/im>
>
>
> Socket file is already there, created by root.
> srwxrwxrwx 1 root cloud 0 May 10 18:03 /var/run/libvirt/libvirt-sock
>
> We are not sure how to do the following (in documentation -
> http://www.opennebula.org/documentation:archives:rel3.0:kvmg )
> To be able to use the images copied by OpenNebula, change also the user
> and group under which the libvirtd is run to “oneadmin”.
>
> We tried restarting libvirtd as oneadmin,
>
> oneadmin at cloud:/var/tmp/one/im> /etc/init.d/libvirtd restart
> Shutting down libvirtd                                              done
> Starting libvirtd                                                   done
>
> Still, it didn't work. Any other clues?
>
> *
> ----------------------------
> Thanks & Regards
> Mohit Dhingra
> +919611190435*
>
>
>
> On 10 May 2012 00:27, fc lists <fclists at pr-z.info> wrote:
>
>> Hi
>>
>> did you find anything in the libvirt log that could be useful?
>>
>> Might want to check permissions on directories before the socket file
>>
>> is it /var/run/libvirt/ accessible to the user?
>>
>> Can't think og anything else right now , hope it helps :)
>>
>> FC
>>
>> On Wed, May 9, 2012 at 6:56 PM, Mohit Dhingra <mohitdhingras at gmail.com>wrote:
>>
>>> *Hello All,*
>>>
>>> We are trying to install OpenNebula with kvm as hypervisor, and getting
>>> some problem while creating host.
>>> We have googled the error, but of no use.
>>>
>>> Logs from oned.log file
>>>
>>> ------------------------------------------------------------------------------------------------
>>> Thu May 10 04:41:32 2012 [ReM][D]: HostPoolInfo method invoked
>>> Thu May 10 04:41:32 2012 [ReM][D]: HostPoolInfo method invoked
>>> Thu May 10 04:41:34 2012 [InM][I]: Monitoring host cloud (17)
>>> Thu May 10 04:41:34 2012 [ReM][D]: HostPoolInfo method invoked
>>> Thu May 10 04:41:34 2012 [ReM][D]: VirtualMachinePoolInfo method invoked
>>> Thu May 10 04:41:34 2012 [ReM][D]: AclInfo method invoked
>>> Thu May 10 04:41:34 2012 [InM][I]: ExitCode: 0
>>> Thu May 10 04:41:34 2012 [InM][I]: Command execution fail: 'if [ -x
>>> "/var/tmp/one/im/run_probes" ]; then /var/tmp/one/im/run_probes kvm 17
>>> cloud; else                              exit 42; fi'
>>> Thu May 10 04:41:34 2012 [InM][I]: error: unable to connect to
>>> '/var/run/libvirt/libvirt-sock', libvirtd may need to be started:
>>> Connection refused
>>> Thu May 10 04:41:34 2012 [InM][I]: error: failed to connect to the
>>> hypervisor
>>> Thu May 10 04:41:34 2012 [InM][E]: Error executing kvm.rb
>>> Thu May 10 04:41:34 2012 [InM][I]: ExitCode: 255
>>> Thu May 10 04:41:34 2012 [InM][E]: Error monitoring host 17 : MONITOR
>>> FAILURE 17 Error executing kvm.rb
>>>
>>> Thu May 10 04:41:39 2012 [ReM][D]: HostInfo method invoked
>>>
>>> --------------------------------------------------------------------------------------------------------------
>>>
>>>
>>> Also, libvirtd is running as oneadmin.
>>>
>>> oneadmin at cloud:~/var> ps -A -f | grep libvirt
>>> oneadmin  9295     1  0 04:40 ?        00:00:00 /usr/sbin/libvirtd -l -d
>>>
>>>
>>> And, we have done the changes in libvirtd.conf
>>> unix_sock_group = "cloud"
>>> unix_sock_rw_perms = "0777"
>>> listen_tcp = 1
>>>
>>> and in qemu.conf
>>> user = "oneadmin"
>>> group = "cloud"
>>> dynamic_ownership = 0
>>>
>>> And, in  50-localauthority.conf,
>>> Identity=unix-user:oneadmin
>>> Action=org.libvirt.unix.manage
>>> #Action=org.libvirt.unix.monitor
>>> ResultAny=yes
>>> ResultInactive=yes
>>> ResultActive=yes
>>>
>>>
>>> Is there something we are missing out.?? Can somebody please help us out.
>>>
>>>
>>> *
>>> ----------------------------
>>> Thanks & Regards
>>> Mohit Dhingra
>>> *
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opennebula.org
>>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120515/3f5d0574/attachment-0003.htm>


More information about the Users mailing list