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
BASH

NFS configuration


Server configuration

  1. Edit the /etc/exports file to get the following record::

    /export <client_ip>(rw,sync,no_subtree_check,no_root_squash)
    BASH

    /export — path to the directory where virtual disk images are kept.

    <client_ip> — client IP-address.

  2. Execute the command to update the /etc/exports file:

    exportfs -a
    BASH
  3. Edit /etc/idmapd.conf: enter your domain name as Domain.

  4. Execute the following commands to start idmapd and nfsserver:

    /etc/init.d/idmapd start
    /etc/init.d/nfsserver start
    BASH

Client configuration

  1. Edit /etc/idmapd.conf: enter your domain name as Domain.
  2. Execute the command to start idmapd:

    /etc/init.d/idmapd start
    BASH
  3. Mount the file system with the command:

    mount -t nfs4 <servername>:/ <mntpath>
    BASH

Note

The client and NFSv4 server must 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
BASH
<ip>/<mask> — VMmanager IP address with the mask (e.g., 10.0.0.1/24).