Bug 963881

Summary: virDomainBlockInfo is failing on NFS when root_squash is enabled (Permission denied)
Product: Red Hat Enterprise Linux 6 Reporter: Federico Simoncelli <fsimonce>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: cwei, dyuan, eblake, fsimonce, gsun, iheim, juzhou, mzhan, rbalakri, sgotliv, ydu, zhwang
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.10.2-31.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 04:16:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1058749, 1128855    
Attachments:
Description Flags
The debuginfo about libvirt
none
the log about vdsm none

Description Federico Simoncelli 2013-05-16 17:35:12 UTC
Description of problem:
virDomainBlockInfo is failing on NFS when root_squash is enabled (Permission denied)

Version-Release number of selected component (if applicable):
libvirt-0.10.2-18.el6_4.4.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start a vm with a disk on NFS with root_squash enabled
2. virsh -r domblkinfo [domain] vda
  
Actual results:
# virsh -r domblkinfo VM2 vda
error: failed to open path '/rhev/data-center/10dbed3a-20c7-42d7-8c1a-862910e6c136/e0d636c4-10c3-44be-a0ce-26cb59c1631b/images/07284a98-3ad5-4751-b981-be90e8b170b9/185a18a5-ff18-4ca1-b186-5f4ae490543f': Permission denied


Expected results:
The command should be successful.

Comment 2 zhenfeng wang 2013-05-23 09:49:19 UTC
I can reproduce it on rhevm with libvirt-0.10.2-18.el6_4.4.x86_64
pkginfo
kernel-2.6.32-358.2.1.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.355.el6_4.3.x86_64
libvirt-0.10.2-18.el6_4.4.x86_64

steps
1. Start a vm with a disk on NFS with root_squash enabled
2.# virsh -r domblkinfo nfs1 vda
error: failed to open path '/rhev/data-center/ef6ecccf-2ca5-4a00-8ebb-3f5676d4fb68/a4ca1c7c-ea33-4d6e-81c6-6605d45a82b3/images/7969dc43-15fb-47fc-84e1-78f11a3cd8ef/175885da-d47d-4843-adeb-75436c72dee0': Permission denied

# virsh  domblkinfo nfs1 vda
Please enter your authentication name: test
Please enter your password: 
error: failed to open path '/rhev/data-center/ef6ecccf-2ca5-4a00-8ebb-3f5676d4fb68/a4ca1c7c-ea33-4d6e-81c6-6605d45a82b3/images/7969dc43-15fb-47fc-84e1-78f11a3cd8ef/175885da-d47d-4843-adeb-75436c72dee0': Permission denied

Comment 3 Martin Kletzander 2013-05-23 13:06:14 UTC
Could you provide a debug logs?  Thanks

Comment 4 zhenfeng wang 2013-05-24 02:22:33 UTC
Created attachment 752439 [details]
The debuginfo about libvirt

Comment 5 zhenfeng wang 2013-05-24 02:23:30 UTC
Created attachment 752440 [details]
the log about vdsm

Comment 6 Martin Kletzander 2013-07-24 13:13:45 UTC
This should be fixed upstream now with commit v1.1.1-rc1-7-gb4a40dd:

commit b4a40dd92dc7e6f110b13f2353cb5343d1147227
Author: Martin Kletzander <mkletzan>
Date:   Fri May 24 18:26:26 2013 +0200

    Use qemuOpenFile in qemu_driver.c

Comment 13 zhoujunqin 2014-04-14 03:31:05 UTC
I can reproduce with libvirt-0.10.2-29.el6_5.7.x86_64
verified with libvirt-0.10.2-31.el6.x86_64.

Steps to reporduce with libvirt-0.10.2-29.el6_5.7.x86_64.
1. Start a vm with a disk on NFS with root_squash enabled
# virsh list 
 Id    Name                           State
----------------------------------------------------
 2     aa1                            running
2.# virsh -r  domblkinfo  aa1 vda
error: failed to open path '/var/lib/libvirt/nfs/aa1.img': Permission denied

# virsh domblkinfo a5d39767-51fe-81d6-1c17-048fadb8de89 vda
error: failed to open path '/var/lib/libvirt/nfs/aa1.img': Permission denied


Steps to verify with libvirt-0.10.2-31.el6.x86_64.
1. Start a vm with a disk on NFS with root_squash enabled
# virsh list 
 Id    Name                           State
----------------------------------------------------
 2     aa1                            running

2. # virsh -r domblkinfo aa1 vda
Capacity:       8589934592
Allocation:     2452307968
Physical:       2452307968

# virsh  domblkinfo aa1 vda
Capacity:       8589934592
Allocation:     2452307968
Physical:       2452307968

Verification passed, move to verified.

Comment 15 errata-xmlrpc 2014-10-14 04:16:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1374.html