Virtual Data Optimizer (VDO) è una tecnologia di virtualizzazione a blocchi che consente di creare facilmente pool di storage a blocchi compressi e deduplicati. Questo post descrive i passaggi per creare il filesystem Virtual Data Optimizer (VD0) nei sistemi CentOS/RHEL 8.
1. Installa VDO usando dnf o yum.
# dnf install install vdo
Verifica l'installazione del pacchetto:
# rpm -qa | grep vdo kmod-kvdo-6.2.0.293-50.0.1.el8.x86_64 vdo-6.2.0.298-10.el8_0.x86_64
2. Crea un disco VDO:
# lsblk | grep sdc NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdc 8:32 0 5G 0 disk
# vdo create --name=vdoTEST --device=/dev/sdc --vdoLogicalSize=1G --writePolicy=async Creating VDO vdoTEST Starting VDO vdoTEST Starting compression on VDO vdoTEST VDO instance 0 volume is ready at /dev/mapper/vdoTEST
3. Verificare la configurazione del disco VDO.
# ls -l /dev/mapper/vdoTEST lrwxrwxrwx. 1 root root 7 Aug 19 18:13 /dev/mapper/vdoTEST -> ../dm-8
# vdostats --hu Device Size Used Available Use% Space saving% /dev/mapper/vdoTEST 5.0G 3.0G 2.0G 60% 0%
# vdostats --verbose /dev/mapper/vdoTEST | grep -B6 'saving percent' physical blocks : 1316331 logical blocks : 262144 1K-blocks : 5265324 1K-blocks used : 3169588 1K-blocks available : 2095736 used percent : 60 saving percent : 0
4. Crea una base LVM sul VDO:
# pvcreate /dev/mapper/vdoTEST Physical volume "/dev/mapper/vdoTEST" successfully created.
# vgcreate vdoTest /dev/mapper/vdoTEST Volume group "vdoTest" successfully created
# vgdisplay vdoTest --- Volume group --- VG Name vdoTest System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 1020.00 MiB PE Size 4.00 MiB Total PE 255 Alloc PE / Size 0 / 0 Free PE / Size 255 / 1020.00 MiB VG UUID ylwz5n-vvIA-dBrW-7KKj-iugk-eWeO-VCKcXq
# lvcreate -n vdolv01 -L 500MB vdoTest Logical volume "vdolv01" created.
# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert vdolv01 vdoTest -wi-a----- 500.00m
5. Ora crea il filesystem xfs e monta il volume LVM:
# mkfs.xfs /dev/vdoTest/vdolv01
# mount -o discard /dev/vdoTest/vdolv01 /vdoTest
Verifica il nuovo punto di montaggio:
# vdostats --hu Device Size Used Available Use% Space saving% /dev/mapper/vdoTEST 5.0G 3.0G 2.0G 60% 96%
# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vdoTest-vdolv01 496M 29M 467M 6% /vdoTest