[one-users] libvirt/kvm: Permission denied on PERSISTENT images

2014-01-29 Thread Daniel Dehennin
Hello,

Using ONE 4.2 on Debian wheezy.

I just upgrade the qemu and libvirt to wheezy backports to solve bad
interaction between emulated card and guest kernel[1].

Now I can not boot VMs with PERSISTENT images.

I found a thread[2] on the mailing-list which looked like my problem, I
made the checks without success.

My environment:
---

OS: Debian Wheezy
qemu-kvm: 1.7.0+dfsg-2~bpo70+2
libvirt-bin: 1.2.1-1~bpo70+1
ONE: 4.2, from OpenNebula deb packages
Datastores:
  - 0: local disk of each host
  - 1: NFS TM_MAD=qcow2

Test 1:
---

IMAGE_ID=114
PERSISTENT=NO

The VM boots fine

Test 2:
---

IMAGE_ID=114
PERSISTENT=YES

The VM FAILED.

The only difference is the use of a symlink, does someone know any issue
with libvirt/qemu to use disk images though symlink?

Regards.

oneadmin@nebula:~$ cat vms/1937/transfer.0.prolog
LN qcow2 
benjamin:/var/lib/one/datastores/1/5d2be6f9746fc3447be11c6621da87df 
igor:/var/lib/one//datastores/0/1937/disk.0 1937 1
CONTEXT ssh /var/lib/one/vms/1937/context.sh 
igor:/var/lib/one//datastores/0/1937/disk.1 1937 0

oneadmin@nebula:~$ cat vms/1937/deployment.0
domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'
nameone-1937/name
vcpu1/vcpu
cputune
shares21/shares
/cputune
memory524288/memory
os
type arch='x86_64'hvm/type
boot dev='hd'/
/os
devices
emulator/usr/bin/kvm/emulator
disk type='file' device='disk'
source file='/var/lib/one//datastores/0/1937/disk.0'/
target dev='vda'/
driver name='qemu' type='qcow2' cache='writeback'/
/disk
disk type='file' device='cdrom'
source file='/var/lib/one//datastores/0/1937/disk.1'/
target dev='hda'/
readonly/
driver name='qemu' type='raw'/
/disk
interface type='bridge'
source bridge='vsw'/
virtualport type='openvswitch'/
mac address='02:00:0a:00:2a:0e'/
model type='virtio'/
/interface
graphics type='vnc' listen='0.0.0.0' port='7837' keymap='fr'/
/devices
features
acpi/
/features
/domain

oneadmin@nebula:~$ cat /var/log/one/1937.log
Wed Jan 29 15:06:31 2014 [DiM][I]: New VM state is ACTIVE.
Wed Jan 29 15:06:32 2014 [LCM][I]: New VM state is PROLOG.
Wed Jan 29 15:06:46 2014 [LCM][I]: New VM state is BOOT
Wed Jan 29 15:06:46 2014 [VMM][I]: Generating deployment file: 
/var/lib/one/vms/1937/deployment.0
Wed Jan 29 15:06:46 2014 [VMM][I]: ExitCode: 0
Wed Jan 29 15:06:46 2014 [VMM][I]: Successfully execute network driver 
operation: pre.
Wed Jan 29 15:06:46 2014 [VMM][I]: Command execution fail: cat  EOT | 
/var/tmp/one/vmm/kvm/deploy '/var/lib/one//datastores/0/1937/deployment.0' 
'igor' 1937 igor
Wed Jan 29 15:06:46 2014 [VMM][I]: error: Failed to create domain from 
/var/lib/one//datastores/0/1937/deployment.0
Wed Jan 29 15:06:46 2014 [VMM][I]: error: Failed to open file 
'/var/lib/one//datastores/0/1937/disk.0': Premission denied
Wed Jan 29 15:06:46 2014 [VMM][E]: Could not create domain from 
/var/lib/one//datastores/0/1937/deployment.0
Wed Jan 29 15:06:46 2014 [VMM][I]: ExitCode: 255
Wed Jan 29 15:06:46 2014 [VMM][I]: Failed to execute virtualization driver 
operation: deploy.
Wed Jan 29 15:06:46 2014 [VMM][E]: Error deploying virtual machine: Could 
not create domain from /var/lib/one//datastores/0/1937/deployment.0
Wed Jan 29 15:06:47 2014 [DiM][I]: New VM state is FAILED

oneadmin@host:~/datastores/0/1937$ virsh -c qemu:///system create 
deployment.0
error: Failed to create domain from deployment.0
error: Failed to open file '/var/lib/one//datastores/0/1937/disk.0': 
Permission denied

oneadmin@host:~/datastores/0/1937$ ls -l disk.0
lrwxrwxrwx 1 oneadmin oneadmin 58 jan. 29 15:06 disk.0 - 
/var/lib/one/datastores/1/5d2be6f9746fc3447be11c6621da87df

oneadmin@host:~/datastores/0/1937$ ls -lL disk.0
-rw-rw 1 oneadmin oneadmin 1357250560 nov.  18 17:42 disk.0

root@host:~# grep -E '^(user|groud|dynamic)' /etc/libvirt/qemu.conf
user = oneadmin
dynamic_ownership = 0


Footnotes: 
[1]  http://paste.debian.net/plain/78845

[2]  
http://lists.opennebula.org/pipermail/users-opennebula.org/2013-February/022168.html

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF


pgpmX0zLVTBC_.pgp
Description: PGP signature
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] libvirt/kvm: Permission denied on PERSISTENT images

2014-01-29 Thread Daniel Dehennin
Hello, again,

The problem is libvirt specific:

2014-01-29 15:10:52.458+: 6566: debug : virStorageFileGetMetadata:1114 : 
path=/var/lib/one//datastores/0/1937/disk.0 format=9 uid=9869 gid=9869 probe=0
2014-01-29 15:10:52.458+: 6566: debug : 
virStorageFileGetMetadataRecurse:1046 : 
path=/var/lib/one//datastores/0/1937/disk.0 format=9 uid=9869 gid=9869 probe=0
2014-01-29 15:10:52.458+: 6566: debug : virStorageFileIsSharedFSType:1322 : 
Check if path /var/lib/one//datastores/0/1937/disk.0 with FS magic 61267 is 
shared
2014-01-29 15:10:52.458+: 6566: error : 
virStorageFileGetMetadataRecurse:1060 : Failed to open file 
'/var/lib/one//datastores/0/1937/disk.0': Permission denied
2014-01-29 15:10:52.458+: 6566: debug : virObjectUnref:256 : OBJECT_UNREF: 
obj=0x7ffa8b845330
2014-01-29 15:10:52.458+: 6566: debug : virFileClose:90 : Closed fd 42
2014-01-29 15:10:52.458+: 6566: debug : virObjectRef:293 : OBJECT_REF: 
obj=0x7ffa8b845330


I can do an “md5sum /var/lib/one//datastores/0/1937/disk.0”.

I'm asking on #virt@OFTC

Regards.
-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF


pgpX15odCXFyU.pgp
Description: PGP signature
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org