File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
scripts/vm/hypervisor/kvm Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,27 @@ backup_running_vm() {
100100 name=" datadisk"
101101 done
102102 echo " </disks></domainbackup>" >> $dest /backup.xml
103+ d
104+ local thaw=0
105+ if virsh -c qemu:///system qemu-agent-command " $VM " ' {"execute":"guest-fsfreeze-freeze"}' > /dev/null 2> /dev/null; then
106+ thaw=1
107+ fi
103108
104109 # Start push backup
105- virsh -c qemu:///system backup-begin --domain $VM --backupxml $dest /backup.xml > /dev/null 2> /dev/null
110+ local backup_begin=0
111+ if virsh -c qemu:///system backup-begin --domain $VM --backupxml $dest /backup.xml > /dev/null 2>&1 ; then
112+ backup_begin=1;
113+ fi
114+
115+ if [[ $thaw -eq 1 ]]; then
116+ if ! virsh -c qemu:///system qemu-agent-command " $VM " ' {"execute":"guest-fsfreeze-thaw"}' > /dev/null 2>&1 ; then
117+ echo " FS thaw failed for $VM "
118+ fi
119+ fi
120+
121+ if [[ $backup_begin -ne 1 ]]; then
122+ exit 1
123+ fi
106124
107125 # Backup domain information
108126 virsh -c qemu:///system dumpxml $VM > $dest /domain-config.xml 2> /dev/null
You can’t perform that action at this time.
0 commit comments