Configure Virtual Data Optimizer (VDO) in CentOS 8

Share on Social Media

In this article, you will learn how to configure Virtual Data Optimizer (VDO) in CentOS 8. #centlinux #linux #storage

What is Virtual Data Optimizer?

VDO (Virtual Data Optimizer) is a storage software that can be used as an additional storage layer under the local filesystems, iSCSI or Ceph storages. VDO provides inline data reduction for Linux in the form of deduplication, compression and thin provisioning.

VDO is commonly used in enterprise environments to maximize the use of existing storage infrastructure, improve performance, and reduce costs. It is especially beneficial in virtualized environments, where data redundancy and storage sprawl can become significant issues.

In this article, we will configure Virtual Data Optimizer (VDO) on CentOS 8 and then we will create filesystem and persistently mount the volume.

Virtual Data Optimizer (VDO) Features

The core features of Virtual Data Optimizer (VDO) are:

  • Supports Local and Remote Storages
  • Deduplication
  • Compression
  • Thin Provisioning

Virtual Data Optimizer (VDO) Applications

Although we can use Virtual Data Optimizer (VDO) in various situations to save disk space, but two major applications of VDO are:

  • VM storage
  • BLOB storage backends

Recommended Online Training: Learn Bash Shell in Linux for Beginners

745772 0021

Linux Server Specification

We have provisioned virtual machine with minimally installed CentOS 8 with following specification.

  • CPU – 3.4 Ghz (2 cores)
  • Memory – 1 GB
  • Storage – 20 GB
  • Operating System – CentOS Linux 8.0
  • Hostname – vdo-storage-01.centlinux.com
  • IP Address – 192.168.116.206 /24

Install Virtual Data Optimizer (VDO) on CentOS 8

Connect with vdo-storage-01.centlinux.com using ssh as root user.

Build dnf cache using following command.

# dnf makecache
CentOS-8 - AppStream                            3.0 kB/s | 4.3 kB     00:01
CentOS-8 - Base                                 2.8 kB/s | 3.9 kB     00:01
CentOS-8 - Extras                               730  B/s | 1.5 kB     00:02
Metadata cache created.

Update CentOS 8 packages as follows.

# dnf update -y

To setup Virtual Data Optimizer on CentOS 8, we have to install following two packages.

  • kmod-kvdo – Kernel Modules for Virtual Data Optimizer
  • vdo – Management tools for Virtual Data Optimizer

We are installing both of these packages using a single dnf command.

# dnf install -y kmod-kvdo vdo

The Virtual Data Optimizer (VDO) service is automatically enabled and started by the installer.

# systemctl status vdo.service
â vdo.service - VDO volume services
   Loaded: loaded (/usr/lib/systemd/system/vdo.service; enabled; vendor preset:>
   Active: active (exited) since Sun 2019-12-22 12:54:27 PKT; 20min ago
 Main PID: 801 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 5948)
   Memory: 0B
   CGroup: /system.slice/vdo.service

Dec 22 12:54:12 vdo-storage-01.centlinux.com systemd[1]: Starting VDO volume serv>
Dec 22 12:54:27 vdo-storage-01.centlinux.com systemd[1]: Started VDO volume servi>

Virtual Data Optimizer (VDO) has been installed on CentOS 8.

Create a VDO Volume

We have added an extra disk as /dev/sdb in our CentOS 8 virtual machine. We will use /dev/sdb as VDO data store and to create VDO volumes.

While we try to create a VDO volume, we encounter following error.

# vdo create --name=vdo1 --device=/dev/sdb --vdoLogicalSize=1T
Creating VDO vdo1
vdo: ERROR - Kernel module kvdo not installed
vdo: ERROR - modprobe: FATAL: Module kvdo not found in directory /lib/modules/4.18.0-80.el8.x86_64

It is a known bug and as a workaround, we restarted the CentOS 8 server.

# systemctl reboot

After restart, we try to create the VDO volume again, and it is working now.

# vdo create --name=vdo1 --device=/dev/sdb --vdoLogicalSize=1T
Creating VDO vdo1
Starting VDO vdo1
Starting compression on VDO vdo1
VDO instance 0 volume is ready at /dev/mapper/vdo1

Since we are using VDO volume as local filesystem, therefore, we need to create a filesystem in VDO volume.

# mkfs.xfs -K /dev/mapper/vdo1
meta-data=/dev/mapper/vdo1       isize=512    agcount=4, agsize=67108864 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=268435456, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=131072, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Persistently Mount VDO Volume

Create a directory to mount our VDO volume.

# mkdir /mnt/vdo1

To persistently mount our VDO volume, we must add an entry in /etc/fstab file.

# vi /etc/fstab

Add following line in this file.

/dev/mapper/vdo1        /mnt/vdo1       xfs     defaults,x-systemd.req=vdo.service,discard      0 0

Execute following command to inform Systemd about the new entry in /etc/fstab file.

# systemctl daemon-reload

Mount entries in /etc/fstab file.

# mount -a

Check list of block devices.

# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   60G  0 disk
ââsda1        8:1    0    1G  0 part /boot
ââsda2        8:2    0   59G  0 part
  ââcl-root 253:0    0 38.2G  0 lvm  /
  ââcl-swap 253:1    0  2.1G  0 lvm  [SWAP]
  ââcl-home 253:2    0 18.7G  0 lvm  /home
sdb           8:16   0   10G  0 disk
ââvdo1      253:3    0    1T  0 vdo  /mnt/vdo1
sr0          11:0    1  6.7G  0 rom

Check status of VDO volumes.

# vdostats
Device               1K-blocks      Used Available Use% Space saving%
/dev/mapper/vdo1      10485760   4200156   6285604  40%           99%

We have successfully configured VDO on CentOS 8.

If you are new to Linux and facing difficulty in working at Linux Bash prompt. We recommend that, you should read The Linux Command Line, 2nd Edition: A Complete Introduction by William Shotts.

Final Thoughts

Configuring Virtual Data Optimizer (VDO) on CentOS 8 can significantly enhance your storage efficiency by reducing the physical footprint of your data through deduplication, compression, and thin provisioning. By implementing VDO, you can optimize your storage resources, improve system performance, and lower overall costs.

If you need professional assistance with configuring VDO on any Linux Server or any other storage optimization needs, I am here to help! Check out my services on Fiverr for expert support:

Linux Server Administration

Thank you for considering my services, and I look forward to helping you achieve your storage optimization goals!

1 thought on “Configure Virtual Data Optimizer (VDO) in CentOS 8”

Leave a Comment