cloudstack/scripts/vm/hypervisor/kvm
James Peru 43e2f7504a feat(backup): on-demand bitmap recreation for incremental NAS backup
CloudStack rebuilds the libvirt domain XML on every VM start, which means
persistent QEMU dirty bitmaps don't survive a stop/start cycle. Rather
than hooking into the VM start lifecycle (intrusive across the
orchestration layer), this commit handles the missing bitmap *lazily* at
the next backup attempt:

  nasbackup.sh
    - When -M incremental is requested, the script first checks
      `virsh checkpoint-list` for the parent bitmap. If absent, it
      recreates the checkpoint on the running domain so libvirt accepts
      the <incremental> reference. The next incremental will be larger
      than usual (it captures all writes since recreate, not since the
      previous incremental) but is correct; subsequent ones return to
      normal size.
    - On recreation, emits BITMAP_RECREATED=<name> on stdout for the
      orchestrator to record.

  BackupAnswer
    + bitmapRecreated field surfaced from the agent.

  LibvirtTakeBackupCommandWrapper
    - Strips BITMAP_RECREATED= line from stdout before size parsing.
    - Sets answer.setBitmapRecreated(...).

  NASBackupChainKeys
    + BITMAP_RECREATED key for backup_details.

  NASBackupProvider
    - When the agent reports a recreated bitmap, persists it under
      backup_details and logs an info-level message so operators can
      correlate larger-than-usual incrementals with VM restarts.

This satisfies the bitmap-loss-on-VM-restart concern from the RFC review
without touching VirtualMachineManager / StartCommand / agent lifecycle.

Refs: apache/cloudstack#12899
2026-04-27 19:10:46 +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): on-demand bitmap recreation for incremental NAS backup 2026-04-27 19:10:46 +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