The virtual disk of a virtual machine is the HDD image. Virtual disks are stored in a local or network storage. NFS is a network storage. It is slower that a local storage, we recommend using it only for locating additional virtual disks. For more information please refer to the article Network storages.
Installation
Execute the commands:
yum -y install nfs-utils nfs-utils-lib
service rpcbind restart
service nfs start
chkconfig rpcbind on
chkconfig nfs on
NFS configuration
Server configuration
-
Edit the /etc/exports file to get the following record::
/export <client_ip>(rw,sync,no_subtree_check,no_root_squash)
View details -
Execute the command to update the /etc/exports file:
exportfs -a
- Edit /etc/idmapd.conf: enter your domain name as Domain.
-
Execute the following commands to start idmapd and nfsserver:
/etc/init.d/idmapd start /etc/init.d/nfsserver start
Client configuration
- Edit /etc/idmapd.conf: enter your domain name as Domain.
-
Execute the command to start idmapd:
/etc/init.d/idmapd start
-
Mount the file system with the command:
mount -t nfs4 <servername>:/ <mntpath>
Note
The client and NFSv4 server must be bound to the same domain. Otherwise, it can lead to issues when creating and deleting virtual machines.
Firewall
Make sure you allow access to the NFS-server in Firewall :
iptables -A INPUT -s <ip>/<mask> -m state --state NEW -p tcp --dport 2049 -j ACCEPT
service iptables save
View details