Bug 1734975 - libvirt incremental backup language bindings: perl
Summary: libvirt incremental backup language bindings: perl
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: perl-Sys-Virt
Version: 8.0
Hardware: All
OS: Unspecified
urgent
high
Target Milestone: rc
: 8.1
Assignee: Daniel Berrangé
QA Contact: yicui
URL:
Whiteboard:
Depends On: 760547 1207657 1207659
Blocks: Engine_Change_Block_Tracking 1482928
TreeView+ depends on / blocked
 
Reported: 2019-07-31 17:48 UTC by Ademar Reis
Modified: 2020-05-05 09:46 UTC (History)
27 users (show)

Fixed In Version: perl-Sys-Virt-6.0.0-1.module+el8.2.0+5488+267def79
Doc Type: Enhancement
Doc Text:
Clone Of: 1207659
Environment:
Last Closed: 2020-05-05 09:46:33 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ademar Reis 2019-07-31 17:48:02 UTC
Incremental backup introduces new APIs in libvirt and we need language bindings for them.

+++ This bug was initially created as a clone of Bug #1207659 +++

Comment 1 Xuesong Zhang 2019-08-01 03:28:35 UTC
Hi, Ademar,

The component of Perl Language binding for libvirt is called "perl-Sys-Virt", should we change the component to "perl-Sys-Virt" not libvirt here? Thx.

Comment 7 Daniel Berrangé 2019-12-12 16:40:47 UTC
commit bf99e411dcc5f5d0a8eae32d8c4d3ca8f075d6d6
Author: Daniel P. Berrangé <berrange>
Date:   Wed Dec 11 19:07:27 2019 +0000

    Add new domain backup APIs
    
    Signed-off-by: Daniel P. Berrangé <berrange>

commit c179a564d387b29cf90f08c69ffdf0957c8aeff2
Author: Daniel P. Berrangé <berrange>
Date:   Tue Dec 10 13:14:54 2019 +0000

    Add domain job constants for backups
    
    Signed-off-by: Daniel P. Berrangé <berrange>

Comment 9 yicui 2020-03-25 01:04:54 UTC
Verified on perl-Sys-Virt-6.0.0-1.module+el8.2.0+5488+267def79.x86_64.

Guest xml needs update with below setting as a workaround. Please check https://bugzilla.redhat.com/show_bug.cgi?id=1799015#c2
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
  <qemu:capabilities>
    <qemu:add capability='incremental-backup'/>
  </qemu:capabilities>
</domain>

Test scenarios:
1. Push mode Full backup
2. Push mode Full backup with BEGIN_REUSE_EXTERNAL flag
3. Push mode Incremental backup
4. Pull mode Full backup
5. Pull mode Incremental backup
6. Unsupported operation on inactive domain

Part of test codes:
===========================
... ... 
    lives_ok(sub {$dom->backup_begin($backupxml, $chp_hash{"check_full_push"}, 0)},
             "Backup begin -- check_full push mode");
    lives_ok(sub {$dom->backup_get_xml_description(0)}, "Get backup xml description");

    my $info = $dom->get_block_job_info($dst, 0);
    my $job_type = $info->{type};
    is($job_type, Sys::Virt::Domain::BLOCK_JOB_TYPE_BACKUP,
       "Block job operation is 'backup'");

    check_domjob($dom);

    # wait for the end of block pull and timeout is 120s
    wait_for_blockjob($dom, $dst, 120, "Block full push");

    check_domjob($dom, Sys::Virt::Domain::JOB_STATS_COMPLETED);
... ...
===========================

Test results:
(.libvirt-ci-venv-ci-runtest-oqOQgl) [root@tcktest domain]# libvirt-tck --testdir 266-disk-backup.t -v --force
266-disk-backup.t .. 
1..42
Version:6.0.0 compares to 6.0.0
# Convert /var/cache/libvirt-tck/266-disk-backup/chp.img from raw to qcow2
check_full_pull  => <domaincheckpoint>
  <name>check_full_pull</name>
  <disks>
    <disk name='vda' checkpoint='no'/>
    <disk name='vdb' checkpoint='bitmap'/>
  </disks>
</domaincheckpoint>

check_full_push  => <domaincheckpoint>
  <name>check_full_push</name>
  <disks>
    <disk name='vda' checkpoint='no'/>
    <disk name='vdb' checkpoint='bitmap'/>
  </disks>
</domaincheckpoint>

check_full_push_reuse  => <domaincheckpoint>
  <name>check_full_push_reuse</name>
  <disks>
    <disk name='vda' checkpoint='no'/>
    <disk name='vdb' checkpoint='bitmap'/>
  </disks>
</domaincheckpoint>

check_inc1_pull  => <domaincheckpoint>
  <name>check_inc1_pull</name>
  <disks>
    <disk name='vda' checkpoint='no'/>
    <disk name='vdb' checkpoint='bitmap'/>
  </disks>
</domaincheckpoint>

check_inc1_push  => <domaincheckpoint>
  <name>check_inc1_push</name>
  <disks>
    <disk name='vda' checkpoint='no'/>
    <disk name='vdb' checkpoint='bitmap'/>
  </disks>
</domaincheckpoint>

check_inc2_push  => <domaincheckpoint>
  <name>check_inc2_push</name>
  <disks>
    <disk name='vda' checkpoint='no'/>
    <disk name='vdb' checkpoint='bitmap'/>
  </disks>
</domaincheckpoint>

# backupxml is <domainbackup mode='push'>
#   <disks>
#     <disk name='vdb' type='file'>
#       <driver type='qcow2'/>
#       <target file="/var/cache/libvirt-tck/266-disk-backup/vdb.full.backup"/>
#     </disk>
#     <disk name='vda' backup='no'/>
#   </disks>
# </domainbackup>
ok 1 - Unsupported operation on inactive domain
ok 2 - running domain has an ID > 0
ok 3 - Backup begin -- check_full push mode
ok 4 - Get backup xml description
ok 5 - Block job operation is 'backup'
ok 6 - Domain job operation is 'backup'
ok 7 - Domain job completed successfully
ok 8 - Domain job operation is 'backup'
# image: /var/cache/libvirt-tck/266-disk-backup/vdb.full.backup
# file format: qcow2
# virtual size: 100 MiB (104857600 bytes)
# disk size: 336 KiB
# cluster_size: 65536
# Format specific information:
#     compat: 1.1
#     lazy refcounts: false
#     refcount bits: 16
#     corrupt: false
# backupxml is <domainbackup mode="push">
#   <disks>
#     <disk name="vdb" type="file">
#       <driver type="qcow2" />
#       <target file="/var/cache/libvirt-tck/266-disk-backup/vdb.full.reuse.backup" />
#     </disk>
#     <disk name="vda" backup="no" />
#   </disks>
# </domainbackup>
ok 9 - Check the backup job with Reuse flag when no backup images 
# Convert /var/cache/libvirt-tck/266-disk-backup/vdb.full.reuse.backup from raw to qcow2
ok 10 - backup begin with flag - BACKUP_BEGIN_REUSE_EXTERNAL
ok 11 - Domain job completed successfully
ok 12 - Domain job operation is 'backup'
# image: /var/cache/libvirt-tck/266-disk-backup/vdb.full.reuse.backup
# file format: qcow2
# virtual size: 100 MiB (104857600 bytes)
# disk size: 276 KiB
# cluster_size: 65536
# Format specific information:
#     compat: 1.1
#     lazy refcounts: false
#     refcount bits: 16
#     corrupt: false
# backupxml is <domainbackup mode="push">
#   <disks>
#     <disk name="vdb" type="file">
#       <driver type="qcow2" />
#       <target file="/var/cache/libvirt-tck/266-disk-backup/vdb.inc1.backup" />
#     </disk>
#     <disk name="vda" backup="no" />
#   </disks>
# <incremental>check_full_push_reuse</incremental></domainbackup>
ok 13 - Backup begin -- Incremental backup 1 push mode
ok 14 - Domain job completed successfully
ok 15 - Domain job operation is 'backup'
# image: /var/cache/libvirt-tck/266-disk-backup/vdb.inc1.backup
# file format: qcow2
# virtual size: 100 MiB (104857600 bytes)
# disk size: 448 KiB
# cluster_size: 65536
# Format specific information:
#     compat: 1.1
#     lazy refcounts: false
#     refcount bits: 16
#     corrupt: false
# backupxml is <domainbackup mode="push">
#   <disks>
#     <disk name="vdb" type="file">
#       <driver type="qcow2" />
#       <target file="/var/cache/libvirt-tck/266-disk-backup/vda.inc2.backup" />
#     </disk>
#     <disk name="vda" backup="no" />
#   </disks>
# <incremental>check_inc1_push</incremental></domainbackup>
ok 16 - Backup begin -- Incremental backup 2 push mode
ok 17 - Domain job completed successfully
ok 18 - Domain job operation is 'backup'
# image: /var/cache/libvirt-tck/266-disk-backup/vda.inc2.backup
# file format: qcow2
# virtual size: 100 MiB (104857600 bytes)
# disk size: 448 KiB
# cluster_size: 65536
# Format specific information:
#     compat: 1.1
#     lazy refcounts: false
#     refcount bits: 16
#     corrupt: false
# backupxml is <domainbackup mode='pull'>
#   <server name="localhost" port="10809"/>
#   <disks>
#     <disk name="vdb" backup='yes' type='file'>
#         <scratch file="/var/cache/libvirt-tck/266-disk-backup/scratch/vdb.full.pull.backup"/>
#     </disk>
#     <disk name='vda' backup='no'/>
#   </disks>
# </domainbackup>
ok 19 - Backup begin -- check_full pull mode
ok 20 - Domain job operation is 'backup'
ok 21 - Sys::Virt::Domain::JOB_DISK_TEMP_USED -- 0
ok 22 - Sys::Virt::Domain::JOB_DISK_TEMP_TOTAL -- 104857600
# convert imgs
# 
# image: /var/cache/libvirt-tck/266-disk-backup/vdb.full.pull.backup
# file format: qcow2
# virtual size: 100 MiB (104857600 bytes)
# disk size: 452 KiB
# cluster_size: 65536
# Format specific information:
#     compat: 1.1
#     lazy refcounts: false
#     refcount bits: 16
#     corrupt: false
ok 23 - Abort block job
ok 24 - Domain job completed successfully
ok 25 - Domain job operation is 'backup'
ok 26 - Sys::Virt::Domain::JOB_DISK_TEMP_USED -- 0
ok 27 - Sys::Virt::Domain::JOB_DISK_TEMP_TOTAL -- 104857600
# backupxml is <domainbackup mode="pull">
#   <server name="localhost" port="10809" />
#   <disks>
#     <disk name="vdb" backup="yes" type="file">
#         <scratch file="/var/cache/libvirt-tck/266-disk-backup/scratch/vdb.inc1.pull.backup" />
#     </disk>
#     <disk name="vda" backup="no" />
#   </disks>
# <incremental>check_full_pull</incremental></domainbackup>
ok 28 - Backup begin -- check_inc pull mode
ok 29 - Domain job operation is 'backup'
ok 30 - Sys::Virt::Domain::JOB_DISK_TEMP_USED -- 0
ok 31 - Sys::Virt::Domain::JOB_DISK_TEMP_TOTAL -- 104857600
ok 32 - Abort block job
ok 33 - Domain job completed successfully
ok 34 - Domain job operation is 'backup'
ok 35 - Sys::Virt::Domain::JOB_DISK_TEMP_USED -- 0
ok 36 - Sys::Virt::Domain::JOB_DISK_TEMP_TOTAL -- 104857600
# delete checkpoint check_full_push
ok 37 - Deleted checkpoint check_full_push
# delete checkpoint check_full_push_reuse
ok 38 - Deleted checkpoint check_full_push_reuse
# delete checkpoint check_inc1_push
ok 39 - Deleted checkpoint check_inc1_push
# delete checkpoint check_inc2_push
ok 40 - Deleted checkpoint check_inc2_push
# delete checkpoint check_full_pull
ok 41 - Deleted checkpoint check_full_pull
# delete checkpoint check_inc1_pull
ok 42 - Deleted checkpoint check_inc1_pull
ok
All tests successful.
Files=1, Tests=42,  4 wallclock secs ( 0.03 usr  0.01 sys +  0.28 cusr  0.08 csys =  0.40 CPU)
Result: PASS

Comment 11 errata-xmlrpc 2020-05-05 09:46:33 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, 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/RHBA-2020:2017


Note You need to log in before you can comment on or make changes to this bug.