[clug] NFSv4 "Invalid argument"

George at Clug Clug at goproject.info
Fri Oct 17 19:41:46 MDT 2014


     Hi,

Previously I had mentioned that I was wondering how to use NFS shares
with Virt-Manager. Well I found a web site that explained, and it was
very simple, I had not understood that NFS shares used "netfs:".  

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/sect-Virtualization-Storage_Pools-Creating-NFS.html#idp16661888

Using the information in the above URL I used Virt-Manager to attach
to the OpenFiler NFS share. I then checked the mount for the OpenFiler
share to see what mount options Virt-Manager used (it was NFS4);

192.168.0.12:/mnt/vg2/vol1/san12_nfs_ds1/kvm-images/images on
/var/lib/libvirt/images/ofNFS type nfs4
(rw,relatime,vers=4,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.0.137,minorversion=0,local_lock=none,addr=192.168.0.12)

However when I attempted to create a virtual machine there was an
error, due to file permissions;

Unable to complete install: 'internal error Process exited while
reading console log output: char device redirected to /dev/pts/3
do_spice_init: starting 0.11.0
spice_server_add_interface: SPICE_INTERFACE_MIGRATION
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
kvm: -drive
file=/var/lib/libvirt/images/ofNFS/DebJessie.img,if=none,id=drive-virtio-disk0,format=qcow2:
could not open disk image /var/lib/libvirt/images/ofNFS/DebJessie.img:
Permission denied

After checking permissions I noticed that the VM img file was created
with 600 for nobody:nogroup, so I changed them to 666 on the img file
that and now I am able to create the virtual machine.  Much like the
issue I had previously when I was mapping the shares.

I am thinking that since Virt-Manager was able to create the virtual
machine's image but was not able to run the virtual machine, it is
likely that I have various user/group issues ?  However after
investigation I cannot see any misconfigurations with my user and
group assignments, I believe it is an issue with NFS 4 issue, but I do
not know enough about NFSv4, kvm & libvirt to know exactly what is
causing the issue. Well I don't need to use an NFS share, I would
prefer to use local storage, it is just I wanted to see if this was
possible and what might be any limitations.

# ls -al /var/lib/libvirt/images/ofNFS/
total 359169040
drwxrwsrwx 3 nobody nogroup         4096 Oct 18 00:46 .
drwx--x--x 6 root   root            4096 Oct 18 10:43 ..
-rwxrwxrwx 1 nobody nogroup   8589934592 Oct 16 10:25 Deb7Test.img
-rw-rw-rw- 1 nobody nogroup   1500971008 Oct 18 01:13 DebJessie.img
-rwxrwxrwx 1 nobody nogroup   8589934592 Oct 16 10:29 def2.img
drwxrwsrwx 2 nobody nogroup         4096 Oct 11 08:50 ISO

http://www.howtoforge.com/virtualization-with-kvm-on-a-debian-squeeze-server

https://www.whonix.org/wiki/KVM
addgroup "$(whoami)" libvirt
addgroup "$(whoami)" kvm

http://www.howtoforge.com/virtualization-with-kvm-on-a-debian-squeeze-server


Afterwards we must add the user as which we're currently logged in
(root) to the groups libvirt and kvm: 



adduser `id -un` libvirt
adduser `id -un` kvm


Groups;
cat /etc/group
kvm:x:120:gkirkham
libvirt:x:121:gkirkham
libvirt-qemu:x:122:libvirt-qemu,gkirkham





More information about the linux mailing list