18.14. 使用 storage RHEL 系统角色在 LVM 上压缩和去掉重复数据的 VDO 卷的 Ansible playbook 示例
本节提供了一个 Ansible playbook 示例。此 playbook 应用 storage
RHEL 系统角色,以便使用虚拟数据优化器 (VDO) 启用逻辑卷 (LVM) 的压缩和重复数据删除。
例 18.11. 在 myvg
卷组中创建 mylv1
LVM VDO 卷的 playbook
--- - name: Create LVM VDO volume under volume group 'myvg' hosts: all roles: -rhel-system-roles.storage vars: storage_pools: - name: myvg disks: - /dev/sdb volumes: - name: mylv1 compression: true deduplication: true vdo_pool_size: 10 GiB size: 30 GiB mount_point: /mnt/app/shared
在本例中,compression
和 deduplication
池被设为 true,这指定使用 VDO。下面描述了这些参数的用法:
-
deduplication
用于去除存储在存储卷上的重复数据。 - compression 用于压缩存储在存储卷上的数据,从而提高存储量。
-
vdo_pool_size 指定卷在设备上占用的实际大小。VDO 卷的虚拟大小由
size
参数设置。注:由于存储角色使用 LVM VDO,因此每个池中只有一个卷可以使用压缩和去除重复数据。