[one-users] failed to initialize KVM: Operation not permitted

Javier Fontan jfontan at opennebula.org
Thu Jun 20 02:55:19 PDT 2013


The change of ownership is needed because of these lines in libvirt:

--8<------
user = "oneadmin"
group = "oneadmin"
dynamic_ownership = 0
------>8--

OpenNebula daemons run as oneadmin and the files (images) it generates
are owned by that system user. KVM as default runs as root and changes
the images to root user. After that it is a bit tricky for oneadmin
user to manage them. Even more in an NFS filesystem.

To overcome this we change that configuration so the kvm process runs
as the same user as oneadmin and therefore we need to give the kvm
device permissions to be used by oneadmin user.



On Wed, Jun 19, 2013 at 4:41 PM, Jon <three18ti at gmail.com> wrote:
> The docs for the KVM driver say that it is necessary to change ownership of
> /dev/KVM to one admin.  I'm on Ubuntu, and changing the ownership caused
> this exact error (sorry, it was some weeks ago so I don't have the logs).
> Removing the udev rule and chowning /dev/kvm back to default resolved the
> error.
>
> I'm not recommending this course of action, as it is contrary to the docs
> and is likely indicative that I've done something wrong in my setup,
> however, I have not had any issues and therefore assigned a low priority on
> chasing the issue further.
>
> Maybe Javier can shed some light on why this step is required?
>
> Just my $0.02
>
> Best Regards,
> Jon A
>
> On Jun 19, 2013 7:44 AM, "Javier Fontan" <jfontan at opennebula.org> wrote:
>>
>> Can you check that kvm and kvm_intel or kvm_amd modules are loaded?
>>
>> On Tue, Jun 18, 2013 at 10:48 AM, Andranik Hayrapetyan
>> <andranik.h89 at gmail.com> wrote:
>> > Good day,
>> >
>> > My OpenNebula 4 installation was working fine, before I restarted the
>> > physical hosts.
>> > After a restart I get the following errors when I try to run an
>> > instance.
>> >
>> > Tue Jun 18 08:37:24 2013 [VMM][I]: error: Failed to create domain from
>> > /var/lib/one//datastores/0/11/deployment.0
>> > Tue Jun 18 08:37:24 2013 [VMM][I]: error: internal error process exited
>> > while connecting to monitor: open /dev/kvm: Permission denied
>> > Tue Jun 18 08:37:24 2013 [VMM][I]: failed to initialize KVM: Operation
>> > not
>> > permitted
>> > Tue Jun 18 08:37:24 2013 [VMM][I]: No accelerator found!
>> > Tue Jun 18 08:37:24 2013 [VMM][I]:
>> > Tue Jun 18 08:37:24 2013 [VMM][E]: Could not create domain from
>> > /var/lib/one//datastores/0/11/deployment.0
>> > Tue Jun 18 08:37:24 2013 [VMM][I]: ExitCode: 255
>> > Tue Jun 18 08:37:24 2013 [VMM][I]: Failed to execute virtualization
>> > driver
>> > operation: deploy.
>> > Tue Jun 18 08:37:24 2013 [VMM][E]: Error deploying virtual machine:
>> > Could
>> > not create domain from /var/lib/one//datastores/0/11/deployment.0
>> > Tue Jun 18 08:37:24 2013 [DiM][I]: New VM state is FAILED
>> >
>> >
>> > /etc/udev/rules.d/80-kvm.rules contains the following - KERNEL=="kvm",
>> > GROUP="oneadmin", MODE="0660"
>> >
>> > oneadmin is added to kvm group.
>> >
>> > Can anyone help me with this ?
>> >
>> > Thanks in advance!
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.opennebula.org
>> > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>> >
>>
>>
>>
>> --
>> Join us at OpenNebulaConf2013 in Berlin from the 24th to the 26th of
>> September 2013!
>>
>> Javier Fontán Muiños
>> Project Engineer
>> OpenNebula - The Open Source Toolkit for Data Center Virtualization
>> www.OpenNebula.org | jfontan at opennebula.org | @OpenNebula
>> _______________________________________________
>> Users mailing list
>> Users at lists.opennebula.org
>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org



-- 
Join us at OpenNebulaConf2013 in Berlin from the 24th to the 26th of
September 2013!

Javier Fontán Muiños
Project Engineer
OpenNebula - The Open Source Toolkit for Data Center Virtualization
www.OpenNebula.org | jfontan at opennebula.org | @OpenNebula



More information about the Users mailing list