Description of problem: Currently, when reducing the volume during 'finalizeMerge' step, the volume is reduced to actual size + a chunk. For internal volumes, don't add a chunk. Steps to Reproduce: 1. Perform cold merge for internal volume (the new flow introduced in 4.1) Actual results: Volume is reduce to actual size + a chunk. Expected results: Volume to be reduced to actual size
Tentatively targeting for 4.1.3, let's see how risky/risk-free this is.
Testing this change: 1. Perform a cold merge of internal volume 2. Activate the merged volume lvchange -ay vgname/lvname Activate also the next volumes in this chain, if this is not the base volume 3. Run qemu-img check on this volume: qemu-img check --output json /dev/vgname/lvname Example: # qemu-img check test.qcow2 --output json { "image-end-offset": 262144, "total-clusters": 163840, "check-errors": 0, "filename": "test.qcow2", "format": "qcow2" } The actual size of the image is the image-end-offset value. 4. Check the size of the lv lvs -o size --units m vgname/lvname The actual size of the lv should be this value rounded up to the next extent (128m). In this example, the lv size should be 128.00m.
Verified with the following code: -------------------------------------- ovirt-engine-4.1.3-0.1.el7.noarch rhevm-4.1.3-0.1.el7.noarch vdsm-4.19.16-1.el7ev.x86_64 Verified with the following scenario: -------------------------------------- 1. Created a VM with 1 thin ISCSI disk of 10G 2. lvs -o size --units m 5f6e0626-3a8c-41ed-b843-7a9290a4db5a/775ebda8-93bf-402c-8bfe-83f556a6e0ae LSize 1024.00m (Initial size of minimum thin ISCSI lv) 3. Created Snapshot 4. Write 2G of data to the active disk 5. [root@purple-vds1 ~]# lvs -o size --units m 5f6e0626-3a8c-41ed-b843-7a9290a4db5a/6a5e2b37-09c7-4ea1-9ab1-6a41bb531bb7 LSize 3072.00m (Initial size of minimum ISCSI lv + about 2G of data) 6. Delete the snapshot - Live Merge is successfull 7. Stop the VM 7. Start the VM again 8. lvs -o size --units m 5f6e0626-3a8c-41ed-b843-7a9290a4db5a/775ebda8-93bf-402c-8bfe-83f556a6e0ae LSize 3200.00m (Original Size of OS on base + about 2G of data + 128M chunk) Moving to VERIFIED!
Verified with the following code: -------------------------------------- ovirt-engine-4.1.3-0.1.el7.noarch rhevm-4.1.3-0.1.el7.noarch vdsm-4.19.16-1.el7ev.x86_64 Verified with the following scenario: -------------------------------------- 1. Created a VM with 1 thin ISCSI disk of 10G 2. lvs -o size --units m 5f6e0626-3a8c-41ed-b843-7a9290a4db5a/775ebda8-93bf-402c-8bfe-83f556a6e0ae LSize 1024.00m (Initial size of minimum thin ISCSI lv) 3. Created Snapshot 4. Write 2G of data to the active disk 5. [root@purple-vds1 ~]# lvs -o size --units m 5f6e0626-3a8c-41ed-b843-7a9290a4db5a/6a5e2b37-09c7-4ea1-9ab1-6a41bb531bb7 LSize 3072.00m (Initial size of minimum ISCSI lv + about 2G of data) 6. Power off the VM 7. Delete the snapshot - Live Merge is successfull 8. Start the VM again 9. lvs -o size --units m 5f6e0626-3a8c-41ed-b843-7a9290a4db5a/775ebda8-93bf-402c-8bfe-83f556a6e0ae LSize 3200.00m (Original Size of OS on base + about 2G of data + 128M chunk)