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 to serverb as student.
Switch to the root user.
Install the stratisd and stratis-cli packages using yum.
Start and enable the stratisd service using the systemctl command.
Create the Stratis pool labpool containing the block device /dev/vdb.
Create the Stratis pool labpool using the stratis pool create command.
[root@serverb ~]#stratis pool create labpool /dev/vdb
Verify the availability of labpool using the stratis pool list command.
[root@serverb ~]#stratis pool listName Total Physical labpool5 GiB/ 37.63 MiB / 4.96 GiB
Note the size of the pool in the preceding output.
Expand the capacity of labpool using the disk /dev/vdc available in the system.
Add the block device /dev/vdc to labpool using the stratis pool add-data command.
[root@serverb ~]#stratis pool add-data labpool /dev/vdc
Verify the size of labpool using the stratis pool list command.
[root@serverb ~]#stratis pool listName Total Physical labpool10 GiB/ 41.63 MiB / 9.96 GiB
The preceding output shows that the size of labpool has increased after a new disk was added to the pool.
Use the stratis blockdev list command to list the block devices that are now members of labpool.
[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 labfs in the labpool pool.
Mount this file system on /labstratisvol so that it persists across reboots.
Create a file named labfile1 that contains the text Hello World! on the labfs file system.
Don't forget to use the x-systemd.requires=stratisd.service mount option in /etc/fstab.
Create the thinly provisioned file system labfs in labpool using the stratis filesystem create command.
It may take up to a minute for the command to complete.
[root@serverb ~]#stratis filesystem create labpool labfs
Verify the availability of labfs using the stratis filesystem list command.
[root@serverb ~]#stratis filesystem listPool Name Name Used Created Device UUID labpoollabfs546 MiBMar 29 2019 07:48 /stratis/labpool/labfs 9825...d6ca
Note the current usage of labfs.
This usage of the file system increases on-demand in the following steps.
Determine the UUID of labfs using the lsblk command.
[root@serverb ~]#lsblk --output=UUID /stratis/labpool/labfsUUID 9825e289-fb08-4852-8290-44d1b8f0d6ca
Edit /etc/fstab so that the thinly provisioned file system labfs is 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 the vi /etc/fstab command to edit the file.
UUID=9825...d6ca /labstratisvol xfs defaults,x-systemd.requires=stratisd.service 0 0
Create a directory named /labstratisvol using the mkdir command.
[root@serverb ~]#mkdir /labstratisvol
Mount the thinly provisioned file system labfs using the mount command to confirm that the /etc/fstab file contains the appropriate entries.
[root@serverb ~]#mount /labstratisvol
If the preceding command produces any errors, revisit the /etc/fstab file and ensure that it contains the appropriate entries.
Create a text file named /labstratisvol/labfile1 using the echo command.
[root@serverb ~]#echo "Hello World!" > /labstratisvol/labfile1
Verify that the thinly provisioned file system labfs dynamically grows as the data on the file system grows by adding a 2 GiB labfile2 to the filesystem.
View the current usage of labfs using the stratis filesystem list command.
[root@serverb ~]#stratis filesystem listPool Name Name Used Created Device UUID labpool labfs546 MiBMar 29 2019 07:48 /stratis/labpool/labfs 9825...d6ca
Create a 2 GiB file in labfs using the dd command.
It may take up to a minute for the command to complete.
[root@serverb ~]#dd if=/dev/urandom of=/labstratisvol/labfile2 bs=1M count=2048
Verify that the usage of labfs has increased, using the stratis filesystem list command.
[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-snap of the labfs file system.
The snapshot allows you to access any file that is deleted from labfs.
Create a snapshot of labfs using the stratis filesystem snapshot command.
It may take up to a minute for the command to complete.
[root@serverb ~]#stratis filesystem snapshot labpool \labfs labfs-snap
Verify the availability of the snapshot using the stratis filesystem list command.
[root@serverb ~]#stratis filesystem list...output omitted... labpoollabfs-snap2.53 GiB Mar 29 2019 10:28 /stratis/labpool/labfs-snap 291d...8a16
Remove the /labstratisvol/labfile1 file.
[root@serverb ~]#rm /labstratisvol/labfile1rm: remove regular file '/labstratisvol/labfile1'?y
Create the /labstratisvol-snap directory using the mkdir command.
[root@serverb ~]#mkdir /labstratisvol-snap
Mount the snapshot labfs-snap on /labstratisvol-snap using the mount command.
[root@serverb ~]#mount /stratis/labpool/labfs-snap \/labstratisvol-snap
Confirm that you can still access the file you deleted from labfs using the snapshot labfs-snap.
[root@serverb ~]#cat /labstratisvol-snap/labfile1Hello World!
Create the VDO volume labvdo, with the device /dev/vdd.
Set its logical size to 50 GB.
Mount the volume labvdo on /labvdovol with the XFS file system so that it persists across reboots.
Don't forget to use the x-systemd.requires=vdo.service mount option in /etc/fstab.
Format the labvdo volume with the XFS file system using the mkfs command.
[root@serverb ~]#mkfs.xfs -K /dev/mapper/labvdo...output omitted...
Use the udevadm command to register the new device node.
[root@serverb ~]#udevadm settle
Create the /labvdovol directory using the mkdir command.
[root@serverb ~]#mkdir /labvdovol
Determine the UUID of labvdo using the lsblk command.
[root@serverb ~]#lsblk --output=UUID /dev/mapper/labvdoUUID ef8cce71-228a-478d-883d-5732176b39b1
Edit /etc/fstab so that labvdo is 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 the vi /etc/fstab command to edit the file.
UUID=ef8c...39b1 /labvdovol xfs defaults,x-systemd.requires=vdo.service 0 0
Mount the labvdo volume using the mount command to confirm that the /etc/fstab file contains the appropriate entries.
[root@serverb ~]#mount /labvdovol
If the preceding command produces any errors, revisit the /etc/fstab file and ensure that it contains the appropriate entries.
Create three copies of the file named /root/install.img on the volume labvdo.
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 vdostats command.
[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 the Space 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.img to /labvdovol/install.img.1 and 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 Used field increased from 3.0G to 3.4G because you copied a file in the volume, and that occupies some space.
Also, notice that the value of Space saving% field decreased from 99% to 5% 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.img to /labvdovol/install.img.2 and 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 your labvdo volume is mounted on /labvdovol after the system starts back up.
Reboot the serverb machine.
[root@serverb ~]#systemctl reboot
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 of redhat, you will need to remount the root file system as read-write with:
[root@serverb ~]#mount -o remount,rw /
Verify that /etc/fstab is configured correctly as specified in the solutions.
Pay special attention to the mount options for the lines related to /labstratisvol and /labvdovol.