Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retention for incremental backups #6029

Closed
3 tasks
rsmontero opened this issue Dec 2, 2022 · 2 comments
Closed
3 tasks

Retention for incremental backups #6029

rsmontero opened this issue Dec 2, 2022 · 2 comments

Comments

@rsmontero
Copy link
Member

rsmontero commented Dec 2, 2022

Description
Backup interface provides retention (KEEP_LAST) to only keep the last N backups. This feature is not implemented for incremental chains.

This feature needs to implement a "rebase" or "commit" action in the backup drivers that takes an increment (or a set of increments) and commit the changes to the previous one. This way we can opt to rebase on the FULL backup or an arbitrary increment for performance reasons.

Use case
Control backup datastore usage without the need of doing a reset of the incremental chain

Interface Changes
None (or add a new parameter to KEEP_LAST_INCREMENTS, to be able to keep some separated FULL backups). Driver new actions required.

Additional Context
NONE

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
@nachowork90
Copy link

This idea is something as synthetic_full, merging the incr#1 in the previous full#0.

The active_full already implemented activating the reset flag.

Will be good if the reset backup chain flag were a separated function, and not inside the same backup execution.

@tinova tinova assigned FrederickBor and unassigned FrederickBor Jan 30, 2023
rsmontero added a commit that referenced this issue Feb 9, 2023
* Introduce support to follow KEEP_LAST for incremental backups.
  - New increment_flatten action added for backup datastores.
  - increment_flatten will consolidate KEEP_LAST increments into the
    current first increment in the chain.
  - increment_flatten MUST return the new chain (inc1:source1,...) and size
    of the new first increment (FULL) in the chain.

* Downloader logic for restore has been extracted from downloader.sh to
  reuse the increment flatten logic. A new command restic_downloader.rb
  process restic:// pseudo-urls.

* Restore process uses two new attributes to customize the restore
  process:
  - NAME to be used as base name for images and VM Template
  - INCREMENT_ID to restore disks from a given increment (not always the
    last one)

* Common logic has been added to BackupImage class (backup.rb)

* Includes the following fixes:
  - Fix when increment includes blocks larger than max qemu-io request size
  - Fix IMAGE counter for quotas on backup images
  - Fix rsync restore NO_IP / NO_NIC attributes

TODO:
* Mimic increment_flatten logic and restore images on the backup server
* Suntone restore options

co-authored-by:Michal Opala <mopala@opennebula.io>
rsmontero added a commit that referenced this issue Feb 9, 2023
Some backup drivers may not allow delete (forget) operations while an
active backup is being performed. This commits fails the
one.image.delete API call in that case.

A new configuration attribute to describe the related driver behavior has been
added CONCURRENT_FORGET for DS_MAD_CONF.

(cherry picked from commit 940c1d7)
rsmontero added a commit to OpenNebula/docs that referenced this issue Feb 15, 2023
rsmontero added a commit to OpenNebula/docs that referenced this issue Feb 15, 2023
rsmontero added a commit to OpenNebula/docs that referenced this issue Feb 15, 2023
rsmontero added a commit to OpenNebula/docs that referenced this issue Feb 15, 2023
rsmontero added a commit to OpenNebula/docs that referenced this issue Feb 15, 2023
rsmontero added a commit that referenced this issue Feb 21, 2023
This prevents a race condition on when flatten and backup actions are triggered
simultaneously.

(cherry picked from commit e6c7c51)
rsmontero pushed a commit that referenced this issue Feb 21, 2023
rsmontero added a commit that referenced this issue Feb 21, 2023
Extending the BACKUP state may lead to unneed wait times to perform VM
management operations

Fixes reset of backup chains for poweroff state

(cherry picked from commit 377db96)
rsmontero added a commit that referenced this issue Feb 21, 2023
The result of a flatten operation can be optionally sparsify to free
space. This needs 'virt-sparsify' tool from libguestfs package.

Note: if not present the sparsify step will be skipped.
(cherry picked from commit de10e61)
rsmontero pushed a commit that referenced this issue Feb 21, 2023
* Fix rsync datastore monitoring
* Add increment flatten for rsync backups
* Fix/Refactor rsync restore action handler
* Fix/Refactor rsync rm action handler
* Add dedicated downloader code for rsync

(cherry picked from commit f4eee21)
rsmontero pushed a commit that referenced this issue Feb 28, 2023
rsmontero added a commit that referenced this issue Feb 28, 2023
When doing incremental backups it MUST reuse the current datastore ID.
This commits forces this setting ignoring the API parameter in this case.

(cherry picked from commit 01c490a)
rsmontero pushed a commit that referenced this issue Feb 28, 2023
rsmontero pushed a commit that referenced this issue Feb 28, 2023
* Add sparsify for rsync + merge_chain refactor
* Linting

(cherry picked from commit b369372)
rsmontero pushed a commit that referenced this issue Feb 28, 2023
* F #6029: Fix rsync downloader full backup handling
- "short-circuit" full backups
- disable sparsify for rsync downlaoder

* F #6029: Fix restic downloader full backup handling
- "short-circuit" full backups
- disable sparsify for restic downlaoder

(cherry picked from commit 53caf68)
rsmontero pushed a commit that referenced this issue Mar 1, 2023
Possible fix for "Message received: BACKUP SUCCESS 96 -" (?)

(cherry picked from commit e6652bd)
rsmontero added a commit that referenced this issue Mar 1, 2023
* Introduce support to follow KEEP_LAST for incremental backups.
  - New increment_flatten action added for backup datastores.
  - increment_flatten will consolidate KEEP_LAST increments into the
    current first increment in the chain.
  - increment_flatten MUST return the new chain (inc1:source1,...) and size
    of the new first increment (FULL) in the chain.

* Downloader logic for restore has been extracted from downloader.sh to
  reuse the increment flatten logic. A new command restic_downloader.rb
  process restic:// pseudo-urls.

* Restore process uses two new attributes to customize the restore
  process:
  - NAME to be used as base name for images and VM Template
  - INCREMENT_ID to restore disks from a given increment (not always the
    last one)

* Common logic has been added to BackupImage class (backup.rb)

* Includes the following fixes:
  - Fix when increment includes blocks larger than max qemu-io request size
  - Fix IMAGE counter for quotas on backup images
  - Fix rsync restore NO_IP / NO_NIC attributes

TODO:
* Mimic increment_flatten logic and restore images on the backup server
* Suntone restore options

co-authored-by:Michal Opala <mopala@opennebula.io>
rsmontero added a commit that referenced this issue Mar 1, 2023
Some backup drivers may not allow delete (forget) operations while an
active backup is being performed. This commits fails the
one.image.delete API call in that case.

A new configuration attribute to describe the related driver behavior has been
added CONCURRENT_FORGET for DS_MAD_CONF.
rsmontero added a commit that referenced this issue Mar 1, 2023
This prevents a race condition on when flatten and backup actions are triggered
simultaneously.
rsmontero added a commit that referenced this issue Mar 1, 2023
Extending the BACKUP state may lead to unneed wait times to perform VM
management operations

Fixes reset of backup chains for poweroff state
rsmontero added a commit that referenced this issue Mar 1, 2023
When doing incremental backups it MUST reuse the current datastore ID.
This commits forces this setting ignoring the API parameter in this case.
rsmontero added a commit that referenced this issue Mar 1, 2023
The result of a flatten operation can be optionally sparsify to free
space. This needs 'virt-sparsify' tool from libguestfs package.

Note: if not present the sparsify step will be skipped.
rsmontero pushed a commit that referenced this issue Mar 1, 2023
* Fix rsync datastore monitoring
* Add increment flatten for rsync backups
* Fix/Refactor rsync restore action handler
* Fix/Refactor rsync rm action handler
* Add dedicated downloader code for rsync
rsmontero pushed a commit that referenced this issue Mar 1, 2023
* Add sparsify for rsync + merge_chain refactor
* Linting
rsmontero pushed a commit that referenced this issue Mar 1, 2023
* F #6029: Fix rsync downloader full backup handling
- "short-circuit" full backups
- disable sparsify for rsync downlaoder

* F #6029: Fix restic downloader full backup handling
- "short-circuit" full backups
- disable sparsify for restic downlaoder
rsmontero pushed a commit that referenced this issue Mar 1, 2023
Possible fix for "Message received: BACKUP SUCCESS 96 -" (?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants