April 26, 2024 by CodeFlowerHorn
Setting Up NFS Storage in Apache CloudStack
NFS (Network File System) storage is a popular choice for primary and secondary storage solutions. NFS storage offers a shared file system approach, allowing multiple servers to access the same files concurrently over a network. Apache CloudStack is not limited to NFS you can explore other storage options.
Install NFS
apt install nfs-kernel-server -y
Setup static ip using netplan
After you paste the code below run netplan apply
If you want to use your management server as NFS storage skip this part
You must check first if you're using the correct gateway and if the IP to use is available
network:
version: 2
renderer: NetworkManager
ethernets:
enp0s3:
addresses: [192.168.1.100/24]
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
routes:
- to: default
via: 192.168.1.1
Create exports
echo "/export *(rw,async,no_root_squash,no_subtree_check)" > /etc/exports
mkdir -p /export/primary /export/secondary
exportfs -a
Configure NFS
sed -i -e 's/^RPCMOUNTDOPTS="--manage-gids"$/RPCMOUNTDOPTS="-p 892 --manage-gids"/g' /etc/default/nfs-kernel-server
sed -i -e 's/^STATDOPTS=$/STATDOPTS="--port 662 --outgoing-port 2020"/g' /etc/default/nfs-common
echo "NEED_STATD=yes" >> /etc/default/nfs-common
Restart NFS service
systemctl restart nfs-kernel-server