Bookmark this page

Chapter 8. Implementing Advanced Storage Features

Abstract

Goal Manage storage using the Stratis local storage management system and use the VDO volumes to optimize storage space in use.
Objectives
  • Manage multiple storage layers using Stratis local storage management.

  • Optimize the use of storage space by using VDO to compress and deduplicate data on storage devices.

Sections
  • Managing Layered Storage with Stratis (and Guided Exercise)

  • Compressing and Deduplicating Storage with VDO (and Guided Exercise)

Lab

Implementing Advanced Storage Features

Managing Layered Storage with Stratis

Objectives

After completing this section, you should be able to manage multiple storage layers using Stratis local storage management.

Describing the Architecture of Stratis

Stratis is a new local storage-management solution for Linux. Stratis is designed to make it easier to perform initial configuration of storage, make changes to the storage configuration, and use advanced storage features.

Important

Stratis is available as a Technology Preview. For information on Red Hat scope of support for Technology Preview features, see the Technology Features Support Scope document.

Customers deploying Stratis are encouraged to provide feedback to Red Hat.

Stratis runs as a service that manages pools of physical storage devices and transparently creates and manages volumes for the newly created file systems.

In Stratis, file systems are built from shared pools of disk devices using a concept known as thin provisioning. Instead of immediately allocating physical storage space to the file system when it is created, Stratis dynamically allocates that space from the pool as the file system stores more data. Therefore, the file system might appear to be 1 TiB in size, but might only have 100 GiB of real storage actually allocated to it from the pool.

You can create multiple pools from different storage devices. From each pool, you can create one or more file systems. Currently, you can create up to 224 file systems per pool.

The components that make up a Stratis-managed file system are built from standard Linux components. Internally, Stratis is implemented using the Device Mapper infrastructure that is also used to implement LVM, and Stratis-managed file systems are formatted using XFS.

The following diagram illustrates how the elements of the Stratis storage management solution are assembled. Block storage devices such as hard disks or SSDs are assigned to pools, each contributing some physical storage to the pool. File systems are created from the pools, and physical storage is mapped to each file system as it is needed.

Figure 8.1: Elements of Stratis

Working with Stratis Storage

To manage file systems with the Stratis storage management solution, install the stratis-cli and stratisd packages. The stratis-cli package provides the stratis command, which sends reconfiguration requests to the stratisd system daemon. The stratisd package provides the stratisd service, which handles reconfiguration requests and manages and monitors block devices, pools, and file systems that Stratis uses.

Warning

File systems created by Stratis should only be reconfigured with Stratis tools and commands.

Stratis uses stored metadata to recognize managed pools, volumes, and file systems. Manually configuring Stratis file systems with non-Stratis commands can cause the loss of that metadata and prevent Stratis from recognizing the file systems it created.

Installing and Enabling Stratis

To use Stratis, make sure that the software is installed and the stratisd service is running.

  • Install stratis-cli and stratisd using the yum install command.

    [root@host ~]# yum install stratis-cli stratisd
    ...output omitted...
    Is this ok [y/N]: y
    ...output omitted...
    Complete!
  • Activate the stratisd service using the systemctl command.

    [root@host ~]# systemctl enable --now stratisd

Assembling Block Storage into Stratis Pools

The following are common management operations performed using the Stratis storage management solution.

  • Create pools of one or more block devices using the stratis pool create command.

    [root@host ~]# stratis pool create pool1 /dev/vdb

    Each pool is a subdirectory under the /stratis directory.

  • Use the stratis pool list command to view the list of available pools.

    [root@host ~]# stratis pool list
    Name     Total Physical Size  Total Physical Used
    pool1                  5 GiB               52 MiB

    Warning

    The stratis pool list command is very important because it shows you how much storage space is in use (and therefore how much is still available) in the pools.

    If a pool runs out of storage, further data written to file systems belonging to that pool is quietly lost.

  • Use the stratis pool add-data command to add additional block devices to a pool.

    [root@host ~]# stratis pool add-data pool1 /dev/vdc
  • Use the stratis blockdev list command to view the block devices of a pool.

    [root@host ~]# stratis blockdev list pool1
    Pool Name  Device Node    Physical Size   State  Tier
    pool1      /dev/vdb               5 GiB  In-use  Data
    pool1      /dev/vdc               5 GiB  In-use  Data

Managing Stratis File Systems

  • Use the stratis filesystem create command to create a file system from a pool.

    [root@host ~]# stratis filesystem create pool1 fs1

    The links to the Stratis file systems are in the /stratis/pool1 directory.

  • Use the stratis filesystem list command to view the list of available file systems.

    [root@host ~]# stratis filesystem list
    Pool Name  Name  Used     Created            Device              UUID
    pool1      fs1   546 MiB  Sep 23 2020 13:11  /stratis/pool1/fs1  31b9363badd...

    Warning

    The df command will report that any new Stratis-managed XFS file systems are 1 TiB in size, no matter how much physical storage is currently allocated to the file system. Because the file system is thinly provisioned, the pool might not have enough real storage to back the entire file system, especially if other file systems in the pool use up all the available storage.

    Therefore, it is possible to use up all the space in the storage pool, while df is still reporting that the file system has space available. If the pool has no storage available for the file system, further attempts to write to that file system might fail, resulting in data loss.

    Use stratis pool list to monitor the remaining real storage available to the Stratis pools.

  • You can create a snapshot of a Stratis-managed file system with the stratis filesystem snapshot command. Snapshots are independent of the source file systems.

    [root@host ~]# stratis filesystem snapshot pool1 fs1 snapshot1

Persistently Mounting Stratis File Systems

To ensure that the Stratis file systems are persistently mounted, edit /etc/fstab and specify the details of the file system. The following command displays the UUID of the file system that you should use in /etc/fstab to identify the file system.

[root@host ~]# lsblk --output=UUID /stratis/pool1/fs1
UUID
31b9363b-add8-4b46-a4bf-c199cd478c55

The following is an example entry in the /etc/fstab file to persistently mount a Stratis file system. This example entry is a single long line in the file.

UUID=31b9363b-add8-4b46-a4bf-c199cd478c55 /dir1 xfs defaults,x-systemd.requires=stratisd.service 0 0

The x-systemd.requires=stratisd.service mount option delays mounting the file system until after systemd starts the stratisd.service during the boot process.

Important

If you do not include the x-systemd.requires=stratisd.service mount option in /etc/fstab for each Stratis file system, the machine will fail to start properly and will abort to emergency.target the next time it is rebooted.

References

For more information, refer to the Managing layered local storage with Stratis chapter in the Red Hat Enterprise Linux 8 Configuring and Managing File Systems Guide at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_file_systems/

Stratis Storage

What Stratis learned from ZFS, Btrfs, and Linux Volume Manager

Revision: rh134-8.2-f0a9756