Damans227 commented on code in PR #14194:
URL: https://github.com/apache/cloudstack/pull/14194#discussion_r4260250633


##########
scripts/vm/hypervisor/kvm/nasbackup.sh:
##########
@@ -134,6 +137,217 @@ get_linstor_uuid_from_device() {
   return 1
 }
 
+# ---------------------------------------------------------------------------
+# Content-based backup path (libvirt pull mode).
+#
+# Used for raw block-device disks such as LINSTOR/DRBD. Those cannot carry QEMU
+# persistent dirty bitmaps -- persistence is a qcow2-only feature -- so libvirt
+# checkpoints, and with them the push-mode incremental path, are unavailable.
+#
+# Instead libvirt is asked for a pull-mode backup: it starts an NBD server 
exposing a
+# point-in-time view of each disk, held consistent by copy-before-write into 
local
+# fleecing scratch images. The backup is then derived from that export:
+#
+#   content-full         qemu-img convert -> sparse standalone qcow2. Zero 
detection
+#                        happens while streaming, so the fully allocated 
push-mode
+#                        output and its separate re-convert pass are both 
avoided.
+#   content-incremental  a qcow2 overlay backed by the NBD export, then a SAFE 
rebase
+#                        onto the parent backup. That merges exactly the 
clusters which
+#                        differ between export and parent into the overlay, 
yielding a
+#                        delta qcow2 backed by the parent -- the same chain 
shape the
+#                        push-mode incremental produces, so restore/delete are 
unchanged.
+#
+# Unlike a storage-snapshot based diff there is no trailing DRBD metadata to 
clip: the
+# DRBD device, and therefore the NBD export, is already net-sized.
+#
+# Assumes mount_operation() already ran, so $dest and $mount_point are set.
+# ---------------------------------------------------------------------------
+backup_running_vm_pull() {
+  local effective_mode="$1"
+
+  # Scratch area for the NBD socket and libvirt's fleecing images. Never on 
the NAS:
+  # copy-before-write runs inline with guest writes, so it wants fast local 
storage with
+  # room for the write churn during the backup. 711 lets the qemu process 
traverse in to
+  # the files libvirt creates as root.
+  local scratch_dir
+  scratch_dir=$(mktemp -d "$SCRATCH_PARENT/csbackup-scratch.XXXXXX") || {

Review Comment:
   fair, with pull mode opt-in and the size up to the admin thats fine



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to