Bug 1857779

Summary: QEMU command 'transaction': Bitmap already exists: libvirt-tmp-activewrite
Product: Red Hat Enterprise Linux 8 Reporter: Jaroslav Suchanek <jsuchane>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: yisun
Severity: high Docs Contact:
Priority: high    
Version: 8.3CC: jdenemar, jsuchane, lmen, lmiksik, mlehrer, mtessun, pkrempa, virt-bugs, virt-maint
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-6.0.0-26.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1857735 Environment:
Last Closed: 2020-11-04 02:54:04 UTC 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:
Bug Depends On: 1857735, 1861681    
Bug Blocks:    

Description Jaroslav Suchanek 2020-07-16 14:45:48 UTC
+++ This bug was initially created as a clone of Bug #1857735 +++

Description of problem:
When using rhv 4.4 to create live snapshot of vm, it succeeds twice but fails during vm snapshot removal on the third time.

VDSM does not handle the exception thrown by libvirt.  This issue of handling exceptions for vdsm is addressed in: https://bugzilla.redhat.com/show_bug.cgi?id=1857347  

This bug a placeholder for the issue described in:
 https://bugzilla.redhat.com/show_bug.cgi?id=1857347#c8



Version-Release number of selected component (if applicable):
libvirt 6.0.0-25
rhv-release-4.4.1-10-001.noarch
vdsm-4.40.22-1.el8ev.x86_64
4.18.0-193.14.1.el8_2.x86_64 rhel 8.2

How reproducible:
100% 

Steps to Reproduce:
1. Live VM Snapshot
2. Removal of VM snapshot
3. Repeat twice
On the third time exception occurs.

see attached logs

Actual results:
exceptions are in logs

Expected results:
Exceptions to be handled.


Additional info:

--- Additional comment from Peter Krempa on 2020-07-16 15:09:22 CEST ---

Libvirt accidentally doesn't remove the temporary bitmap after it's no longer needed when bitmaps are not present in the source image. This makes it impossible to complete any active layer block commits into the broken bitmap until the VM is restarted.


--- Additional comment from Peter Krempa on 2020-07-16 16:38:59 CEST ---

Patches proposed upstream: https://www.redhat.com/archives/libvir-list/2020-July/msg01221.html

Comment 6 yisun 2020-07-28 04:23:38 UTC
Test with:
libvirt-6.0.0-26.module+el8.3.0+7455+623d0f4c.x86_64

Result: PASS

Test steps:
1. create external snapshot
2. do blockcommit with --pivot --active
3. delete snapshot metadata
4. delete snapshot image file
5. repeat 1~4, but in step 2, do blockcommit --acitve, then do a blockjob --pivot
6. repeat 1~5 for 5 times

Shell script as follow:
[root@libvirt-rhel-8 ~]# cat test.sh 
vm=$1
for i in {1..5}  
do
      snap_name=snap_$i	
      virsh snapshot-create-as $vm $snap_name --disk-only
      sleep 2
      virsh blockcommit $vm vda --active --pivot
      sleep 2
      virsh snapshot-delete $vm $snap_name --metadata
      rm -f /var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.snap_*
      virsh snapshot-create-as $vm $snap_name --disk-only
      virsh blockcommit $vm vda --active
      sleep 2
      virsh blockjob $vm vda --pivot 
      virsh snapshot-delete $vm $snap_name --metadata
      rm -f /var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.snap_*
done


Test output as follow:
[root@libvirt-rhel-8 ~]# sh test.sh avocado-vt-vm1
Domain snapshot snap_1 created

Successfully pivoted
Domain snapshot snap_1 deleted

Domain snapshot snap_1 created
Active Block Commit started

Domain snapshot snap_1 deleted

Domain snapshot snap_2 created

Successfully pivoted
Domain snapshot snap_2 deleted

Domain snapshot snap_2 created
Active Block Commit started

Domain snapshot snap_2 deleted

Domain snapshot snap_3 created

Successfully pivoted
Domain snapshot snap_3 deleted

Domain snapshot snap_3 created
Active Block Commit started

Domain snapshot snap_3 deleted

Domain snapshot snap_4 created

Successfully pivoted
Domain snapshot snap_4 deleted

Domain snapshot snap_4 created
Active Block Commit started

Domain snapshot snap_4 deleted

Domain snapshot snap_5 created

Successfully pivoted
Domain snapshot snap_5 deleted

Domain snapshot snap_5 created
Active Block Commit started

Domain snapshot snap_5 deleted

Comment 9 errata-xmlrpc 2020-11-04 02:54:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: virt:rhel and virt-devel:rhel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4676