How to Launch a NFS Server using CycleCloud?
Go to CycleCloud Wizard home page -> Select NFS and follow the instructions:
- Check if the OS image is from the marketplace, which may have additional fees. (The default one is from the marketplace.)
- Make sure the VM supports the image and make sure the storage is > 0.
Before we launch NFS server, if we want to use
xfs_quotato control individual’s quota, we need to make sure the mount option supportsuquota, gquota, pquotain the NFS server:Go to CycleCloud Wizard NFS page -> Click the VM Edit, in Software, Configuration text box and update
cyclecloud.mounts.nfs.options:1 2
cyclecloud.mounts.nfs.mountpoint = /mnt/exports cyclecloud.mounts.nfs.options = rw, relatime, attr2, inode64, logbufs=8, logbsize=32k, uquota, gquota, pquota
The NFS server template provided by CycleCloud has mount option
noquotaby default, and it disablesxfs_quotaon the NFS server. We need to update this mount option before launching the server.After launching the NFS Server using CycleCloud, we need to mount it in the cluster. Go to edit the cluster:
Make sure the
<mount-point>folder is in the cluster.Network Attached Storage, Additional Filesystem Mount:
Form How to FS Type External NFS IP Address Internal IP address of the NFS server Mount Point Where the folder will be at in the cluster. ( <mount-point>)Export Path How the NFS exports the file (the CycleCloud default is /mnt/exports/data)Mount Options <mount options>used to mount the NFS server in the cluster
How to Set Up User Quota using xfs_quota
User Folder
1
2
3
sudo mkdir <user>
sudo chown <user>:<user> <user>
sudo chmod 750 <user>
User Quota
When enabling
xfs_quota, the NFS server will do additional operations like checking if user exceeds the limit before read/write. Quota enforcement happens on the NFS server (filer node), not the client (which is the cluster). So the mount option on the client side doesn’t actually control quota enforcement.
Make sure the mount option has
uquota,gquota,pquotain the NFS server:1
findmnt
Find the mounting point:
1
df -Th <mount-point>
Set the limit using
xfs_quota, the following sets a soft limit of10 MBand a hard limit of15 MBforuser:1
sudo xfs_quota -x -c 'limit bsoft=10m bhard=15m user' <mount-point>
Get the quota report:
1
sudo xfs_quota -x -c 'report -ubh' <mount-point>
Check that oversized creation of files are banned:
Create a
output.datwith file size2M.1
dd if=/dev/zero of=output.dat bs=2M count=1
How to Resize Volume
Go to Azure Portal -> NFS server Virtual Machine -> Disks ->Size + Performance
To prevent data loss, azure only allows disk size to scale up.
Make sure VM knows the disk is rescaled:
1
lsblk # the disk size should change after rescalingGrow the volume to the new size:
1
sudo xfs_growfs <mount-folder>Check if the volume size reflects correctly in the node:
1
df -Th <mount-folder>