[nova-compute] libvirt permission denied

asked 2015-10-02 02:58:12 -0500

etlars gravatar image

updated 2015-10-02 05:55:45 -0500

In Kilo,

since my local disk is too small, newly attaching a new disk, /data1 as following.

root@cn2:/var/lib/nova# df -h

Filesystem                    Size  Used Avail Use% Mounted on

/dev/sda5                      23G  1.7G   20G   8% /

...

/dev/mapper/vg_data-lv_data1  356G  703M  338G   1% /data1

and add a setting 'instances_path=/data1/instances' in nova.conf at compute node.

root@cn2:/data1# ls -la

total 28

drwxr-xr-x  4 nova nova  4096 16:51 .

drwxr-xr-x 25 root root  4096  10:07 ..

drwxr-xr-x  2 nova nova  4096 16:50 instances

drwx------  2 nova nova 16384 13:51 lost+found

root@cn2:/data1# pwd

/data1

root@cn2:/data1# ls -la instances/

total 8

drwxr-xr-x 2 nova nova 4096 16:50 .

drwxr-xr-x 4 nova nova 4096 16:51 ..

root@cn2:/data1#

but whenever creating an instance, nova-compute.log shows libvirt error as below:

libvirtError: internal error: process exited while connecting to monitor: 2015-10-02T07:02:25.031125Z qemu-system-x86_64: -drive file=/data1/instances/03e58fd3-b555-4aa3-91fa-5e6fcc15978a/disk,if=none,id=drive-virtio-disk0,format=qcow2,cache=none: could not open disk image /data1/instances/03e58fd3-b555-4aa3-91fa-5e6fcc15978a/disk: Could not open backing file: Could not open 
'/data1/instances/_base/d7607a887a4e5b41ec4b9ccdbf16d356ca6c9c0f': Permission denied

**instead of a setting 'instances_path=/data1/instances' in nova.conf at compute node,

symbolic link 'ln -s /data1/instances /var/lib/nova/' also shows the same errors.** 


no changes in /etc/libvirt/qemu.conf libvirt-bin.conf ...

what's the matter in this situation? plz help me...

edit retag flag offensive close merge delete

Comments

Please provide output of original namei -l /var/lib/nova/instances/_base/d7607a887a4e5b41ec4b9ccdbf16d356ca6c9c0f (if possible) and namei -l /data1/instances/_base/d7607a887a4e5b41ec4b9ccdbf16d356ca6c9c0f

rozie gravatar imagerozie ( 2015-10-09 10:25:57 -0500 )edit

Thanks Rozie root@cn3:/data1# namei -l instances/_base/51b905065bdec0adfe7306f6db3cd30c1a5a3865 f: instances/_base/51b905065bdec0adfe7306f6db3cd30c1a5a3865 drwxr-xr-x nova nova instances drwxr-xr-x nova nova _base -rw-r--r-- libvirt-qemu kvm 51b905065bdec0adfe7306f6db3cd30c1a5a3865

etlars gravatar imageetlars ( 2015-10-18 21:20:09 -0500 )edit

root@cn3:/data1# namei -l /var/lib/nova/ f: /var/lib/nova/ drwxr-xr-x root root / drwxr-xr-x root root var drwxr-xr-x root root lib drwxr-xr-x nova nova nova

etlars gravatar imageetlars ( 2015-10-18 21:20:19 -0500 )edit

and I changed user and group as 'root' in /etc/libvirt/qemu.conf root@cn3:/data1/instances/_base# namei -l /data1/instances/_base/51b9050--- f: /data1/instances/_base/51b9050--- drwxr-xr-x nova nova data1 drwxr-xr-x nova nova _base -rw-r--r-- root root 51b9050---

but the same error occured ...

etlars gravatar imageetlars ( 2015-10-18 23:28:34 -0500 )edit
1

On my Kilo it looks like. namei -l /var/lib/nova/instances/_base/ f: /var/lib/nova/instances/_base/ drwxr-xr-x root root / drwxr-xr-x root root var drwxr-xr-x root root lib drwxr-xr-x nova nova nova drwxr-xr-x nova nova instances drwxr-xr-x nova nova _base

Which makes sense, as nova writes there.

rozie gravatar imagerozie ( 2015-10-21 04:53:43 -0500 )edit