cloudstack/scripts/vm/hypervisor/kvm
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
..
gpudiscovery.sh Fix domain parsing for GPU & add Display controller in the supported PCI class (#12981) 2026-04-10 09:23:07 +05:30
kvmheartbeat.sh pre-commit: add hook to trim trailing whitespace (#8205) 2024-05-28 09:01:30 +02:00
kvmsmpheartbeat.sh KVM: Enable HA heartbeat on ShareMountPoint (#12773) 2026-04-10 14:12:40 +05:30
kvmspheartbeat.sh KVM Host HA enhancement for StorPool storage (#8045) 2023-11-04 12:35:37 +05:30
kvmvmactivity.sh Improve logs on kvmvmactivity.sh (#4704) 2021-05-10 16:26:55 +02:00
nasbackup.sh feat(backup): cascade-delete + chain repair for NAS incrementals 2026-04-27 19:24:02 +03:00
nsrkvmbackup.sh Standardize and auto add license headers for Shell files with pre-commit (#12070) 2025-11-14 14:23:41 +01:00
nsrkvmrestore.sh Standardize and auto add license headers for Shell files with pre-commit (#12070) 2025-11-14 14:23:41 +01:00
patch.sh Adding AutoScaling for cks + CKS CoreOS EOL update + systemvmtemplate improvements (#4329) 2021-10-06 21:17:41 +05:30
setup_agent.sh pre-commit: add hook to trim trailing whitespace (#8205) 2024-05-28 09:01:30 +02:00