This is an automated email from the ASF dual-hosted git repository.
weizhouapache pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new f9a94518606 [NAS Backup] Suppress Errors in Disk Usage Calculation
that Caused Backup to Fail (#13424)
f9a94518606 is described below
commit f9a94518606910aa080201390ea0b3d6c22db080
Author: Davi Torres <[email protected]>
AuthorDate: Tue Jul 7 09:02:11 2026 -0400
[NAS Backup] Suppress Errors in Disk Usage Calculation that Caused Backup
to Fail (#13424)
---
scripts/vm/hypervisor/kvm/nasbackup.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/vm/hypervisor/kvm/nasbackup.sh
b/scripts/vm/hypervisor/kvm/nasbackup.sh
index e7ad3657cf0..b35908a433e 100755
--- a/scripts/vm/hypervisor/kvm/nasbackup.sh
+++ b/scripts/vm/hypervisor/kvm/nasbackup.sh
@@ -34,7 +34,7 @@ BACKUP_DIR=""
DISK_PATHS=""
QUIESCE=""
logFile="/var/log/cloudstack/agent/agent.log"
-
+UNMOUNT_TIMEOUT=60
EXIT_CLEANUP_FAILED=20
log() {
@@ -197,10 +197,10 @@ backup_running_vm() {
# Print statistics
virsh -c qemu:///system domjobinfo $VM --completed
- du -sb $dest | cut -f1
-
- umount $mount_point
- rmdir $mount_point
+ backup_size=$(du -sb "$dest" 2>>"$logFile" | cut -f1) || { log -ne "WARNING:
du failed for $dest, reporting size as 0"; backup_size=0; }
+ timeout "$UNMOUNT_TIMEOUT" umount "$mount_point" 2>>"$logFile" || { log
"WARNING: umount of $mount_point failed or timed out"; true; }
+ rmdir "$mount_point" 2>>"$logFile" || { log "WARNING: rmdir of $mount_point
failed"; true; }
+ echo "$backup_size"
}
backup_stopped_vm() {