NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
scottonaharley
Dec 19, 2016Aspirant
ReadyNAS 4220 NFS configuration
I'm trying to use some NFS shares for a virtual machine environment. It requires the following configuration: Change the ownership of the export directory, replacing directory_name with the name...
scottonaharley
Dec 21, 2016Aspirant
We are running 6.6.0 Firmware on the NAS
We want to use the NFS mount as a datastore over NFS as opposed to using ISCSI so we have the ability to snapshot the datastore and rsync the snapshots to a remote site as well as replicate the datastore to a local backup NAS.
We are using Ovirt (Open Virtualization manager version 3.5.3.1-1.el6
The manager requires the following options to be set: anonuid=36, anongid=36 and all_squash
We are aware that command line editing is not supported but there does not seem to be a way to set the above through the graphic interface (specifically the anonuid and anongid) and Ovirt doesn't seem to have any flexibility regarding these settings.
For testing purposes we did manually edit the exports file with the required settings and were able to successfully connect the VM Manager to the datastore via NFS. We are also able to connect using ISCSI but that severely limits the backup options available to us.
Skywalker
Dec 23, 2016NETGEAR Expert
You'd have to play some games with the systemd unit. Something like this should do the trick:
# sed '/EnvironmentFile=/ a ExecStartPre=/bin/sed -i s/99/36/g /etc/exports' /lib/systemd/system/nfs-kernel-server.service > /etc/systemd/system/nfs-kernel-server.service # systemctl daemon-reload # systemctl restart nfs-kernel-server
- ian-edgelpJan 25, 2017AspirantAfter a little tinkering, I got this working reliably. I made this more specific since I don't want all of my shares having these parameters. Here's what I ended up with:sed "/EnvironmentFile=/ a ExecStartPre=/bin/sed -i '/vm_storage/ s/anongid=99,anonuid=99/anongid=36,anonuid=36/g' /etc/exports" /lib/systemd/system/nfs-kernel-server.service > /etc/systemd/system/nfs-kernel-server.servicesed -i "/ExecStartPre=\/bin\/sed/ a ExecStartPre=/bin/sed -i '/vm_storage/ s/insecure_locks/insecure_locks,all_squash/g' /etc/exports" /etc/systemd/system/nfs-kernel-server.serviceI'm still a bit squirrelly about this as changes in the GUI still overwrite the /etc/exports - I'm just assuming that nothing calls exportfs -a in between nfs service restarts. But my tests were successful, I could move or create a VM without having to refresh permissions.
- scottonaharleyJan 26, 2017Aspirant
I'm going to keep that solution in my pocket as a last resort. You're right to be concerned about the possibility of exportfs -a getting called after the exports file has been overwritten by the GUI. It's entirely possible that changes to another NFS share being used for non-virtualized connections could trigger that event. That's my concern as well. I'm pretty sure that Netgear is going to address this as RHEV represents a significant market segment to not support. It's really a matter of adding the configuration functionality to the GUI as the underlying O.S. supports the required settings. Hopefully there won't be a long wait for this.
- SkywalkerJan 30, 2017NETGEAR Expert
ian-edgelp wrote:
I'm still a bit squirrelly about this as changes in the GUI still overwrite the /etc/exports - I'm just assuming that nothing calls exportfs -a in between nfs service restarts.That's correct, nothing calls `exportfs -a` directly. It always goes through systemd, so the sed command should always be run.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!