[SOLVED] Deaktivierung paralleller Backup-Jobs mit PBS

ITT

Well-Known Member
Mar 19, 2021
417
101
48
43
Hallo,

habe folgendes problem:
Cluster mit 3 Nodes & einem PBS.

Wenn ich jetzt zB. einen PBS-Datastore eingerichtet habe inkl. einen täglichen Backupjob (Clusterübergreifend), dann starten die Nodes gleichzeitig ein Backup.

Wie kann ich das limitieren, dass die Nodes nicht parallel das Backup starten sondern nacheinander?
 
Hi,

beim Einrichten von Backup Jobs können diese auf bestimmte VMs und Nodes beschränkt werden. Es wäre also möglich einen Backupplan so zu erstellen, dass Node 1 um Mitternacht ein Backup macht, Node 2 um 2 Uhr in der Früh etc.
 
Stefan,

so mache ich das jetzt eh, aber es ist schon etwas unpraktisch.
Gerade wenn aus diversen Gründen bei einigen VMs die Bitmap invalid ist, dauern die Jobs ja dementsprechend länger.
Und dann müsste man jedes mal, wenn man zusätzlich diverse VMs auf andere Nodes migriert nochmals die Backupjobs anpassen.

Eventuell ein Feature-Request für den PBS, wo man per PBS-Storage die max. parallellen Jobs einstellen/limitieren kann (über Locks)?
 
Ich wünsche mir dieses Feature auch, weil mein Backupserver zu schwach (Einfaches RAID5) ist und mit vielen Backup-Jobs (PVE-Backups und anderes) überlastet ist. Deswegen möchte ich die Last schön verteilen bzw. Parallelität vermeiden und die maximale Performance rausholen.

Im Moment tut es ein einfaches Shellscript, dass vzdump von einem Steuerungshost aus sequentiell auf allen Servern per SSH anstoesst:

Code:
#!/bin/bash

declare -rx NOTIFICATION_ADDRESS=tech@domain.tld
declare -rx VZDUMP_OPTIONS=(--mailnotification=failure --mailto=$NOTIFICATION_ADDRESS --mode=snapshot \
                --notes-template="{{guestname}}"  --prune-backups=keep-daily=2,keep-last=2,keep-monthly=2 --all)
declare -rx SSH_OPTIONS=(-l root)

declare -rx PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin

# fill in your servers here, and at the same position in the second line the corresponding storage name to backup those servers to
declare -rx  DUMP_TARGETS=(kvm10-alpha    kvm11-alpha    kvm12-alpha    kvm13-gamma    kvm14-gamma    kvm15-gamma)
declare -rx DUMP_STORAGES=(pbs_kvm101112  pbs_kvm101112  pbs_kvm101112  pbs_kvm131415  pbs_kvm131415  pbs_kvm131415)

declare -rx LOGFILE=$HOME/vzdump.log

mylog() {
        echo "$(date) : $*" >>$LOGFILE
}

do_dump() {

        local target="$1"
        local storage="$2"
        mylog "dumping vms of pve host $target to storage $storage"
        ssh "${SSH_OPTIONS[@]}" "$target" vzdump "${VZDUMP_OPTIONS[@]}" --storage="$storage" >>$LOGFILE 2>&1
        mylog "dumping of pve host $target finished"
}

main() {

        mylog "starting backup run"
        for((i=0;i<${#DUMP_TARGETS[@]};i++));do
                do_dump "${DUMP_TARGETS[$i]}" "${DUMP_STORAGES[$i]}"
        done
        mylog "backup run finished"

}

main &
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!