Skip to content

Implement checkBitmap to check bitmap status before backup - #866

Open
dupondje wants to merge 4 commits into
oVirt:masterfrom
dupondje:check_bitmap_before_backup
Open

Implement checkBitmap to check bitmap status before backup#866
dupondje wants to merge 4 commits into
oVirt:masterfrom
dupondje:check_bitmap_before_backup

Conversation

@dupondje

@dupondje dupondje commented Jun 6, 2023

Copy link
Copy Markdown
Member

Sometimes a bitmap cam become invalid/corrupt without oVirt noticing this. For example if a hypervisor crashes, the active bitmap will become invalid.

This will currently cause oVirt to fail to create a NBDServer, as it will error with 'Bitmap does not exist in ...'.

We add a command to check the bitmap status before the backup is created. If the bitmap is invalid, we throw an error and remove the invalid bitmapId.

The VDSM side also needs to be implemented, but that's easy :)
Would be great if some maintainer can give his comments on the idea and the code!

@dupondje
dupondje force-pushed the check_bitmap_before_backup branch 3 times, most recently from d78fecc to 7b8763f Compare June 8, 2023 10:49
@dupondje
dupondje requested a review from bennyz June 8, 2023 11:55
@bennyz

bennyz commented Jun 11, 2023

Copy link
Copy Markdown
Contributor

Is there a corresponding vdsm PR? it would need to be merged first, also, I think we'll need to add this verb to host capabilities[1] so it isn't sent to older hosts

[1] https://github.com/oVirt/vdsm/blob/07d3089049b1ac81a3efbc14856679c4aa82b412/lib/vdsm/host/caps.py

@dupondje
dupondje force-pushed the check_bitmap_before_backup branch from 7b8763f to 4fc426d Compare July 5, 2023 13:27
@dupondje

dupondje commented Jul 5, 2023

Copy link
Copy Markdown
Member Author

Updated the code to work with the latest vdsm patch oVirt/vdsm#394

@sandrobonazzola
sandrobonazzola force-pushed the check_bitmap_before_backup branch from 4fc426d to 376c883 Compare November 28, 2023 12:50
@sandrobonazzola
sandrobonazzola force-pushed the check_bitmap_before_backup branch 2 times, most recently from 06ed7ca to 4ab605c Compare June 10, 2024 09:15
@sandrobonazzola
sandrobonazzola requested a review from bennyz June 10, 2024 09:15
@sandrobonazzola
sandrobonazzola requested review from BrooklynDewolf and removed request for ljelinkova and oliel July 10, 2024 10:20
@sandrobonazzola
sandrobonazzola force-pushed the check_bitmap_before_backup branch 2 times, most recently from 0eddbab to e587a87 Compare October 4, 2024 08:28
Extend the GetQemuImageInfoVDSCommand command to also provide
information about the bitmaps.

This data will only be valid when the hypervisor has the
qemu_image_info_bitmaps capability.

The bitmap information can be used to validate the engine's bitmap data
with the qemu-img info.

VDSM PR: oVirt/vdsm#394

Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
…ntsCommand

If there is checkpoint inconsistency between the checkpoints in the
database and those on-disk, then we need to remove all checkpoints
on-disk and in the database.
But the on-disk removal can fail because the checkpoint is already gone
because of some corruption (for example due to an unclean shutdown).

Therefor we want to allow DeleteAllVmCheckpointsCommand to continue on
failure in some cases.

Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Instead of re-implement the functionality from DeleteAllVmCheckpoints,
we just use DeleteAllVmCheckpoints and pass to force flag to allow
DeleteAllVmCheckpoints to continue on failures.

Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Sometimes a bitmap can become invalid/corrupt without oVirt noticing
this. For example if a hypervisor crashes, the active bitmap will become
invalid.
This means that the qcow2 volume does not contain the bitmap anymore,
but oVirt thinks the bitmap still exists because it's in the database.

This will currently cause oVirt to fail to create a NBDServer, as it
will error with 'Bitmap does not exist in ...'.

We use the QemuImageInfo to get all the on-disk bitmaps and compare
them with the bitmaps in the oVirt database. If there is some
inconsistency we remove all the bitmaps/checkpoints.

Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants