cloudstack/plugins/hypervisors
James Peru b8d069e127 feat(backup): cascade-delete + chain repair for NAS incrementals
Adds the delete-with-chain-repair semantics agreed in the RFC review:

  scripts/vm/hypervisor/kvm/nasbackup.sh
    - New '-o rebase' operation: rebases an existing on-NAS qcow2 onto
      a new backing parent. Uses a SAFE rebase (no -u) so the target
      absorbs blocks of the about-to-be-deleted parent before the
      backing pointer is moved up to the grandparent. Writes the new
      backing reference relative to the target's directory so it
      survives mount-point changes.
    - New CLI flags --rebase-target, --rebase-new-backing (both passed
      mount-relative).

  RebaseBackupCommand + LibvirtRebaseBackupCommandWrapper
    - New agent command that wraps the script's rebase operation. The
      provider sends one of these per child that needs re-pointing.

  NASBackupProvider.deleteBackup
    - Now plans the chain repair before touching files via
      computeChainRepair():
        * No chain metadata     -> single-file delete (legacy behaviour)
        * Tail incremental      -> single delete, no rebase
        * Middle incremental    -> rebase immediate child onto our
                                   parent, then delete; shift
                                   chain_position of all later
                                   descendants by -1
        * Full with descendants -> refuse unless forced=true; with
                                   forced=true delete full + every
                                   descendant newest-first
    - Updates parent_backup_id, chain_position metadata in
      backup_details after each rebase so the model in the DB matches
      the on-disk chain.

This implements the cascade-delete behaviour requested in @abh1sar's
review point #7.

Refs: apache/cloudstack#12899
2026-04-27 19:24:02 +03:00
..
baremetal Merge branch '4.20' into 4.22 2026-04-17 03:12:33 +05:30
external Create new generic method for resource UUID obtention in event's descriptions (#12502) 2026-02-05 11:23:40 +01:00
hyperv Updating pom.xml version numbers for release 4.20.4.0-SNAPSHOT 2026-04-13 15:48:18 +05:30
kvm feat(backup): cascade-delete + chain repair for NAS incrementals 2026-04-27 19:24:02 +03:00
ovm Updating pom.xml version numbers for release 4.20.4.0-SNAPSHOT 2026-04-13 15:48:18 +05:30
ovm3 Updating pom.xml version numbers for release 4.20.4.0-SNAPSHOT 2026-04-13 15:48:18 +05:30
simulator Updating pom.xml version numbers for release 4.20.4.0-SNAPSHOT 2026-04-13 15:48:18 +05:30
ucs Updating pom.xml version numbers for release 4.20.4.0-SNAPSHOT 2026-04-13 15:48:18 +05:30
vmware Updating pom.xml version numbers for release 4.20.4.0-SNAPSHOT 2026-04-13 15:48:18 +05:30
xenserver Updating pom.xml version numbers for release 4.20.4.0-SNAPSHOT 2026-04-13 15:48:18 +05:30