storage icon indicating copy to clipboard operation
storage copied to clipboard

lvm vdo: No failure when creating lvm vdo with invalid parameter "compression:trued, deduplication:falsed

Open yizhanglinux opened this issue 4 years ago • 2 comments

I tried bellow playbook[1] to create lvm vdo which expected to be failed, but it passed, from the log[2], it finally created with enabled compression/deduplication, is that expected? [1]

    - name: Test for correct handling of invalid parameter when creating LVM VDO volume
      block:
        - name: Try to create LVM VDO with invalid paramerters "compression:trued, deduplication:falsed"
          include_role:
            name: linux-system-roles.storage
          vars:
            storage_pools:
              - name: pool1
                disks: "{{ unused_disks }}"
                vdo_compression: 'trued'
                vdo_deduplication: 'falsed'
                vdo_logical_size: "{{ logical_size }}"
                volumes:
                  - name: volume1
                    size: "{{ volume_size }}"
                    mount_point: "{{ mount_location }}"
 
        - name: Unreachable task
          fail:
            msg: UNREACH

[2]

2021-01-25 22:15:57,532 INFO program/MainThread: Running [17] lvm lvcreate --type vdo -n volume1 -L 9437184K -V 20971520K --compression y --deduplication y -y pool1/vdopool
[root@storageqe-62 storage]# lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                           8:0    0 279.4G  0 disk 
├─sda1                        8:1    0   600M  0 part /boot/efi
├─sda2                        8:2    0     1G  0 part /boot
└─sda3                        8:3    0 277.8G  0 part 
  ├─rhel_storageqe--62-root 253:0    0    70G  0 lvm  /
  ├─rhel_storageqe--62-swap 253:1    0   7.9G  0 lvm  [SWAP]
  └─rhel_storageqe--62-home 253:2    0   200G  0 lvm  /home
sdb                           8:16   0 279.4G  0 disk 
└─pool1-vdopool_vdata       253:3    0     9G  0 lvm  
  └─pool1-vdopool-vpool     253:4    0    20G  0 lvm  
    ├─pool1-volume1         253:5    0    20G  0 lvm  /opt/test1
    └─pool1-vdopool         253:6    0   512K  1 lvm

yizhanglinux avatar Jan 26 '21 03:01 yizhanglinux

It appears that the LVM VDO volume was created with compression and deduplication enabled, even though the parameters passed to the Ansible playbook were invalid. This behavior may not be expected, as the playbook was designed to test for correct handling of invalid parameters.

It's possible that the LVM VDO driver is automatically falling back to default values when invalid parameters are specified. It may be worth further investigation to confirm whether this behavior is expected or if it's a bug that needs to be reported to the developers.

In the meantime, if you want to ensure that compression and deduplication are disabled when creating an LVM VDO volume, you should use the correct parameters (vdo_compression: 'false' and vdo_deduplication: 'false') instead of invalid ones.

AbdelAzizMohamedMousa avatar Feb 23 '23 12:02 AbdelAzizMohamedMousa

It seems I am no longer able to replicate the issue. Can you please verify that @yizhanglinux ? Thanks

japokorn avatar Jul 28 '23 13:07 japokorn