Abstract
| Goal | Manage storage using the Stratis local storage management system and use the VDO volumes to optimize storage space in use. |
| Objectives |
|
| Sections |
|
| Lab |
Implementing Advanced Storage Features |
After completing this section, you should be able to manage multiple storage layers using Stratis local storage management.
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.
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.
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.
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.
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
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 createpool1/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 listName Total Physical Size Total Physical Used pool1 5 GiB 52 MiB
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-datapool1/dev/vdc
Use the stratis blockdev list command to view the block devices of a pool.
[root@host ~]#stratis blockdev listPool Name Device Node Physical Size State Tier pool1 /dev/vdb 5 GiB In-use Data pool1 /dev/vdc 5 GiB In-use Datapool1
Use the stratis filesystem create command to create a file system from a pool.
[root@host ~]#stratis filesystem createpool1fs1
The links to the Stratis file systems are in the /stratis/ directory.
pool1
Use the stratis filesystem list command to view the list of available file systems.
[root@host ~]#stratis filesystem listPool Name Name Used Created Device UUID pool1 fs1 546 MiB Sep 23 2020 13:11 /stratis/pool1/fs1 31b9363badd...
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 snapshotpool1fs1snapshot1
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/UUID 31b9363b-add8-4b46-a4bf-c199cd478c55pool1/fs1
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.
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.
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/
What Stratis learned from ZFS, Btrfs, and Linux Volume Manager