"hzguanqiang"<hzguanqiang@corp.netease.com>
2013-Jul-15 08:01 UTC
[libvirt-users] Hotplug of disk devices in LXC failed with libvirt of version 1.0.2
Hi Daniel,
I noticed that the patch "Add support for hotplug/unplug of disk devices in
LXC" you wrote had been merged into libvirt of version 1.0.2.
But when I used this function, it report an error with details as following:
ubuntu@lxc:~$ vir attach-device instance-0000002c disk.xml --config
error: Failed to attach device from disk.xml
error: Unable to create device /proc/18377/root/dev/sdb: Permission denied
ubuntu@lxc:~$ vir attach-device instance-0000002c disk.xml
error: Failed to attach device from disk.xml
error: Unable to create device /proc/18377/root/dev/sdb: Permission denied
ubuntu@lxc:~$ cat disk.xml
<disk type='block' device='disk'>
<driver type='raw' cache='none'/>
<source dev='/dev/dm-0'/>
<target dev='sdb' bus='scsi'/>
</disk>
ubuntu@lxc:~$ ll /dev/dm-0
brw-rw---- 1 root disk 252, 0 Jul 15 03:39 /dev/dm-0
ubuntu@lxc:~$ dpkg -l|grep libvirt
ii libvirt-bin 1.0.2-0ubuntu11
programs for the libvirt library
ii libvirt0 1.0.2-0ubuntu11
library for interfacing with different virtualization systems
ii python-libvirt 1.0.2-0ubuntu11
libvirt Python bindings
And in this lxc vm, through dmesg the following information can be seen:
ubuntu@lxc2:~$ dmesg
[433287.227288] type=1400 audit(1373874475.861:55): apparmor="DENIED"
operation="mknod" info="Failed name lookup" error=-13
parent=1 profile="/usr/sbin/libvirtd" name="dev/sdb"
pid=1541 comm="libvirtd" requested_mask="c"
denied_mask="c" fsuid=0 ouid=0
What's the real problem and How can I fix it. I really appreciate your
help.
Thanks!
--------------
Best regards!
GuanQiang
2013-07-15
Gao feng
2013-Jul-15 08:33 UTC
Re: [libvirt-users] Hotplug of disk devices in LXC failed with libvirt of version 1.0.2
On 07/15/2013 04:01 PM, hzguanqiang wrote:> Hi Daniel, > > I noticed that the patch "Add support for hotplug/unplug of disk devices in LXC" you wrote had been merged into libvirt of version 1.0.2. > But when I used this function, it report an error with details as following: > > ubuntu@lxc:~$ vir attach-device instance-0000002c disk.xml --config > error: Failed to attach device from disk.xml > error: Unable to create device /proc/18377/root/dev/sdb: Permission denied > > ubuntu@lxc:~$ vir attach-device instance-0000002c disk.xml > error: Failed to attach device from disk.xml > error: Unable to create device /proc/18377/root/dev/sdb: Permission denied > > ubuntu@lxc:~$ cat disk.xml > <disk type='block' device='disk'> > <driver type='raw' cache='none'/> > <source dev='/dev/dm-0'/> > <target dev='sdb' bus='scsi'/> > </disk> >You should use attach-disk not attach-device. vir attach-disk instance-0000002c /dev/dm-0 sdb Thanks
"hzguanqiang"<hzguanqiang@corp.netease.com>
2013-Jul-15 09:18 UTC
Re: [libvirt-users] Hotplug of disk devices in LXC failed with libvirt of version 1.0.2
Hi, Gao Feng I've tried what you said, but still exists the problem: ubuntu@lxc:~$ vir attach-disk instance-0000002c /dev/dm-0 sdb error: Failed to attach disk error: Unable to create device /proc/10366/root/dev/sdb: Permission denied I think finding what it means by saying 'Unable to create device /proc/10366/root/dev/sdb: Permission denied' is the key. But anyway, thanks for your help!>On 07/15/2013 04:01 PM, hzguanqiang wrote: >> Hi Daniel, >> >> I noticed that the patch "Add support for hotplug/unplug of disk devices in LXC" you wrote had been merged into libvirt of version 1.0.2. >> But when I used this function, it report an error with details as following: >> >> ubuntu@lxc:~$ vir attach-device instance-0000002c disk.xml --config >> error: Failed to attach device from disk.xml >> error: Unable to create device /proc/18377/root/dev/sdb: Permission denied >> >> ubuntu@lxc:~$ vir attach-device instance-0000002c disk.xml >> error: Failed to attach device from disk.xml >> error: Unable to create device /proc/18377/root/dev/sdb: Permission denied >> >> ubuntu@lxc:~$ cat disk.xml >> <disk type='block' device='disk'> >> <driver type='raw' cache='none'/> >> <source dev='/dev/dm-0'/> >> <target dev='sdb' bus='scsi'/> >> </disk> >> > >You should use attach-disk not attach-device. > >vir attach-disk instance-0000002c /dev/dm-0 sdb
Reasonably Related Threads
- Re: Hotplug of disk devices in LXC failed with libvirt of version 1.0.2
- Re: Hotplug of disk devices in LXC failed with libvirt of version 1.0.2
- Re: Hotplug of disk devices in LXC failed with libvirt of version 1.0.2
- Problem about lxc-enter-namespace interface
- Re: Problem about lxc-enter-namespace interface