Product SiteDocumentation Site

Chapter 3. Storage Setup

3.1. Linux-based NFS
CloudStack is designed to work with a wide variety of commodity and enterprise-grade storage. Local disk, NFS, iSCSI, and Fibre Channel, may be used depending on the hypvervisor. Storage type support for guest virtual disks differs based on hypervisor selection.
In this document we will only be covering simple NFS setup and configuration. Other methods are covered in the Installation Guide

3.1. Linux-based NFS

This section describes how to configure an NFS export on a standard Linux installation. Instructions in this section specifically apply to RHEL/CentOS/Fedora. Steps to setup other distributions may vary.
  1. Create a directory called /export. This can each be a directory in the root partition itself or a mount point for a large disk volume.
  2. After /export directory is created, run the following command to configure it as an NFS export.
    echo '/export *(rw,async,no_root_squash)' >> /etc/exports
    You may need to adjust the above command to suite your deployment needs, but keep in mind that each of your hosts will need access to this NFS share.
  3. Edit the /etc/sysconfig/nfs file and uncomment the following lines.
    LOCKD_TCPPORT=32803
    LOCKD_UDPPORT=32769
    MOUNTD_PORT=892
    RQUOTAD_PORT=875
    STATD_PORT=662
    STATD_OUTGOING_PORT=2020
    
  4. Edit the /etc/sysconfig/iptables file and add the following lines at the beginning of the INPUT chain.
    -A INPUT -m state --state NEW -p udp --dport 111 -j ACCEPT
    -A INPUT -m state --state NEW -p tcp --dport 111 -j ACCEPT
    -A INPUT -m state --state NEW -p tcp --dport 2049 -j ACCEPT
    -A INPUT -m state --state NEW -p tcp --dport 32803 -j ACCEPT
    -A INPUT -m state --state NEW -p udp --dport 32769 -j ACCEPT
    -A INPUT -m state --state NEW -p tcp --dport 892 -j ACCEPT
    -A INPUT -m state --state NEW -p udp --dport 892 -j ACCEPT
    -A INPUT -m state --state NEW -p tcp --dport 875 -j ACCEPT
    -A INPUT -m state --state NEW -p udp --dport 875 -j ACCEPT
    -A INPUT -m state --state NEW -p tcp --dport 662 -j ACCEPT
    -A INPUT -m state --state NEW -p udp --dport 662 -j ACCEPT
    
  5. Restart iptables
    # service iptables restart
  6. Start rpcbind (a prerequisiste) and NFS
    # service rpcbind start
    # service nfs start
  7. Configure nfs and rpcbind to start on boot
    # chkconfig rpcbind on
    # chkconfig nfs on
An NFS share is now setup at /export