From 1343dc6b51bbd7f54e4377487bad4c3aebc06124 Mon Sep 17 00:00:00 2001 From: Bastian Date: Thu, 13 Jul 2023 13:24:12 +0200 Subject: [PATCH] fixed: Correct target host now displayed in log messsage, Add downtime counter --- crossover | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crossover b/crossover index 0eb853f..726eaba 100755 --- a/crossover +++ b/crossover @@ -415,6 +415,8 @@ function mirror() { local -i endjob local -i vmcount=0 local -i diskcount=0 + local -i startdowntime + local -i enddowntime local disp_perf_freeze_failed local disp_perf_ss_failed @@ -496,6 +498,7 @@ function mirror() { do_run "ha-manager remove $vm_id" fi do_run "ssh root@${pvnode[$vm_id]} qm shutdown $vm_id >/dev/null" + startdowntime=$(date +%s) fi #Lock on source + destination @@ -638,8 +641,10 @@ function mirror() { fi #--migrate so start on destination? if [ $opt_migrate -eq 1 ]; then - log info "VM $dvmid - Starting VM on ${pvnode[$vm_id]}" + log info "VM $dvmid - Starting VM on ${dstpvnode[$dvmid]}" do_run "ssh root@""${dstpvnode[$dvmid]}"" qm start "$dvmid >/dev/null + enddowntime=$(date +%s) + log info "VM $dvmid - Downtime: $(( enddowntime - startdowntime )) Seconds" fi done