Bug 1813831 - [RFE][CBT] Allow to view and remove VM backup checkpoints
Summary: [RFE][CBT] Allow to view and remove VM backup checkpoints
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.4.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.4.1
: ---
Assignee: Eyal Shenitzky
QA Contact: Ilan Zuckerman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-16 09:07 UTC by Eyal Shenitzky
Modified: 2022-02-01 11:33 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
This enhancement enables you to remove incremental backup root checkpoints. Backing up a virtual machine (VM) creates a checkpoint in libvirt and the RHV Manager's database. In large scale environments, these backups can produce a high number of checkpoints. When you restart virtual machines, the Manager redefines their checkpoints on the host; if there are many checkpoints, this operation can degrade performance. The checkpoints' XML descriptions also consume a lot of storage. This enhancement provides the following operations: * View all the VM checkpoints using the new checkpoints service under the VM service - `GET path-to-engine/api/vms/vm-uuid/checkpoints` * View a specific checkpoint - `GET path-to-engine/api/vms/vm-uuid/checkpoints/checkpoint-uuid` * Remove the oldest (root) checkpoint from the chain - `DELETE path-to-engine/api/vms/vm-uuid/checkpoints/checkpoint-uuid`
Clone Of:
Environment:
Last Closed: 2020-08-05 06:24:42 UTC
oVirt Team: Storage
Embargoed:
pm-rhel: ovirt-4.4+
izuckerm: testing_plan_complete+
pelauter: planning_ack+
pm-rhel: devel_ack+
aefrat: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-38197 0 None None None 2021-12-08 09:59:28 UTC
oVirt gerrit 109419 0 master MERGED core: introduce DeleteVmCheckpointCommand 2021-01-28 08:10:50 UTC
oVirt gerrit 109420 0 master MERGED core: Add queries for VmCheckpoint 2021-01-28 08:10:50 UTC
oVirt gerrit 109421 0 master MERGED restapi: introduce VmCheckpoint resources 2021-01-28 08:10:50 UTC
oVirt gerrit 109424 0 master MERGED incremental backup: added VmCheckpoint service 2021-01-28 08:10:50 UTC
oVirt gerrit 109798 0 master MERGED core: update new root checkpoint after checkpoint removal 2021-01-28 08:10:50 UTC
oVirt gerrit 110010 0 master MERGED core: Bump ovirt-engine-api-model to 4.4.17 2021-01-28 08:10:50 UTC

Description Eyal Shenitzky 2020-03-16 09:07:32 UTC
Description of problem:

For each VM backup that created a checkpoint created on Libvirt side.
The engine persists all the checkpoints in his database for later use when the VM goes down or crash.

Currently, the user has no way to view and delete those checkpoints only using manual operations in the database directly.

We should provide an API to allow removing VM backup checkpoint in order to clean the database.  

Version-Release number of selected component (if applicable):
4.4-master

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with qcow disks
2. Start a VM backup


Actual results:
Checkpoint created and kept in the database without a way to remove it.

Expected results:
The engine should provide a way to remove the checkpoint


Additional info:

Comment 1 Avihai 2020-07-01 06:29:47 UTC
Eyal, please provide a clear verification scenario.

Comment 2 Sandro Bonazzola 2020-07-01 09:16:00 UTC
This bug is in POST state, targeted to 4.4.1 with pending patches not merged yet.
At this time we are handling only blockers for 4.4.1.
Please either mark this bug as blocker or move it out to >= 4.4.2

Comment 3 Eyal Shenitzky 2020-07-01 11:43:25 UTC
(In reply to Avihai from comment #1)
> Eyal, please provide a clear verification scenario.

You can find the documentation for the new 'checkpoints' API in - 
https://ovirt.org/develop/release-management/features/storage/incremental-backup.html

Under 'Checkpoint deletion' and 'Checkpoints REST API' topics.

Comment 4 Eyal Shenitzky 2020-07-06 07:16:48 UTC
Also, a new script for checkpoint removal added to the SDK.
The patch is available to review - https://gerrit.ovirt.org/#/c/110123/
But not merged yet.

Comment 5 Ilan Zuckerman 2020-07-22 10:20:58 UTC
Eyal, pls specify the name of the table where the checkpoints are stored.
So i could verify with the script that they are being removed from DB properly.

Comment 6 Eyal Shenitzky 2020-07-22 12:28:06 UTC
(In reply to Ilan Zuckerman from comment #5)
> Eyal, pls specify the name of the table where the checkpoints are stored.
> So i could verify with the script that they are being removed from DB
> properly.

Using this new feature you can check that the checkpoint removed from - 

path-to-engine/api/vms/vm-uuid/checkpoints

But If you want to check the DB here are the queries:

select * from vm_checkpoints where checkpoint_id='checkpoint-uuid';

select * from vm_checkpoints_disks_map where checkpoint_id='checkpoint-uuid';

Comment 7 Ilan Zuckerman 2020-07-23 07:18:18 UTC
Verified on rhv-release-4.4.1-11-001.noarch

On this release, the script is not yet integrated. 
So i downloaded it + helpers/common.py
From:
https://gerrit.ovirt.org/#/c/109309/10

And placed them to /usr/share/doc/python3-ovirt-engine-sdk4/examples/  on the host


Test steps:

1. Enable incremental backup on engine:
engine-config -s "IsIncrementalBackupSupported=true" --cver 4.4 && systemctl restart ovirt-engine

2. Create vm from template
3. Enable 'backup' for VMs disk
4. Full backup the disk
5. finalize the backup

Expected:
6. Check records in DB table 'vm_checkpoints', there should be one record aligned with the vm.

Actual:
As expected.
engine=# select count(*) from vm_checkpoints;
-[ RECORD 1 ]
count | 1

Expected:
7. Check response of the API GET call 
{{engine}}vms/{{myvm_id}}/checkpoints
the response should have one corresponding checkpoint.

Actual:
As expected.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<checkpoints>
    <checkpoint href="/ovirt-engine/api/vms/6d1a81c9-1356-46f1-a9ea-093cd1ff1113/checkpoints/de1520e3-110c-4992-b637-6a9c029e648d" id="de1520e3-110c-4992-b637-6a9c029e648d">
        <link href="/ovirt-engine/api/vms/6d1a81c9-1356-46f1-a9ea-093cd1ff1113/checkpoints/de1520e3-110c-4992-b637-6a9c029e648d/disks" rel="disks"/>
        <creation_date>2020-07-23T09:47:54.998+03:00</creation_date>
        <vm href="/ovirt-engine/api/vms/6d1a81c9-1356-46f1-a9ea-093cd1ff1113" id="6d1a81c9-1356-46f1-a9ea-093cd1ff1113"/>
    </checkpoint>
</checkpoints>


8. Repeat steps 4-5 to create a new checkpoint
9. repeat checks 6-7. There should be two checkpoints this time, both in DB and API. All as expected.
10. Use the remove_checkpoint.py script to remove root checkpoint for that vm.

[root@storage-ge5-vdsm1 ~]# python3 /usr/share/doc/python3-ovirt-engine-sdk4/examples/remove_checkpoint.py 6d1a81c9-1356-46f1-a9ea-093cd1ff1113 --engine-url https://storage-ge-05XXX --username XXX -c ca.pem 
[   0.0 ] Removing root checkpoint for VM '6d1a81c9-1356-46f1-a9ea-093cd1ff1113'
Password: 
[   3.3 ] Looking up checkpoints 6d1a81c9-1356-46f1-a9ea-093cd1ff1113
[   3.5 ] Removing root checkpoint 'de1520e3-110c-4992-b637-6a9c029e648d'
[  10.8 ] Root checkpoint removed successfully


Expected:
- root checkpoint should be removed

Actual:
- Root checkpoint removed, but the second checkpoint (created by second backup) remains.

==============================================================================

I repeated the same steps for a blank vm as well with two disks

Comment 8 Sandro Bonazzola 2020-08-05 06:24:42 UTC
This bugzilla is included in oVirt 4.4.1 release, published on July 8th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.1 release, it has been closed with a resolution of CURRENT RELEASE.

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


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