Azure NetApp Files for NFS storage with Moodle

azure netapp files

Moodle is one of the most popular and widely adopted free, open-source learning management systems written in PHP. Acquiring more than 30{1f0cc4060f4fe9fc982bbd4bbe2778698630254e28c6e7cd32c637f8f4aaee17} market share globally, there are more than 180,000 Moodle customers worldwide. Moodle customers vary across industry verticals spanning Education Institutions, Enterprises, IT companies, FSI Institutions, etc.

Azure NetApp Files is an Azure service for migration and running the most demanding enterprise file-workloads in the cloud: native SMBv3.0 and NFS(v3.0 and v4.1) file shares, databases, SAP, and high-performance computing applications, with no code, changes.

Moodle architecture relies on NFS storage for content storage.

With Azure NetApp Files, we can set up native NFS v3 or NFS v4.1 volume. Steps for the same are listed here:

Pre-requisites

  • You need to have access to Azure portal and active subscription to provision resources
  • You must have already set up a capacity pool.
  • A subnet must be delegated to Azure NetApp Files.
  • The NFS client should be in the same VNet or peered VNet as the Azure NetApp Files volume. Connecting from outside the VNet is supported; however, it will introduce additional latency and decrease overall performance.
  • Ensure that the NFS client is up-to-date and running the latest updates for the operating system.

Create an Azure NFS volume

  1. Click the Volumes blade from the Capacity Pools blade. Click + Add volume to create a volume.
    1. In the Create a Volume window, click Create, and provide information for the following fields under the Basics tab:
      • Volume name
        Specify the name for the volume that you are creating.
  2. A volume name must be unique within each capacity pool. It must be at least three characters long. You can use any alphanumeric characters.You cannot use default or bin as the volume name.
    • Capacity pool
      Specify the capacity pool where you want the volume to be created.
    • Quota
      Specify the amount of logical storage that is allocated to the volume.

    The Available quota field shows the amount of unused space in the chosen capacity pool that you can use towards creating a new volume. The size of the new volume must not exceed the available quota.

    • Throughput (MiB/S)
      If the volume is created in a manual QoS capacity pool, specify the throughput you want for the volume.

    If the volume is created in an auto QoS capacity pool, the value displayed in this field is (quota x service level throughput).

    • Virtual network
      Specify the Azure virtual network (VNet) from which you want to access the volume.

    The VNet you specify must have a subnet delegated to Azure NetApp Files. The Azure NetApp Files service can be accessed only from the same VNet or from a VNet that is in the same region as the volume through VNet peering. You can also access the volume from your on-premises network through Express Route.

    • Subnet
      Specify the subnet that you want to use for the volume.
      The subnet you specify must be delegated to Azure NetApp Files.
  3. If you have not delegated a subnet, you can click Create new on the Create a Volume page. Then in the Create Subnet page, specify the subnet information, and select Microsoft.NetApp/volumes to delegate the subnet for Azure NetApp Files. In each VNet, only one subnet can be delegated to Azure NetApp Files
  4.  Click Protocol, and then complete the following actions:
    • Select NFS as the protocol type for the volume.
    • Specify the file path that will be used to create the export path for the new volume. The export path is used to mount and access the volume.
      The file path name can contain letters, numbers, and hyphens (“-“) only. It must be between 16 and 40 characters in length. The file path must be unique within each subscription and each region
    • Click Review + Create to review the volume details. Then click Create to create the volume.
    • The volume you created appears in the Volumes page.Azure NetApp Files NFS v3 volumes support NFS multipathing with nconnect in many Linux Client OS. For Best performance, it is recommended to size the VM SKUs correctly to support Azure accelerated networking and nconnect while deploying VMs in the Scale-Set, in addition to checking guest OS support for nconnect.

      Instructions for mounting ANF NFS volumes on Moodle application server(s) are as below:

      You can mount or unmount a volume for Windows or Linux virtual machines as necessary. The mount instructions for Linux virtual machines are available on Azure NetApp Files:

      Requirements

      • You must have at least one export policy to be able to access an NFS volume.
      • To mount an NFS volume successfully, ensure that the following NFS ports are open between the client and the NFS volumes:
      • 111 TCP/UDP = RPCBIND/Portmapper
      • 635 TCP/UDP = mountd
      • 2049 TCP/UDP = nfs
      • 4045 TCP/UDP = nlockmgr (NFSv3 only)
      • 4046 TCP/UDP = status (NFSv3 only)

       

    • Steps
      1. Click the Volumes blade, and then select the volume for which you want to mount.
      2. Click Mount instructions from the selected volume, and then follow the instructions to mount the volume
      3.  If you are mounting an NFS volume, ensure that you use the vers option in the mount command to specify the NFS protocol version that corresponds to the volume you want to mount
      4. If you are using NFSv4.1, use the following command to mount your file system: sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=4.1,tcp,sec=sys $MOUNTTARGETIPADDRESS:/$VOLUMENAME $MOUNTPOINTNote

        If you use NFSv4.1, ensure that all VMs mounting the export use unique hostnames.

    • If you want to have an NFS volume automatically mounted when an Azure VM is started or rebooted, add an entry to the /etc/fstab file on the host.
      For example: $ANFIP:/$FILEPATH /$MOUNTPOINT nfs bg,rw,hard,noatime,nolock,rsize=65536,wsize=65536,vers=3,tcp,_netdev 0 0

      • $ANFIP is the IP address of the Azure NetApp Files volume found in the volume properties blade.
      • $FILEPATH is the export path of the Azure NetApp Files volume.
      • $MOUNTPOINT is the directory created on the Linux host used to mount the NFS export.

      NFS storage with Moodle application typically hosts a large number of files and folders. Azure NetApp Files snapshot capabilities can be very useful with quick recovery of these files or folders or entire volumes or revert the entire volume from snapshot state.