Error deploying vm: Could not create domain on CentOS 7 + KVM

Hi,

i’m new into OpenNebula and follow the Quickstar-Guide to making first steps. Every step works fine but i get the following error by running the virtual machine:

Thu Jul 2 09:46:40 2015 [Z0][DiM][I]: New VM state is ACTIVE.
Thu Jul 2 09:46:40 2015 [Z0][LCM][I]: New VM state is PROLOG.
Thu Jul 2 09:48:53 2015 [Z0][LCM][I]: New VM state is BOOT
Thu Jul 2 09:48:53 2015 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/1/deployment.4
Thu Jul 2 09:48:53 2015 [Z0][VMM][I]: ExitCode: 0
Thu Jul 2 09:48:53 2015 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Thu Jul 2 09:48:53 2015 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/kvm/deploy ‘/var/lib/one//datastores/0/1/deployment.4’ ‘kvm-node01.cyon.ch’ 1 kvm-node01.cyon.ch
Thu Jul 2 09:48:53 2015 [Z0][VMM][I]: error: Failed to create domain from /var/lib/one//datastores/0/1/deployment.4
Thu Jul 2 09:48:53 2015 [Z0][VMM][I]: error: can’t canonicalize path ‘/var/lib/one//datastores/0/1/disk.1’: Permission denied
Thu Jul 2 09:48:53 2015 [Z0][VMM][E]: Could not create domain from /var/lib/one//datastores/0/1/deployment.4
Thu Jul 2 09:48:53 2015 [Z0][VMM][I]: ExitCode: 255
Thu Jul 2 09:48:53 2015 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Thu Jul 2 09:48:53 2015 [Z0][VMM][E]: Error deploying virtual machine: Could not create domain from /var/lib/one//datastores/0/1/deployment.4
Thu Jul 2 09:48:53 2015 [Z0][DiM][I]: New VM state is FAILED

I have checked the permissions of the nfs-share at “/var/lib/one”; there are no permission problems to read and write on the node.

Do you have any ideas to bordering this failure?

Thank you!
csyseng

Further details about the installation:

Centos 7 (Frontendserver and KVM-Node) with OpenNebula Version 4.12.1

Any ideas?

Thank you.
csyseng

hi,

could you check if the same file in /var/lib/one is reachable from the node01 server as well ?
(as user oneadmin)
Cause might be that the master server can reach that disk, but the node can’t ?

hope this helps,

Hi Roland

ls on the frontend-server:

[oneadmin@mgt-one1 ~]$ ls -l  /var/lib/one/vms/1/deployment.4
-rw-r--r-- 1 oneadmin oneadmin 872 Jul  2 09:48 /var/lib/one/vms/1/deployment.4
[oneadmin@mgt-one1 ~]$ ls -l  /var/lib/one/datastores/0/1/
total 850228
-rw-rw-r-- 1 oneadmin oneadmin       873 Jul  2 09:48 deployment.4
-rw-r--r-- 1 oneadmin oneadmin 870252544 Jul  2 09:48 disk.0
-rw-r--r-- 1 oneadmin oneadmin    372736 Jul  2 09:48 disk.1
lrwxrwxrwx 1 oneadmin oneadmin        34 Jul  2 09:48 disk.1.iso -> /var/lib/one/datastores/0/1/disk.1

and on the node:

[oneadmin@kvm-node01 ~]$ ls -l  /var/lib/one/vms/1/deployment.4
-rw-r--r-- 1 oneadmin oneadmin 872 Jul  2 09:48 /var/lib/one/vms/1/deployment.4
[oneadmin@kvm-node01 ~]$ ls -l  /var/lib/one/datastores/0/1/
total 850228
-rw-rw-r-- 1 oneadmin oneadmin       873 Jul  2 09:48 deployment.4
-rw-r--r-- 1 oneadmin oneadmin 870252544 Jul  2 09:48 disk.0
-rw-r--r-- 1 oneadmin oneadmin    372736 Jul  2 09:48 disk.1
lrwxrwxrwx 1 oneadmin oneadmin        34 Jul  2 09:48 disk.1.iso -> /var/lib/one/datastores/0/1/disk.1

I have no problems with read and write from the node01 into /var/lib/one/. Strange is, that i setup and configuration the test-environment like the description in the Quickstart-Guide.

csyseng

hi, are you using a NFS datastore or a SSH system datastore ?

I think the NFS-Datastore. I setup the NFS-Mount on the Frontend-Server wich is described in the Quick-Start-Guide Chapter 1.4.

Here the output of “onedatastore list”

  ID NAME                SIZE AVAIL CLUSTER      IMAGES TYPE DS      TM      STAT
   0 system             14.6G 74%   -                 0 sys  -       shared  on  
   1 default            14.6G 74%   -                 1 img  fs      shared  on  
   2 files              14.6G 74%   -                 0 fil  fs      ssh     on

ok looks like a NFS setup - can you check if you’ve mounted the datastore the same on both servers ?
So the share might be mounted on /var/lib/one on the master, and as /var/lib/one/datastore on a host ?

Frontend-Server:

[root@mgt-one1 ~]# cat /etc/exports
/var/lib/one/ *(rw,sync,no_subtree_check,root_squash)

KVM-Node01:

[root@kvm-node01 ~]# df -h | grep one
192.168.200.111:/var/lib/one   15G  3.1G   11G  22% /var/lib/one

You said, to mount the nfs-share on the node under “/var/lib/one/datastore”? I have mounted it under “/var/lib/one/”.

mounting it as /var/lib/one is fine, as long as you mount it that way on all your physical servers.
i’m out of ideas with what I could determine so far, hope someone else knows a fix or pointer ?

GL

I faced this problem and using no_root_squash in the export parameter solved the problem for me :

/etc/exports
/var/lib/one/ *(rw,sync,no_subtree_check,no_root_squash)

1 Like

I had this issue with Ubuntu 14.04 after an upgrade from 4.12 to 4.14. I’m not sure how it occured but all new VMs were being blocked by apparmor. Even after setting the process with the aa-complain command I was still unable to get this to work. My only solution was to uninstall apparmor with sudo apt-get remove --purge apparmor

This solved the error, thank you. It would be good, to update the documentation.

It would be great if you could send a pull request to the documentation repository to contribute this suggestion.

Thanks!