NAS (Network Attached Storage) is a network storage that provides file-level access to data. NAS can be used to store VM images and linked clones.
NAS restrictions
Migration of VMs with disks in a NAS is only available to another NAS or file storage.
GlusterFS
Using VMmanager cluster nodes as GlusterFS nodes is not supported. This can cause:
- VM and storage performance degradation due to resource access conflicts;
- risk of data loss and reduced storage availability due to high server load.
How NAS works
To connect a NAS to a cluster node, a cluster file system must be configured on the NAS device. A cluster file system is a system that can be used simultaneously by multiple servers. Such systems include NFS, OCFS2, GlusterFS, CephFS, GFS2, and others.
VMmanager cluster nodes access the NAS through a mounted directory that is specified when the storage is connected.
Configuring the file system
The configuration of NFS on servers with AlmaLinux OS is considered as an example. You can also use a file system based on OCFS2, GlusterFS, CephFS, or GFS2.
- On the storage server:
-
Create a directory for mounting. For example, /mnt/nfsshare/:
mkdir -p /mnt/nfsshare
-
Grant permissions to access the directory:
chown nobody:nobody /mnt/nfsshare
chmod 777 /mnt/nfsshare
-
Install the NFS server software:
dnf update -y
dnf -y install nfs-utils
-
Run the service and add it to the autostart:
systemctl start nfs-server.service
systemctl enable nfs-server.service
-
Add the IP addresses of the cluster nodes to the /etc/exports configuration file. To do this, run the command for each cluster node:
echo '/mnt/nfsshare <NODE_IP>(rw,async,no_subtree_check,no_root_squash)' >> /etc/exports && exportfs -vra
Comments to the command -
Allow connections to NFS in the firewall settings:
firewall-cmd --permanent --add-port=2049/tcp
firewall-cmd --reload
-
-
On the cluster nodes:
-
Install the NFS client software:
dnf -y install nfs-utils nfs4-acl-tools
-
Run the service and add it to the autostart:
systemctl start nfs-client.target
systemctl enable nfs-client.target
-
Create a directory to which the storage will be mounted. For example, /mnt/nas/:
mkdir -p /mnt/nas
-
Mount the storage:
If high availability is disabled in the clustermount.nfs4 <NAS_IP>:/mnt/nfsshare /mnt/nas
If high availability is enabled in the clustermount.nfs4 -o user,noauto,soft,timeo=5,retry=1 <NAS_IP>:/mnt/nfsshare /mnt/nas && chmod -R 777 /mnt/nas
Comments to the commands -
Add the mounted partition to the autostart. To do this, add a line to the /etc/fstab file:
<NAS_IP>:/mnt/nfsshare /mnt/nas nfs defaults 0 0
Comments
-
Related topics: