storage icon indicating copy to clipboard operation
storage copied to clipboard

lvm vdo: storage_test_actual_size != storage_test_requested_size with big size which equal 200 times of vdo_pool_size

Open yizhanglinux opened this issue 4 years ago • 2 comments

palybook

---
- hosts: all 
  become: true
  vars:
    storage_safe_mode: false
    mount_location: '/opt/test1'
    volume_group_size: '10g'
    volume_size: '9g'
    logical_size: '20g'
    small_logical_size: '8g'
    invalid_size: 'xyz GiB'
    too_large_size: '2286g'
    too_large_size1: '2287g'
         
  tasks:
    - include_role:
        name: linux-system-roles.storage
         
    - include_tasks: get_unused_disk.yml
      vars:
        min_size: "{{ volume_group_size }}"
        max_return: 1
    - name: Create LVM VDO volume under volume group 'pool1' with 254 times the size of the physical volume
      include_role:
        name: linux-system-roles.storage
      vars:
        storage_pools:
          - name: pool1
            disks: "{{ unused_disks }}"
            vdo_compression: true
            vdo_deduplication: true
            vdo_logical_size: "{{ too_large_size }}"
            volumes:
              - name: volume1
                size: "{{ volume_size }}"
                fs_create_options: "-K"
                mount_point: "{{ mount_location }}"
 
    - include_tasks: verify-role-results.yml

ansible running log

TASK [parse the actual size of the volume] *************************************************************************************************************************************************************
task path: /root/test/storage/tests/test-verify-volume-size.yml:3
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1611641047.561889-43598-186997938471489 `" && echo ansible-tmp-1611641047.561889-43598-186997938471489="` echo /root/.ansible/tmp/ansible-tmp-1611641047.561889-43598-186997938471489 `" ) && sleep 0'
Using module file /root/test/storage/library/bsize.py
<localhost> PUT /root/.ansible/tmp/ansible-local-42208cifiehst/tmpkmtv69st TO /root/.ansible/tmp/ansible-tmp-1611641047.561889-43598-186997938471489/AnsiballZ_bsize.py
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1611641047.561889-43598-186997938471489/ /root/.ansible/tmp/ansible-tmp-1611641047.561889-43598-186997938471489/AnsiballZ_bsize.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1611641047.561889-43598-186997938471489/AnsiballZ_bsize.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1611641047.561889-43598-186997938471489/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "bytes": 2418925581107,
    "changed": false,
    "invocation": {
        "module_args": {
            "size": "2.2T"
        }
    },
    "lvm": "2t",
    "parted": "2TiB",
    "size": "2 TiB"
}

TASK [parse the requested size of the volume] **********************************************************************************************************************************************************
task path: /root/test/storage/tests/test-verify-volume-size.yml:9
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1611641048.3741238-43615-63550123932967 `" && echo ansible-tmp-1611641048.3741238-43615-63550123932967="` echo /root/.ansible/tmp/ansible-tmp-1611641048.3741238-43615-63550123932967 `" ) && sleep 0'
Using module file /root/test/storage/library/bsize.py
<localhost> PUT /root/.ansible/tmp/ansible-local-42208cifiehst/tmpx8ga9p71 TO /root/.ansible/tmp/ansible-tmp-1611641048.3741238-43615-63550123932967/AnsiballZ_bsize.py
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1611641048.3741238-43615-63550123932967/ /root/.ansible/tmp/ansible-tmp-1611641048.3741238-43615-63550123932967/AnsiballZ_bsize.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1611641048.3741238-43615-63550123932967/AnsiballZ_bsize.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1611641048.3741238-43615-63550123932967/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "bytes": 9663676416,
    "changed": false,
    "invocation": {
        "module_args": {
            "size": "9g"
        }
    },
    "lvm": "9g",
    "parted": "9GiB",
    "size": "9 GiB"
}

TASK [parse the requested size in case of VDO] *********************************************************************************************************************************************************
task path: /root/test/storage/tests/test-verify-volume-size.yml:15
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1611641048.880828-43632-11616973052971 `" && echo ansible-tmp-1611641048.880828-43632-11616973052971="` echo /root/.ansible/tmp/ansible-tmp-1611641048.880828-43632-11616973052971 `" ) && sleep 0'
Using module file /root/test/storage/library/bsize.py
<localhost> PUT /root/.ansible/tmp/ansible-local-42208cifiehst/tmpf38xq65f TO /root/.ansible/tmp/ansible-tmp-1611641048.880828-43632-11616973052971/AnsiballZ_bsize.py
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1611641048.880828-43632-11616973052971/ /root/.ansible/tmp/ansible-tmp-1611641048.880828-43632-11616973052971/AnsiballZ_bsize.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1611641048.880828-43632-11616973052971/AnsiballZ_bsize.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1611641048.880828-43632-11616973052971/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "bytes": 2454573809664,
    "changed": false,
    "invocation": {
        "module_args": {
            "size": "2286g"
        }
    },
    "lvm": "2t",
    "parted": "2TiB",
    "size": "2 TiB"
}

TASK [get requested size] ******************************************************************************************************************************************************************************
task path: /root/test/storage/tests/test-verify-volume-size.yml:25
ok: [localhost] => {
    "ansible_facts": {
        "storage_test_requested_size": {
            "bytes": 2454573809664,
            "changed": false,
            "failed": false,
            "lvm": "2t",
            "parted": "2TiB",
            "size": "2 TiB"
        }
    },
    "changed": false
}

TASK [debug] *******************************************************************************************************************************************************************************************
task path: /root/test/storage/tests/test-verify-volume-size.yml:29
ok: [localhost] => {
    "storage_test_actual_size": {
        "bytes": 2418925581107,
        "changed": false,
        "failed": false,
        "lvm": "2t",
        "parted": "2TiB",
        "size": "2 TiB"
    }
}

TASK [debug] *******************************************************************************************************************************************************************************************
task path: /root/test/storage/tests/test-verify-volume-size.yml:32
ok: [localhost] => {
    "storage_test_requested_size": {
        "bytes": 2454573809664,
        "changed": false,
        "failed": false,
        "lvm": "2t",
        "parted": "2TiB",
        "size": "2 TiB"
    }
}

TASK [assert] ******************************************************************************************************************************************************************************************
task path: /root/test/storage/tests/test-verify-volume-size.yml:35
fatal: [localhost]: FAILED! => {
    "assertion": "storage_test_actual_size == storage_test_requested_size",
    "changed": false,
    "evaluated_to": false,
    "msg": "Volume volume1 has unexpected size"
}

PLAY RECAP *********************************************************************************************************************************************************************************************
localhost                  : ok=112  changed=2    unreachable=0    failed=1    skipped=54   rescued=0    ignored=0  

[root@storageqe-62 blivet]# 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 
sdc                           8:32   0 186.3G  0 disk 
└─pool1-vdopool_vdata       253:3    0     9G  0 lvm  
  └─pool1-vdopool-vpool     253:4    0   2.2T  0 lvm  
    ├─pool1-volume1         253:5    0   2.2T  0 lvm  /opt/test1
    └─pool1-vdopool         253:6    0   512K  1 lvm  

yizhanglinux avatar Jan 26 '21 06:01 yizhanglinux

This case is to cover logical size up to 254 times the size of the physical volume

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deduplicating_and_compressing_logical_volumes_on_rhel/creating-a-deduplicated-and-compressed-logical-volume_deduplicating-and-compressing-logical-volumes

Logical Size
This is the provisioned size that the VDO LV presents to applications. It is usually larger than the available physical size.

VDO currently supports any logical size up to 254 times the size of the physical volume with an absolute maximum logical size of 4 PB.

yizhanglinux avatar Jan 26 '21 06:01 yizhanglinux

This still can be reproduced:

playbook

---  
- hosts: all
  become: true
  vars:
    storage_safe_mode: false
    mount_location: '/opt/test1'
    volume_group_size: '10g'
    volume_size: '9g'
    pool_size: '20g'
    small_pool_size: '8g'
    invalid_size: 'xyz GiB'
    too_large_size: '1800g'
    too_large_size1: '2287g'
  tasks:
    - include_role:
        name: linux-system-roles.storage
     
    - include_tasks: get_unused_disk.yml
      vars:
        min_size: "{{ volume_group_size }}"
        max_return: 1
    - name: Create LVM VDO volume under volume group 'pool1' with 254 times the size of the physical volume
      include_role:
        name: linux-system-roles.storage
      vars:
        storage_pools:
          - name: pool1
            disks: "{{ unused_disks }}"
            volumes:
              - name: volume1
                compression: true
                deduplication: true
                vdo_pool_size: "{{ volume_size }}"
                size: "{{ too_large_size }}"
                fs_create_options: "-K"
                mount_point: "{{ mount_location }}"
 
    - include_tasks: verify-role-results.yml

executing log

TASK [debug] ****************************************************************************************************************************************************************************
ok: [localhost] => {
    "storage_test_actual_size": {
        "bytes": 1979120929996,
        "changed": false,
        "failed": false,
        "lvm": "1t",
        "parted": "1TiB",
        "size": "1 TiB"
    }
}

TASK [debug] ****************************************************************************************************************************************************************************
ok: [localhost] => {
    "storage_test_requested_size": {
        "bytes": 1932735283200,
        "changed": false,
        "failed": false,
        "lvm": "1t",
        "parted": "1TiB",
        "size": "1 TiB"
    }
}

TASK [assert] ***************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {
    "assertion": "storage_test_actual_size == storage_test_requested_size",
    "changed": false,
    "evaluated_to": false,
    "msg": "Volume volume1 has unexpected size"
}

yizhanglinux avatar Jul 11 '21 03:07 yizhanglinux