After completing this section, you should be able to describe the purpose, use cases and storage choices when selecting persistent volumes for instances.
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.
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.
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.
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.
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.
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.
If the file system is not cluster aware, data corruption will occur.
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.
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 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-volume1Use 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-volume1A 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-volume1Users can log in to the instance and mount, format, and use the disk after attaching the volume.
You can create, manage, and delete volumes using the Dashboard.
To create a volume, navigate to → → and then click . In the field, enter the name of the volume. Select No source,empty volume, Image, or Volume from the list. The field defaults to tripleo because TripleO is used to deploy the overcloud. In the field, enter the size of the volume. The and can be left as default. Click .
To manage the volume, navigate to → → . Several management options are available.
To attach a volume to an instance, click to open the window. In the field, select the required instance. You can either keep the default , 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 . Click and then click to confirm. Notice the status of the volume changes to Available.
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