CentOS 8.x Cloudstack 4.15 Setup NFS server

From Notes_Wiki

Home > CentOS > CentOS 8.x > Virtualization > Cloudstack 4.15 > Setup NFS server

Cloudstack needs a NFS server for secondary storage. This needs to be mounted on management server at some location (eg /mnt/secondary). This storage is used for storing VM images (templates) or iso files.

Cloudstack also needs primary storage that is writable by all cloudstack hosts. This could be a shared central storage with distributed filesystem mounted on all hosts in same location (eg /mnt/primary). We can also use NFS for primary storage. Once any VM is deployed using templates or iso, the disks for the VM are stored in primary storage.

To setup NFS server for secondary storage use:

  1. Set desired hostname
    hostnamectl set-hostname <desired-hostname>
  2. Create folder to be shared via NFS
    mkdir /mnt/secondary
  3. Install nfs-utils
    yum install -y nfs-utils
  4. Disable firewall
    systemctl disable firewalld
    systemctl stop firewalld
  5. Edit '/etc/exports' to export /mnt/secondary via NFS
    /mnt/secondary *(rw,async,no_root_squash,no_subtree_check)
  6. If there is any secondary disk of larger capacity planned for secondary storage mount it at /mnt/secondary (parted, mkfs.ext4, /etc/fstab, mount -a, df -h, etc.)
  7. Start required services:
    systemctl start rpcbind
    systemctl enable rpcbind
    systemctl start nfs-server
    systemctl enable nfs-server
  8. Export the filesystems defined in /etc/exports file
    exportfs -a


Mounting NFS on management server

On management server you can do the following:

  1. mkdir /mnt/secondary
  2. Edit /etc/fstab as follows:
    <nfs-server-ip-or-fqdn>:/mnt/secondary /mnt/secondary nfs defaults 0 0
  3. Mount the filesystem and validate
    mount -a
    df -h



There is older article on this at CentOS 7.x Cloudstack 4.11 Setup NFS for secondary and primary (if no central storage) storage



Home > CentOS > CentOS 8.x > Virtualization > Cloudstack 4.15 > Setup NFS server