Bookmark this page

Configuring Persistent Disks

Objectives

After completing this section, you should be able to describe the purpose, use cases and storage choices when selecting persistent volumes for instances.

Persistent Storage in Red Hat OpenStack Platform

As the domain operator, you may be asked to advise cloud users about application use cases for legacy server deployments. Cloud users can create system and data volumes as if they are installing bare metal enterprise systems. Those volumes can then be used to launch an instance or be attached to a running instance.

Red Hat OpenStack Platform (RHOSP) supports three types of persistent storage: block, object, and shared. Block storage is based on volumes, which are provided by the Block Storage service. Object storage is based on object containers provided by the Object Storage service. These containers can include folder and file objects, which are managed using the Object Storage service API. Self-service network storage is provided by the Shared File Systems service (Manila). Object Storage is explained in more detail in a later chapter.

The classroom setup uses Ceph for persistent storage. The storage services in OpenStack, such as Cinder, Glance, and Swift, can support various back-end choices, such as hardware storage arrays, local devices, and NAS and SAN solutions. In Ceph, persistent storage is allocated in chunks, called volumes, which are stored in a pool. Ceph stripes block device images across the entire Ceph cluster. The volumes continue to be managed by the Cinder service even when stored on the Ceph cluster.

In OpenStack, the volumes pool is created during overcloud deployment to support the Cinder service.

Persistent Volumes

Block storage, sometimes referred to as volume storage, provides persistent block storage to OpenStack instances. You can create volume-based system boot disks from images and use them to launch instances. Alternatively, you can create data volumes and attach them to running instances.

You can format data volumes with whichever file system is required, to provide persistent storage for an instance. You can also detach data volumes from one instance and attach to another. Data remains intact during this process. For example, if a compute node crashes, you can launch a new instance on another compute node and attach the block storage volume to it, data intact.

You can also attach a volume to several instances using the multiattach volume type. Alternatively, you can add multiple volumes to an instance, extending storage as required.

In RHOSP, block storage, provided by the Block Storage service, supports multiple back ends in the form of drivers. RHOSP provides volume drivers for several supported block storage types, including iSCSI, NFS, and Red Hat Ceph Storage.

The most common use cases for persistent storage include databases and file systems. It would not be effective to use ephemeral storage for either one of those use cases, because the data in a database, for example, must typically be persistent. Block storage is used to store persistent data on devices accessed in the same way as hard drives. Storage persists until it is deleted by a user, unlike ephemeral storage. A block storage volume can also be used to launch a cloud instance, for example when migrating a legacy server.

Supporting Legacy Application Storage Requirements

When migrating legacy applications to a cloud-based platform, two common methods are available. The first method involves moving an application from one environment to another without changing the architecture. This method is often chosen to reduce costs, delaying the need to redesign the application immediately.

The alternative, at one time considered more costly, is to refactor the application before moving it to a cloud environment. After the architecture has been changed to take full advantage of a cloud environment it is then redeployed.

Opinions have changed, however, and companies find that using the first method is more expensive and less efficient. The better approach is to redesign the application before moving it to a cloud environment. Forward planning before moving any non-native cloud application to a cloud environment is essential. If a move starts without sufficient operational design then the resulting move will likely be unsuccessful and more costly in the long run.

Using Multiattach

To support the migration of clustered systems, RHOSP now supports multiattach. This feature allows multiple instances to access a single block storage volume with read and write access simultaneously. This feature only works when using Ceph as the block storage back end, and the file system used must be cluster aware.

Warning

If the file system is not cluster aware, data corruption will occur.

Multiattach can also be used for a standby server that takes over a file system when the primary server fails. In this case the file system does not need to be cluster aware, because only one instance is using it at any one time. Legacy clusters with persistent clustered disks, for example GFS2 and DLM, require multiattach technology. Clusters are the primary use case for multiattach technology.

Several restrictions apply to multiattach volumes:

  • Multiattach volumes cannot make use of the live migration feature.

  • Volume encryption is not supported.

  • Read-only multiattach is not supported.

  • Multiattach volumes cannot be extended.

  • The volume type cannot be changed.

To attach a volume to multiple instances the multiattach flag must be set to True. The user must have the correct role and policy settings to set the flag to True. Red Hat OpenStack provides a unified CLI command, but some operations still require the use of individual component commands. Attaching a multiattach volume to an instance is one of these.

Managing Volumes Using the CLI

The openstack volume command is used to manage volumes using the CLI. The command is followed by arguments, for example create, delete, and show.

Creating a Volume

Creating a volume does not require an administrative privileges. The Volume name, Description, Type, Size, and Availability zone fields can be edited.

Use the openstack volume create command to create a volume. The --size option must be specified as well as the name of the volume.

[user@demo ~(user)]$ openstack volume create --size 1 demo-volume1

Deleting a Volume

Use the openstack volume delete command to delete a volume. The only necessary argument is the name of the volume.

[user@demo ~(user)]$ openstack volume delete demo-volume1

A volume is deleted by filling it with zeros. If an instance is deleted that has an attached volume, the volume is automatically detached from the instance, but it is not deleted. It can be attached to another instance, and the data within the volume remains intact.

Attaching a Volume to an Instance

A volume can be attached to a running instance. The status of a volume is either Available or In-Use. Use the openstack server add volume command to attach a volume to an instance. This command requires two arguments: the volume name and the instance name.

[user@demo ~(user)]$ openstack server add volume demo-server1 demo-volume1

Users can log in to the instance and mount, format, and use the disk after attaching the volume.

Managing Volumes using the Dashboard

You can create, manage, and delete volumes using the Dashboard.

To create a volume, navigate to ProjectVolumesVolumes and then click Create Volume. In the Volume Name field, enter the name of the volume. Select No source,empty volume, Image, or Volume from the Volume Source list. The Type field defaults to tripleo because TripleO is used to deploy the overcloud. In the Size (GiB) field, enter the size of the volume. The Availability Zone and Group can be left as default. Click Create Volume.

Figure 5.2: Creating a volume in the Dashboard

To manage the volume, navigate to ProjectVolumesVolumes. Several management options are available.

Figure 5.3: Managing a volume in the Dashboard

To attach a volume to an instance, click Manage Attachments to open the Manage Volume Attachments window. In the Attach To Instance field, select the required instance. You can either keep the default Device Name, or choose one. Notice that the status of the volume changes to Reserved, and then In-use.

To remove a volume from an instance, click Manage Attachments. Click Detach Volume and then click Detach Volume to confirm. Notice the status of the volume changes to Available.

Figure 5.4: Detaching a volume in the Dashboard

 

References

Further information is available in multiple sections of the Storage Guide for Red Hat OpenStack Platform at https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.0/html-single/storage_guide/index

Revision: cl110-16.1-4c76154