<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Hello,<br>
<br>
We have some a problems using persistent KVM images in
Opennebula 3.0 RC1. <br>
<br>
Our configuration is as follows:<br>
<br>
Opennebula Front-End Ubuntu LTS 10.04<br>
KVM worker node Debian Queeze 6.0.2<br>
</font></font><font size="-1"><font face="Helvetica, Arial,
sans-serif">NAS for NFS Shared storage</font></font><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif"><br>
When we deploy a KVM virtual machine that uses an image marked
as persistent, deployment fails due to virsh "permission denied
access" to the registered image in the repository. The
deployment steps are as follows:<br>
<br>
1. Instance is launched in Sunstone<br>
2. tm_ln is launched and creates symbolic links to persistent
image (registered in /var/lib/one/images):<br>
<br>
~# ls -la /var/lib/one/212/images<br>
drwxrwxrwx 2 oneadmin oneadmin 4 2011-09-24 23:43 .<br>
drwxrwxrwx 3 oneadmin oneadmin 5 2011-09-24 23:43 ..<br>
-rw-r--r-- 1 oneadmin oneadmin 642 2011-09-24 23:43 deployment.0<br>
lrwxrwxrwx 1 oneadmin oneadmin 52 2011-09-24 23:43 disk.0 ->
/var/lib/one/images/c2c2dd2a258184994a3f6b953fb0343e<br>
<br>
3. User and group permissions of persistent image in repository
change from oneadmin:oneadmin to libvirt-qemu:kvm for a second
and finally to root:root:<br>
<br>
Before deployment:<br>
<br>
</font></font><font size="-1"><font face="Helvetica, Arial,
sans-serif">~# ls -la /var/lib/one/images</font></font><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif">-rw-rw----
1 oneadmin oneadmin 33285996544 2011-09-20 13:16
c2c2dd2a258184994a3f6b953fb0343e<br>
<br>
For a less than a second:<br>
<br>
</font></font><font size="-1"><font face="Helvetica, Arial,
sans-serif">~# ls -la /var/lib/one/images</font></font><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif">-rw-rw----
1 libvirt-qemu kvm 33285996544 2011-09-20 13:16
c2c2dd2a258184994a3f6b953fb0343e</font></font><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif"><br>
After a failed deployment:<br>
<br>
</font></font><font size="-1"><font face="Helvetica, Arial,
sans-serif">~# ls -la /var/lib/one/images</font></font><br>
<font size="-1"><font face="Helvetica, Arial, sans-serif">-rw-rw----
1 root root 33285996544 2011-09-20 13:16
c2c2dd2a258184994a3f6b953fb0343e<br>
<br>
4. Deployment fails a leaves persistent image with root:root
file permissions.<br>
<br>
Sat Sep 24 23:49:05 2011 [DiM][I]: New VM state is ACTIVE.<br>
Sat Sep 24 23:49:05 2011 [LCM][I]: New VM state is PROLOG.<br>
Sat Sep 24 23:49:05 2011 [VM][I]: Virtual Machine has no context<br>
Sat Sep 24 23:49:05 2011 [TM][I]: tm_ln.sh: Creating directory
/var/lib/one/212/images<br>
Sat Sep 24 23:49:05 2011 [TM][I]: tm_ln.sh: Executed "mkdir -p
/var/lib/one/212/images".<br>
Sat Sep 24 23:49:05 2011 [TM][I]: tm_ln.sh: Executed "chmod a+w
/var/lib/one/212/images".<br>
Sat Sep 24 23:49:05 2011 [TM][I]: tm_ln.sh: Link
/var/lib/one/images/c2c2dd2a258184994a3f6b953fb0343e<br>
Sat Sep 24 23:49:05 2011 [TM][I]: tm_ln.sh: Executed "ln -s
/var/lib/one/images/c2c2dd2a258184994a3f6b953fb0343e
/var/lib/one/212/images/disk.0".<br>
Sat Sep 24 23:49:05 2011 [TM][I]: ExitCode: 0<br>
Sat Sep 24 23:49:05 2011 [LCM][I]: New VM state is BOOT<br>
Sat Sep 24 23:49:05 2011 [VMM][I]: Generating deployment file:
/var/lib/one/212/deployment.0<br>
Sat Sep 24 23:49:05 2011 [HKM][I]: ExitCode: 0<br>
Sat Sep 24 23:49:08 2011 [VMM][I]: Command execution fail: 'if [
-x "/var/lib/one/remotes/vmm/kvm/deploy" ]; then
/var/lib/one/remotes/vmm/kvm/deploy
/var/lib/one/212/images/deployment.0 tc-kvm-hv02 212
tc-kvm-hv02; else exit 42; fi'<br>
Sat Sep 24 23:49:08 2011 [VMM][I]: error: Failed to create
domain from /var/lib/one/212/images/deployment.0<br>
Sat Sep 24 23:49:08 2011 [VMM][I]: error: internal error process
exited while connecting to monitor: qemu: could not open disk
image /var/lib/one/212/images/disk.0: Permission denied<br>
Sat Sep 24 23:49:08 2011 [VMM][I]:<br>
Sat Sep 24 23:49:08 2011 [VMM][E]: Could not create domain from
/var/lib/one/212/images/deployment.0<br>
Sat Sep 24 23:49:08 2011 [VMM][I]: ExitCode: 255<br>
Sat Sep 24 23:49:08 2011 [VMM][E]: Error deploying virtual
machine: Could not create domain from
/var/lib/one/212/images/deployment.0<br>
Sat Sep 24 23:49:08 2011 [DiM][I]: New VM state is FAILED<br>
Sun Sep 25 00:07:09 2011 [DiM][I]: New VM state is DONE.<br>
Sun Sep 25 00:07:10 2011 [TM][W]: Ignored: LOG I 212
tm_delete.sh: Deleting /var/lib/one/212/images<br>
Sun Sep 25 00:07:10 2011 [TM][W]: Ignored: LOG I 212 ExitCode: 0<br>
Sun Sep 25 00:07:10 2011 [TM][W]: Ignored: TRANSFER SUCCESS 212
-<br>
<br>
When we create a new deployment changing the same registered
image to non-persistent mode (and restoring its file access
permissions to oneadmin:oneadmin in /var/lib/one/images), the
instance is deployed correctly, the image is cloned and executed
by the KVM worked node without problems. <br>
<br>
~# ls -laR /var/lib/one/212<br>
total 14<br>
drwxrwxrwx 3 oneadmin oneadmin 5 2011-09-25 00:16 .<br>
drwxr-xr-x 198 oneadmin oneadmin 208 2011-09-25 00:09 ..<br>
-rw-r--r-- 1 oneadmin oneadmin 642 2011-09-25 00:16
deployment.0<br>
drwxrwxrwx 2 oneadmin oneadmin 4 2011-09-25 00:16 images<br>
-rw-r--r-- 1 oneadmin oneadmin 116 2011-09-25 00:09
transfer.0.prolog<br>
<br>
182/images:<br>
total 16471867<br>
drwxrwxrwx 2 oneadmin oneadmin 4 2011-09-25 00:16 .<br>
drwxrwxrwx 3 oneadmin oneadmin 5 2011-09-25 00:16 ..<br>
-rw-r--r-- 1 oneadmin oneadmin 642 2011-09-25 00:16
deployment.0<br>
-rw-rw-rw- 1 hacluster postdrop 33285996544 2011-09-25 00:18
disk.0<br>
<br>
Please, can you give us any clue regarding this issue?.
Persistent mode for KVM VMs is essential for us...<br>
<br>
BTW, oneadmin is member of kvm group in worker node.<br>
<br>
Best Regards,<br>
Alberto Picón<br>
</font></font>
</body>
</html>