[clug] NFSv4 "Invalid argument"

George at Clug Clug at goproject.info
Thu Oct 16 04:19:59 MDT 2014


    Scott,

I have had some success with the virt-manager and NFS.  The issue
seems to be two fold, a) NFS version 4 is more complex and I do not
know how to use it, b)  that I was not using the correct option for
controlling the version of NFS _and_ in OpenFiler I had to set the NFS
share to no_root_squash  
This site
"https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/sect-shared-storage-nfs-migration.html"
gave me the idea to go and look in OpenFiler to see if I could change
the NFS shares (export) options, and I discovered that I could change
between the default of root_squash to no_root_squash. (of course
no_root_squash is not as secure).

===================================================================================
But I get the below error message when using virt-manager if I do not
use "# chmod -R 777 /var/lib/libvirt/images", so in the end I still
have to use permissions.
"The emulator may not have search permissions for the path
'/var/lib/libvirt/images/ISO/debian-7.5.0-amd64-DVD-1.iso'."
===================================================================================





I have not resolved the a) issue, but I have the b) option: "-o
vers=3"
# mount -t nfs -o vers=3 -v
192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1/kvm-images/images
/var/lib/libvirt/images

Previously I had used the wrong syntax; "nfsvers=3"
# mount -t nfs -o
auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800  -v
192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1

Now mounting the NFS share with option "-o vers=3" I can change the
permissions on the folders and files, see the below commands which
should explain things for you;

================================================================================
# umount 192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1/kvm-images/images

# mount -t nfs -o vers=3 -v
192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1/kvm-images/images
/var/lib/libvirt/images
mount.nfs: timeout set for Thu Oct 16 20:16:49 2014
mount.nfs: trying text-based options 'vers=3,addr=192.168.0.12'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.0.12 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.0.12 prog 100005 vers 3 prot UDP port 46829

# chown -R libvirt-qemu:root /var/lib/libvirt/images# ls -al 
/var/lib/libvirt/images
total 357439660
drwxrws---+ 3 libvirt-qemu root         4096 Oct 11 09:45 .
drwxr-xr-x  7 root         root         4096 Oct 16
20:02 ..
drwxrws---+ 2 libvirt-qemu root         4096 Oct 11 08:50 ISO
-rwxrwx---+ 1 libvirt-qemu root  21474836480 Oct 14 11:59 MC43.img
-rwxrwx---+ 1 libvirt-qemu root  21474836480 Oct 11 09:04 mc44.img
-rwxrwx---+ 1 libvirt-qemu root   3093430272 Oct 11 09:45 mc54.img
-rwxrwx---+ 1 libvirt-qemu root  21474836480 Oct 11 08:54
Minecraft1.img
-rwxrwx---+ 1 libvirt-qemu root  21474836480 Oct 11 08:57
Minecraft2.img
-rwxrwx---+ 1 libvirt-qemu root   8589934592 Oct 11 09:05
SmoothWall01.img
-rwxrwx---+ 1 libvirt-qemu root 268435456000 Oct 11 09:45
Win8Ent01.img

=====================================================================================
Now to put the permissons the way I wanted them
--------------------------------------------------
# chown -R libvirt-qemu:libvirt-qemu /var/lib/libvirt/images
# ls -al  /var/lib/libvirt/images
total 357439660
drwxrws---+ 3 libvirt-qemu libvirt-qemu         4096 Oct 11
09:45 .
drwxr-xr-x  7 root        
root                 4096 Oct 16 20:02 ..
drwxrws---+ 2 libvirt-qemu libvirt-qemu         4096 Oct 11
08:50 ISO
-rwxrwx---+ 1 libvirt-qemu libvirt-qemu  21474836480 Oct 14 11:59
MC43.img
-rwxrwx---+ 1 libvirt-qemu libvirt-qemu  21474836480 Oct 11 09:04
mc44.img
-rwxrwx---+ 1 libvirt-qemu libvirt-qemu   3093430272 Oct 11 09:45
mc54.img
-rwxrwx---+ 1 libvirt-qemu libvirt-qemu  21474836480 Oct 11 08:54
Minecraft1.img
-rwxrwx---+ 1 libvirt-qemu libvirt-qemu  21474836480 Oct 11 08:57
Minecraft2.img
-rwxrwx---+ 1 libvirt-qemu libvirt-qemu   8589934592 Oct 11 09:05
SmoothWall01.img
-rwxrwx---+ 1 libvirt-qemu libvirt-qemu 268435456000 Oct 11 09:45
Win8Ent01.img

And now the VM will run without an errors.

===================================================================================
But I get the below error messages when using virt-manager if I do not
use "# chmod -R 777 /var/lib/libvirt/images"

"The emulator may not have search permissions for the path
'/var/lib/libvirt/images/ISO/debian-7.5.0-amd64-DVD-1.iso'."



At Wednesday, 15-10-2014 on 22:01 Scott Ferguson wrote:


On 14/10/14 23:14, Scott Ferguson wrote:
> On 14/10/14 22:33, George at Clug wrote:
-----------------88------------------>
> There are a couple of ways that 'might' be dealt with (either change
the
> groups that virt-manager belongs to, change the ownership of the nfs
> share by remount/bind or /etc/exports). I'll have to have a think
about
> it overnight and maybe do a little research as to the safest way.
> 
-----------------88------------------

Sorry George, I've been unable to come up with a solution yet. If I
think of something later I'll post it. If you are still stuck I would
suggest the debian-user list and/or the support VMware support forum.

Good luck and kind regards.

-- 
linux mailing list
linux at lists.samba.org
https://lists.samba.org/mailman/listinfo/linux




More information about the linux mailing list