Bookmark this page

Guided Exercise: Managing Layered Storage with Stratis

In this exercise, you will use the Stratis Storage Manager to create pools, volumes and file systems that work in cooperation.

Outcomes

You should be able to use the Stratis storage manager to combine disks into pools and create volumes and file systems, and show how file systems and volumes share pools cooperatively.

  1. Install the Stratis storage manager on servera.

    1. Log in to servera as the root user.

      [student@workstation ~]$ ssh root@servera
    2. Install the stratisd and the stratis-cli packages on servera.

      [root@servera ~]# yum install stratisd stratis-cli
      ...output omitted...
      Is this ok [y/N]: y
      ...output omitted...
    3. Enable the stratisd service on servera to start at boot time.

      [root@servera ~]# systemctl enable --now stratisd
      Created symlink /etc/systemd/system/sysinit.target.wants/stratisd.service → /usr/lib/systemd/system/stratisd.service.
  2. Use the Stratis storage manager to create a new pool with the /dev/vdb device.

    1. Create the stratispool pool with the /dev/vdb device.

      [root@servera ~]# stratis pool create stratispool /dev/vdb
    2. Verify that the stratispool pool is now available.

      [root@servera ~]# stratis pool list
      Name        Total Physical Size  Total Physical Used
      stratispool               1 GiB               52 MiB            
      
  3. Add /dev/vdc as an additional device to the stratispool pool.

    1. Add /dev/vdc as an additional device to the stratispool pool.

      [root@servera ~]# stratis pool add-data stratispool /dev/vdc
    2. Verify that /dev/vdc is part of the stratispool pool.

      [root@servera ~]# stratis blockdev
      Pool Name   Device Node    Physical Size   State  Tier
      stratispool /dev/vdb               1 GiB  In-use  Data
      stratispool /dev/vdc               1 GiB  In-use  Data            
      
  4. Create the filesystem1 file system in the stratispool pool.

    1. Create the filesystem1 file system in the stratispool pool.

      [root@servera ~]# stratis fs create stratispool filesystem1
    2. Verify that the filesystem1 file system is now available.

      [root@servera ~]# stratis fs list stratispool
      Pool Name       Name         Used     Created            Device                 
      stratispool     filesystem1  546 MiB  Jan 23 2019 08:44  /stratis/stratispool/filesystem1
  5. Mount the filesystem1 file system, and create a new file on it.

    1. Create a new mount point, named /stratisvol.

      [root@servera ~]# mkdir /stratisvol
    2. Mount the filesystem1 file system into the /stratisvol directory.

      [root@servera ~]# mount /stratis/stratispool/filesystem1 /stratisvol
    3. Verify that the filesystem1 file system is now accessible.

      [root@servera ~]# mount
      ... output omitted ...
      /dev/mapper/stratis-1-b5ceb83a7c57488a9c02b501d1419ce4-thin-fs-333a2d9922c04ee6abebcc71bdb047b5 on /stratisvol type xfs (rw,relatime,seclabel,attr2,inode64,sunit=2048,swidth=2048,noquota)
    4. Create a new empty file named file.txt.

      [root@servera ~]# touch /stratisvol/file.txt
  6. Create a snapshot of the filesystem1 file system. When done, remove the file you previously created.

    1. Create a snapshot, named filesystem1-snapshot, of the filesystem1 file system.

      [root@servera ~]# stratis fs snapshot stratispool filesystem1 filesystem1-snapshot
    2. Remove the file.txt file.

      [root@servera ~]# rm -f /stratisvol/file.txt
  7. Inspect the filesystem1-snapshot snapshot you just created, and verify that the file is available.

    1. Create a mount point named /stratisvolsnap, for the snapshot.

      [root@servera ~]# mkdir /stratisvolsnap
    2. Mount the filesystem1-snapshot snapshot in the /stratisvolsnap directory.

      [root@servera ~]# mount /stratis/stratispool/filesystem1-snapshot /stratisvolsnap/
    3. Verify that the file.txt file is available.

      [root@servera ~]# ls /stratisvolsnap
      file.txt
      
  8. Destroy the filesystem1-snapshot snapshot.

    1. Unmount the filesystem1-snapshot snapshot.

      [root@servera ~]# umount /stratis/stratispool/filesystem1-snapshot
    2. Destroy the filesystem1-snapshot snapshot.

      [root@servera ~]# stratis filesystem destroy stratispool filesystem1-snapshot
  9. Destroy the filesystem1 file system.

    1. Unmount the filesystem1 file system.

      [root@servera ~]# umount /stratis/stratispool/filesystem1
    2. Destroy the filesystem1 file system.

      [root@servera ~]# stratis filesystem destroy stratispool filesystem1
  10. Destroy the stratispool pool. When done, log out from servera.

    1. Destroy the stratispool pool.

      [root@servera ~]# stratis pool destroy stratispool
    2. Verify that the stratispool pool is not available.

      [root@servera ~]# stratis pool list
      Name    Total Physical Size  Total Physical Used
    3. Log out from servera.

      [root@servera ~]# exit
      [student@workstation ~]$ 

This concludes the guided exercise.

Revision: rh354-8.0-0e36520