Bug 2061997

Summary: read only vpool conversion attempt could give better failure output, or state it's not supported
Product: Red Hat Enterprise Linux 9 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: VDO QA Contact: cluster-qe <cluster-qe>
Status: NEW --- Docs Contact:
Severity: low    
Priority: unspecified CC: agk, awalsh, heinzm, jbrassow, prajnoha, zkabelac
Version: 9.0   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2022-03-08 21:29:39 UTC
Description of problem:
Read only volume creations are supported, however when attempting to convert (or even just --test convert) an existing RO pool volume, the cmd fails (which is some what expected). If it's not supported, the stderr could provide more as to why? That said, both the of the failing commands do indirectly state "couldn't write to vdo pool" so maybe what currently exists is good enough?


# Readonly create

[root@hayes-02 ~]# lvcreate -p r --yes --type vdo --name vdo_lv --vdopool vdopool -L 6G --virtualsize 6G -ay vdo_sanity
    The VDO volume can address 2 GB in 1 data slab.
    It can grow to address at most 16 TB of physical storage in 8192 slabs.
    If a larger maximum size might be needed, use bigger slabs.
  Logical volume "vdo_lv" created.
[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG         Attr       LSize Pool    Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
  vdo_lv          vdo_sanity vri-a-v--- 6.00g vdopool        0.00                                    vdopool(0)
  vdopool         vdo_sanity dwi------- 6.00g                66.69                                   vdopool_vdata(0)
  [vdopool_vdata] vdo_sanity Dwi-ao---- 6.00g                                                        /dev/sdc1(0)


# Readonly conversion of existing (RO) pool
[root@hayes-02 ~]# lvcreate --yes --type linear -n vdo_pool -L 25G vdo_sanity
  Wiping vdo signature on /dev/vdo_sanity/vdo_pool.
  Logical volume "vdo_pool" created.
[root@hayes-02 ~]# lvchange -ay -pr  vdo_sanity/vdo_pool
  Logical volume vdo_sanity/vdo_pool changed.
  WARNING: Combining activation change with other commands is not advised.

# First, attempt w/ --test
[root@hayes-02 ~]# lvconvert --test --yes --type vdo-pool --name vdo_lv --virtualsize 5G vdo_sanity/vdo_pool
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  WARNING: Converting logical volume vdo_sanity/vdo_pool to VDO pool volume with formating.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Command /usr/bin/vdoformat failed.
  Cannot format VDO pool volume vdo_sanity/vdo_pool.
[root@hayes-02 ~]# echo $?
5

# Second, full attempt
[root@hayes-02 ~]# lvconvert --yes --type vdo-pool --name vdo_lv --virtualsize 5G vdo_sanity/vdo_pool
  WARNING: Converting logical volume vdo_sanity/vdo_pool to VDO pool volume with formating.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Failed to initialize logical volume vdo_sanity/vdo_pool at position 0 and size 4096.
  Aborting. Failed to wipe VDO data store.




Version-Release number of selected component (if applicable):
kernel-5.14.0-58.el9    BUILT: Thu Feb 10 11:18:21 AM CST 2022
lvm2-2.03.14-4.el9    BUILT: Wed Feb 16 06:01:21 AM CST 2022
lvm2-libs-2.03.14-4.el9    BUILT: Wed Feb 16 06:01:21 AM CST 2022