NFS Storage for Linux-KVM

This article describes steps to configure NFS shared storage to get it working with your Platform9 Managed OpenStack (PMO) private cloud.

By default, PMO assumes certain locations on your linux server for storage of virtual machine data and image catalog data. However, you can customize these locations to better suit your environment.

Steps to Perform On the NFS Server

Follow the steps given below to configure the NFS server to customize the locations for virtual machine data and image catalog data.

Step 1 - Create and Export Shared Directories

Create two separate directories, one for virtual machine storage and another for image catalog storage. Let us assume that you want to create the directories, instances and imagelibrary for virtual machine storage and image catalog storage respectively. Run the following commands to create instances and imagelibrary directories under the /pf9 directory on your NFS server.

Bash
Copy

Modify /etc/exports to export these directories with appropriate permissions.

Bash
Copy

For more information on setting up NFS server on CentOS, refer to Setting up an NFS Server on CentOS.

Step 2 - Configure Iptables

Configure iptables and open appropriate NFS port to allow NFS traffic.

Bash
Copy

Steps to Perform On the Physical Servers to Be Added to Platform9 Managed OpenStack

The following steps must be performed on the physical servers or hosts that you wish to add to Platform9 Managed OpenStack.

Step 1 - Create User And Group

On each server that you plan to add to Platform9, create a pf9 user, a pf9group group with pf9 user being part of pf9group group. Make sure that the user and group have exact same UID and GIDs across all servers being added to Platform9. This step is critical for Platform9 to be able to register a virtual machine from one physical server to another. Suppose you would like to assign UID 1024 to pf9 user and GID 500 to pf9group group.

On CentOS:

Bash
Copy

On Ubuntu:

Bash
Copy

Step 2 - Mount NFS Directory for Virtual Machine Storage

Let us assume that your NFS server IP address is 10.1.1.1. On each Linux Server to be added to Platform9, mount the NFS directory that will store data for virtual machines. Suppose you would like to mount it to /mnt/nfs/instances.

Bash
Copy

If using nfsvers=3 in above mount command, please also disable file locking using option -o nolock.

Step 3 - Mount NFS Directory for Image Catalog Storage

In addition, on the Linux server that will also host image catalog, mount the NFS directory that will store data for image catalog. Suppose you would like to mount it to /mnt/nfs/imagelibrary.

Bash
Copy

Step 4 - Change Owner of Virtual Machine Storage and Image Catalog Storage

Now, change the owner of the virtual machine storage and the image catalog storage to pf9 user, by using the chown command.

Bash
Copy

You are now ready to add these servers to Platform9. During authorization of the servers, you can customize the location of virtual machine and image catalog storage and specify the NFS directories like we just configured above.

At this point, you can start using your NFS shared storage with your Platform9 Managed OpenStack private cloud.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard