Chapter 6. Configure OpenStack to Use an NFS Back End (2024)

download

PDF

This chapter describes how to configure the OpenStack volume service (openstack-cinder-volume) to use an existing NFS server as an additional back end. In addition, this chapter also describes how to create a volume type that you can use to invoke to create volumes backed by the NFS share.

Prerequisites:

  • The NFS share that you will be using as a back end should already be properly configured.
  • The node hosting the OpenStack volume service should have read/write access to the NFS share.
  • You have root access to the node hosting the OpenStack volume service.

Assumptions:

  • Your OpenStack deployment was not provisioned through the Red Hat Enterprise Linux OpenStack Platform Installer.
  • Your OpenStack Block Storage service uses the default back end (which uses the back end name lvm, as deployed by Packstack).

6.1.Configure SELinux

If a client has SELinux enabled, you should also enable the virt_use_nfs Boolean if the client requires access to NFS volumes on an instance. To enable this Boolean (and make it persistent through reboots), run the following command as root:

# setsebool -P virt_use_nfs on

Run this command on all client hosts that require access to NFS volumes on an instance. This includes all Compute nodes.

6.3.Create a new back end definition

By default, Packstack creates a back end definition for LVM in /etc/cinder/cinder.conf:

[lvm]iscsi_helper=lioadmvolume_group=cinder-volumesiscsi_ip_address=volume_driver=cinder.volume.drivers.lvm.LVMISCSIDrivervolume_backend_name=lvm

After defining the NFS share in /etc/cinder/cinder.conf, you can now configure an additional back end definition for it. To do so:

  1. Log in as root to the node hosting the OpenStack volume service.
  2. Create a new definition for the NFS back end and set the volume service to use the file defining the NFS share (namely, /etc/cinder/nfs_share):

    # openstack-config --set /etc/cinder/cinder.conf nfs nfs_shares_config /etc/cinder/nfs_shares

    Here, we use the name nfsbackend as a definition name.

  3. Configure the volume service to use the NFS volume driver, namely cinder.volume.drivers.nfs.NfsDriver:

    # openstack-config --set /etc/cinder/cinder.conf nfs volume_driver cinder.volume.drivers.nfs.NfsDriver
  4. Define a volume back end name for the NFS back end (the following command uses the name nfs):

    # openstack-config --set /etc/cinder/cinder.conf nfs volume_backend_name nfsbackend
  5. Add any mount options (MOUNTOPTIONS) you need to the nfs_mount_options configuration key:

    # openstack-config --set /etc/cinder/cinder.conf nfs nfs_mount_options _MOUNTOPTIONS_

At this point, the following section should now appear in /etc/cinder/cinder.conf:

[nfs]nfs_shares_config = /etc/cinder/nfs_sharesvolume_driver = cinder.volume.drivers.nfs.NfsDrivervolume_backend_name = nfsbackendnfs_mount_options =

You can now enable the NFS back end. Back ends are enabled through the enabled_backends configuration key of /etc/cinder/cinder.conf. The default back end created by Packstack should already be listed there:

enabled_backends=lvm

Add the new NFS back end definition to this list, as in:

enabled_backends=lvm,nfs

Once the NFS back end is enabled, restart the OpenStack volume service:

# openstack-service restart cinder-volume

6.4.Create a volume type for the NFS back end

The new NFS back end is now available, but cannot be used yet when creating new volumes. To configure new volumes to use this NFS back end, you need to first create a volume type for it.

  1. View the existing volume types. By default, a volume type should already exist for the lvm back end (namely, iscsi):

     +--------------------------------------+-------+ | ID | Name | +--------------------------------------+-------+ | f8d31dc8-a20e-410c-81bf-6b0a971c61a0 | iscsi | +--------------------------------------+-------+
  2. Create a new volume type named nfstype for the NFS back end:

    # cinder type-create nfstype
  3. Configure the nfstype volume type to use the NFS back end through the back end’s name (namely, nfsbackend):

    # cinder type-key nfstype set volume_backend_name=nfsbackend
  4. Verify that the new type was created and configured correctly:

    +--------------------------------------+---------+| ID | Name |+--------------------------------------+---------+| bbff44b5-52b1-43d6-beb4-83aa2d20bc59 | nfstype || f8d31dc8-a20e-410c-81bf-6b0a971c61a0 | iscsi |+--------------------------------------+---------++-----------------------+-------+---------------------------------------+| ID | Name | extra_specs |+-----------------------+-------+---------------------------------------+|bbff44b5-~-83aa2d20bc59|nfstype|{u'volume_backend_name': u'nfsbackend'}||f8d31dc8-~-6b0a971c61a0| iscsi | {u'volume_backend_name': u'lvm'} |+-----------------------+-------+---------------------------------------+

Note

You can also create and configure volume types through the dashboard. For more information, see Section4.2.3, “Group Volume Settings with Volume Types”.

6.5.Test the new NFS back end

To test the new NFS back end, create a new volume named nfsvolume while invoking the volume type nfstype:

+---------------------+--------------------------------------+| Property | Value |+---------------------+--------------------------------------+| attachments | [] || availability_zone | nova || bootable | false || created_at | 2015-01-06T05:14:09.271114 || display_description | None || display_name | nfsvolume || encrypted | False || id | 0cd7ac45-622a-47b0-9503-7025bbedc8ed || metadata | {} || size | 1 || snapshot_id | None || source_volid | None || status | creating || volume_type | nfstype |+---------------------+--------------------------------------+

Once the volume is successfully created, check the NFS share (on the NFS server). A corresponding volume (whose name contains the ID of the newly-created volume) should appear there:

drwxrwxrwx. 2 root root 4.0K Jan 6 15:14 .drwxr-xr-x. 18 root root 4.0K Jan 5 04:03 ..-rw-rw-rw-. 1 nfsnobody nfsnobody 1.0G Jan 6 15:14+ +volume-0cd7ac45-622a-47b0-9503-7025bbedc8ed

Chapter 6. Configure OpenStack to Use an NFS Back End (2024)

FAQs

How to configure NFS in Linux 6? ›

1.4. 1 Setting up a New NFS Server
  1. Install the nfs-utils package. ...
  2. Create the directory where you will copy the full Oracle Linux Release 6 Media Pack DVD image, for example /var/OSimage/OL6.6 : # mkdir -p /var/OSimage/OL6.6.
  3. Edit the configuration file, /etc/exports , as follows.

What is NFS in OpenStack? ›

The Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems in 1984. An NFS server exports one or more of its file systems, known as shares . An NFS client can mount these exported shares on its own file system.

How does OpenStack cinder work? ›

Cinder is a Block Storage service for OpenStack. It virtualizes the management of block storage devices and provides end users with a self service API to request and consume those resources without requiring any knowledge of where their storage is actually deployed or on what type of device.

How to configure the NFS? ›

Create an NFS Share
  1. Create a directory to contain your shared files. Copy. ...
  2. Create a series of test files. Copy. ...
  3. Verify the files created successfully. Copy. ...
  4. Change permissions on the files. Copy. ...
  5. Define the share in /etc/exports . Each entry has the format export host1(options1) host2(options2) host3(options3) .

Where is NFS configuration file in Linux? ›

Configuring NFS/RPC server ports

For version 7 or below of these operating systems the configuration file is located at /etc/sysconfig/nfs. For version 8 or above of these operating systems the configuration file is located at /etc/nfs. conf.

Does anyone still use OpenStack? ›

Yes! Not only does NASA use OpenStack, in fact NASA helped developed OpenStack. NASA developed the OpenStack project Nova, the project which allows you to quickly access compute resources (bare metal, virtual machines, and containers).

What is OpenStack for dummies? ›

OpenStack is a cloud operating system that controls large pools of compute, storage, and networking resources throughout a datacenter, all managed and provisioned through APIs with common authentication mechanisms.

Why OpenStack failed? ›

While OpenStack fought its battles, buyers just kept sending cash and workloads to AWS, Azure and other hyperscale clouds. Warrilow thinks that happened because they offered the simplicity OpenStack hadn't been able to deliver. “Everyone says they want open, then they say they want easy,” he said.

How to setup NFS mount on Linux? ›

Automatically Mounting NFS File Systems with /etc/fstab

To automatically mount an NFS share when your Linux system starts up add a line to the /etc/fstab file. The line must include the hostname or the IP address of the NFS server, the exported directory, and the mount point on the local machine.

What is the default NFS version in RHEL 6? ›

The NFS protocol version used in Red Hat Enterprise Linux 6 is identified by the mount options nfsvers or vers . By default, mount will use NFSv4 with mount -t nfs . If the server does not support NFSv4, the client will automatically step down to a version supported by the server.

How to configure NFS in CentOS 6? ›

  1. Scenario.
  2. Install NFS in Server. [root@server ~]# yum install nfs* -y.
  3. Start NFS service. ...
  4. Install NFS in Client. ...
  5. Start NFS service in client. ...
  6. Create shared directories in server. ...
  7. Export shared directory on server. ...
  8. Mount shared directories in client.

How do I start NFS service in Linux 7? ›

How to setup NFS ?
  1. Installing nfs-utils. sudo su - yum install nfs-utils.
  2. Choose the directory to share. ...
  3. Add permissions and ownwership privilages to the shared directory. ...
  4. Start the nfs services. ...
  5. Configuring the exports file for sharing. ...
  6. Restart the service. ...
  7. Only for Centos 7,NFS service override.
Jul 15, 2020

Top Articles
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 5727

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.