RHCSA Rapid Track
In this exercise, you will use the Stratis storage management solution to create file systems that grow to accommodate increased data demands, and Virtual Data Optimizer to create volumes for efficient utilization of storage space.
Outcomes
You should be able to:
Create a thinly provisioned file system using Stratis storage management solution.
Verify that the Stratis volumes grow dynamically to support real-time data growth.
Access data from the snapshot of a thinly provisioned file system.
Create a volume using Virtual Data Optimizer and mount it on a file system.
Investigate the impact of data deduplication and compression on a Virtual Data Optimizer volume.
Log in to workstation as student using student as the password.
On workstation, run lab advstorage-review start to start the lab.
This script sets up the environment correctly and ensures that the additional disks on serverb are clean.
[student@workstation ~]$lab advstorage-review start
From
workstation, open an SSH session toserverbasstudent.Switch to the
rootuser.Install the stratisd and stratis-cli packages using
yum.Start and enable the
stratisdservice using thesystemctlcommand.Create the Stratis pool
labpoolcontaining the block device/dev/vdb.Create the Stratis pool
labpoolusing thestratis pool createcommand.[root@serverb ~]#stratis pool create labpool /dev/vdbVerify the availability of
labpoolusing thestratis pool listcommand.[root@serverb ~]#stratis pool listName Total Physical labpool5 GiB/ 37.63 MiB / 4.96 GiBNote the size of the pool in the preceding output.
Expand the capacity of
labpoolusing the disk/dev/vdcavailable in the system.Add the block device
/dev/vdctolabpoolusing thestratis pool add-datacommand.[root@serverb ~]#stratis pool add-data labpool /dev/vdcVerify the size of
labpoolusing thestratis pool listcommand.[root@serverb ~]#stratis pool listName Total Physical labpool10 GiB/ 41.63 MiB / 9.96 GiBThe preceding output shows that the size of
labpoolhas increased after a new disk was added to the pool.Use the
stratis blockdev listcommand to list the block devices that are now members oflabpool.[root@serverb ~]#stratis blockdev list labpoolPool Name Device Node Physical Size Tier labpool /dev/vdb 5 GiB Data labpool /dev/vdc 5 GiB Data
Create a thinly provisioned file system named
labfsin thelabpoolpool. Mount this file system on/labstratisvolso that it persists across reboots. Create a file namedlabfile1that contains the textHello World!on thelabfsfile system. Don't forget to use thex-systemd.requires=stratisd.servicemount option in/etc/fstab.Create the thinly provisioned file system
labfsinlabpoolusing thestratis filesystem createcommand. It may take up to a minute for the command to complete.[root@serverb ~]#stratis filesystem create labpool labfsVerify the availability of
labfsusing thestratis filesystem listcommand.[root@serverb ~]#stratis filesystem listPool Name Name Used Created Device UUID labpoollabfs546 MiBMar 29 2019 07:48 /stratis/labpool/labfs 9825...d6caNote the current usage of
labfs. This usage of the file system increases on-demand in the following steps.Determine the UUID of
labfsusing thelsblkcommand.[root@serverb ~]#lsblk --output=UUID /stratis/labpool/labfsUUID 9825e289-fb08-4852-8290-44d1b8f0d6caEdit
/etc/fstabso that the thinly provisioned file systemlabfsis mounted at boot time. Use the UUID you determined in the preceding step. The following shows the line you should add to/etc/fstab. You can use thevi /etc/fstabcommand to edit the file.UUID=
9825...d6ca/labstratisvol xfs defaults,x-systemd.requires=stratisd.service 0 0Create a directory named
/labstratisvolusing themkdircommand.[root@serverb ~]#mkdir /labstratisvolMount the thinly provisioned file system
labfsusing themountcommand to confirm that the/etc/fstabfile contains the appropriate entries.[root@serverb ~]#mount /labstratisvolIf the preceding command produces any errors, revisit the
/etc/fstabfile and ensure that it contains the appropriate entries.Create a text file named
/labstratisvol/labfile1using theechocommand.[root@serverb ~]#echo "Hello World!" > /labstratisvol/labfile1
Verify that the thinly provisioned file system
labfsdynamically grows as the data on the file system grows by adding a 2 GiBlabfile2to the filesystem.View the current usage of
labfsusing thestratis filesystem listcommand.[root@serverb ~]#stratis filesystem listPool Name Name Used Created Device UUID labpool labfs546 MiBMar 29 2019 07:48 /stratis/labpool/labfs 9825...d6caCreate a 2 GiB file in
labfsusing theddcommand. It may take up to a minute for the command to complete.[root@serverb ~]#dd if=/dev/urandom of=/labstratisvol/labfile2 bs=1M count=2048Verify that the usage of
labfshas increased, using thestratis filesystem listcommand.[root@serverb ~]#stratis filesystem listPool Name Name Used Created Device UUID labpool labfs2.53 GiBMar 29 2019 07:48 /stratis/labpool/labfs 9825...d6ca
Create a snapshot named
labfs-snapof thelabfsfile system. The snapshot allows you to access any file that is deleted fromlabfs.Create a snapshot of
labfsusing thestratis filesystem snapshotcommand. It may take up to a minute for the command to complete.[root@serverb ~]#stratis filesystem snapshot labpool \labfs labfs-snapVerify the availability of the snapshot using the
stratis filesystem listcommand.[root@serverb ~]#stratis filesystem list...output omitted... labpoollabfs-snap2.53 GiB Mar 29 2019 10:28 /stratis/labpool/labfs-snap 291d...8a16Remove the
/labstratisvol/labfile1file.[root@serverb ~]#rm /labstratisvol/labfile1rm: remove regular file '/labstratisvol/labfile1'?yCreate the
/labstratisvol-snapdirectory using themkdircommand.[root@serverb ~]#mkdir /labstratisvol-snapMount the snapshot
labfs-snapon/labstratisvol-snapusing themountcommand.[root@serverb ~]#mount /stratis/labpool/labfs-snap \/labstratisvol-snapConfirm that you can still access the file you deleted from
labfsusing the snapshotlabfs-snap.[root@serverb ~]#cat /labstratisvol-snap/labfile1Hello World!
Create the VDO volume
labvdo, with the device/dev/vdd. Set its logical size to50 GB.Mount the volume
labvdoon/labvdovolwith theXFSfile system so that it persists across reboots. Don't forget to use thex-systemd.requires=vdo.servicemount option in/etc/fstab.Format the
labvdovolume with theXFSfile system using themkfscommand.[root@serverb ~]#mkfs.xfs -K /dev/mapper/labvdo...output omitted...Use the
udevadmcommand to register the new device node.[root@serverb ~]#udevadm settleCreate the
/labvdovoldirectory using themkdircommand.[root@serverb ~]#mkdir /labvdovolDetermine the UUID of
labvdousing thelsblkcommand.[root@serverb ~]#lsblk --output=UUID /dev/mapper/labvdoUUID ef8cce71-228a-478d-883d-5732176b39b1Edit
/etc/fstabso thatlabvdois mounted at boot time. Use the UUID of the volume you determined in the preceding step. The following shows the line you should add to/etc/fstab. You can use thevi /etc/fstabcommand to edit the file.UUID=
ef8c...39b1/labvdovol xfs defaults,x-systemd.requires=vdo.service 0 0Mount the
labvdovolume using themountcommand to confirm that the/etc/fstabfile contains the appropriate entries.[root@serverb ~]#mount /labvdovolIf the preceding command produces any errors, revisit the
/etc/fstabfile and ensure that it contains the appropriate entries.
Create three copies of the file named
/root/install.imgon the volumelabvdo. Compare the statistics of the volume to verify the data deduplication and compression happening on the volume.View the initial statistics and status of the volume using the
vdostatscommand.[root@serverb ~]#vdostats --human-readableDevice Size Used Available Use% Space saving% /dev/mapper/labvdo 5.0G3.0G2.0G 60%99%Notice that 3 GB of the volume is already used because when created, the VDO volume reserves 3-4 GB for itself. Also note that the value
99%in theSpace saving%field indicates that you have not created any content so far in the volume, contributing to all of the saved volume space.Copy
/root/install.imgto/labvdovol/install.img.1and verify the statistics of the volume. It may take up to a minute to copy the file.[root@serverb ~]#cp /root/install.img /labvdovol/install.img.1[root@serverb ~]#vdostats --human-readableDevice Size Used Available Use% Space saving% /dev/mapper/labvdo 5.0G3.4G1.6G 68%5%Notice that the value of the
Usedfield increased from3.0Gto3.4Gbecause you copied a file in the volume, and that occupies some space. Also, notice that the value ofSpace saving%field decreased from99%to5%because initially there was no content in the volume, contributing to the low volume space utilization and high volume space saving until you created a file in there. The volume space saving is quite low because you created a unique copy of the file in the volume and there is nothing to deduplicate.Copy
/root/install.imgto/labvdovol/install.img.2and verify the statistics of the volume. It may take up to a minute to copy the file.[root@serverb ~]#cp /root/install.img /labvdovol/install.img.2[root@serverb ~]#vdostats --human-readableDevice Size Used Available Use% Space saving% /dev/mapper/labvdo 5.0G3.4G1.6G 68%51%Notice that the used volume space did not change. Instead, the percentage of the saved volume space increased, proving that the data deduplication occurred to reduce the space consumption for the redundant copies of the same file. The value of
Space saving%in the preceding output may vary on your system.
Reboot
serverb. Verify that yourlabvdovolume is mounted on/labvdovolafter the system starts back up.Reboot the serverb machine.
[root@serverb ~]#systemctl rebootNote
Note:If on a reboot, serverb does not boot to a regular login prompt but instead has "Give root password for maintenance (or press Control-D to continue):" you likely made a mistake in/etc/fstab. After providing the root password ofredhat, you will need to remount the root file system as read-write with:[root@serverb ~]#mount -o remount,rw /Verify that
/etc/fstabis configured correctly as specified in the solutions. Pay special attention to the mount options for the lines related to/labstratisvoland/labvdovol.