Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Praktische Anwendungen (Showcase)
    4. Automatischer proxmox backup restore auf einen anderen NUC.

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Automatischer proxmox backup restore auf einen anderen NUC.

    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      saeft_2003 Most Active last edited by

      Ich hatte eine Zeit lang über ein proxmox HA cluster nachgedacht, aber 3 nodes laufen zu lassen usw. war dann doch zu viel für mich. Deswegen habe ich mir ein Skript erstellt, dass nach einer beliebigen Zeit (bei mir eine Woche) einen Ersatz NUC startet und hier die aktuellen VM backups von einer Diskstation einspielt.

      Das heißt bei einem Ausfall des produktiven NUCs hätte ich immer einen Ersatz NUC einsatzbereit der maximal einen Stand vor einer Woche hat und sofort einsatzbereit ist. Klar kann man jetzt sagen das ein manuelles einspielen der backups auch nicht sehr lange dauern würde, aber ich fand es sinnvoll wenn man schon nach wenigen Minuten wieder ein komplett einsatzbereites System hat.

      1. Mit dem linux-control Adapter und dem Befehl "cd /mnt/pve/Diskstation/dump && ls" schreibe ich eine Liste der aktuellen Backups in einen DP.
      vzdump-qemu-100-2021_11_08-03_00_01.vma.gz
      vzdump-qemu-100-2021_11_10-03_00_01.vma.gz
      vzdump-qemu-100-2021_11_12-03_00_01.vma.gz
      vzdump-qemu-100-2021_11_14-03_00_02.vma.gz
      vzdump-qemu-100-2021_11_15-03_00_01.vma.gz
      vzdump-qemu-100-2021_11_17-03_00_02.vma.gz
      vzdump-qemu-100-2021_11_19-03_00_02.vma.gz
      vzdump-qemu-100-2021_11_21-03_00_01.vma.gz
      vzdump-qemu-100-2021_11_22-03_00_02.vma.gz
      vzdump-qemu-100-2021_11_24-03_00_01.vma.gz
      vzdump-qemu-100-2021_11_26-03_00_02.vma.gz
      vzdump-qemu-100-2021_11_28-03_00_02.vma.gz
      vzdump-qemu-100-2021_11_29-03_00_02.vma.gz
      vzdump-qemu-100-2021_12_01-03_00_01.vma.gz
      vzdump-qemu-100-2021_12_05-03_00_01.vma.gz
      vzdump-qemu-101-2021_11_27-14_44_36.vma.zst
      vzdump-qemu-101-2021_11_27-18_15_27.vma.gz
      vzdump-qemu-101-2021_12_03-03_00_01.vma.gz
      vzdump-qemu-101-2021_12_06-03_00_02.vma.gz
      vzdump-qemu-101-2021_12_08-03_00_02.vma.gz
      vzdump-qemu-101-2021_12_10-03_00_02.vma.gz
      vzdump-qemu-101-2021_12_12-03_00_01.vma.gz
      vzdump-qemu-101-2021_12_13-03_00_01.vma.gz
      vzdump-qemu-101-2021_12_15-03_00_02.vma.gz
      vzdump-qemu-101-2021_12_17-03_00_01.vma.gz
      vzdump-qemu-101-2021_12_19-03_00_02.vma.gz
      vzdump-qemu-101-2021_12_20-03_00_02.vma.gz
      vzdump-qemu-101-2021_12_22-03_00_02.log
      vzdump-qemu-101-2021_12_22-03_00_02.vma.gz
      vzdump-qemu-102-2021_05_27-20_35_27.vma.zst
      vzdump-qemu-200-2021_11_03-04_00_02.vma.gz
      vzdump-qemu-200-2021_11_06-04_00_02.vma.gz
      vzdump-qemu-200-2021_11_10-04_00_02.vma.gz
      vzdump-qemu-200-2021_11_13-04_00_01.vma.gz
      vzdump-qemu-200-2021_11_17-04_00_01.vma.gz
      vzdump-qemu-200-2021_11_20-04_00_02.vma.gz
      vzdump-qemu-200-2021_11_24-04_00_02.vma.gz
      vzdump-qemu-200-2021_11_27-04_00_01.vma.gz
      vzdump-qemu-200-2021_12_01-04_00_02.vma.gz
      vzdump-qemu-200-2021_12_04-04_00_02.vma.gz
      vzdump-qemu-200-2021_12_08-04_00_01.vma.gz
      vzdump-qemu-200-2021_12_11-04_00_01.vma.gz
      vzdump-qemu-200-2021_12_15-04_00_01.vma.gz
      vzdump-qemu-200-2021_12_18-04_00_01.vma.gz
      vzdump-qemu-200-2021_12_22-04_00_01.log
      vzdump-qemu-200-2021_12_22-04_00_01.vma.gz
      vzdump-qemu-300-2021_09_14-03_00_02.vma.gz
      vzdump-qemu-300-2021_09_21-03_00_02.vma.gz
      vzdump-qemu-300-2021_09_28-03_00_02.vma.gz
      vzdump-qemu-300-2021_10_05-03_00_02.vma.gz
      vzdump-qemu-300-2021_10_12-03_00_02.vma.gz
      vzdump-qemu-300-2021_10_19-03_00_02.vma.gz
      vzdump-qemu-300-2021_10_26-03_00_01.vma.gz
      vzdump-qemu-300-2021_11_02-03_00_02.vma.gz
      vzdump-qemu-300-2021_11_09-03_00_02.vma.gz
      vzdump-qemu-300-2021_11_16-03_00_02.vma.gz
      vzdump-qemu-300-2021_11_23-03_00_01.vma.gz
      vzdump-qemu-300-2021_11_30-03_00_02.vma.gz
      vzdump-qemu-300-2021_12_07-03_00_02.vma.gz
      vzdump-qemu-300-2021_12_14-03_00_01.vma.gz
      vzdump-qemu-300-2021_12_21-03_00_01.vma.gz
      vzdump-qemu-400-2021_11_01-04_00_02.vma.gz
      vzdump-qemu-400-2021_11_04-04_00_01.vma.gz
      vzdump-qemu-400-2021_11_08-04_00_01.vma.gz
      vzdump-qemu-400-2021_11_11-04_00_02.vma.gz
      vzdump-qemu-400-2021_11_15-04_00_01.vma.gz
      vzdump-qemu-400-2021_11_18-04_00_02.vma.gz
      vzdump-qemu-400-2021_11_22-04_00_02.vma.gz
      vzdump-qemu-400-2021_11_25-04_00_01.vma.gz
      vzdump-qemu-400-2021_11_29-04_00_01.vma.gz
      vzdump-qemu-400-2021_12_02-04_00_02.vma.gz
      vzdump-qemu-400-2021_12_06-04_00_01.vma.gz
      vzdump-qemu-400-2021_12_09-04_00_02.vma.gz
      vzdump-qemu-400-2021_12_13-04_00_02.vma.gz
      vzdump-qemu-400-2021_12_16-04_00_02.vma.gz
      vzdump-qemu-400-2021_12_20-04_00_01.vma.gz
      vzdump-qemu-500-2021_09_14-03_03_00.vma.gz
      vzdump-qemu-500-2021_09_21-03_02_47.vma.gz
      vzdump-qemu-500-2021_09_28-03_02_48.vma.gz
      vzdump-qemu-500-2021_10_05-03_02_48.vma.gz
      vzdump-qemu-500-2021_10_12-03_02_50.vma.gz
      vzdump-qemu-500-2021_10_19-03_02_51.vma.gz
      vzdump-qemu-500-2021_10_26-03_02_50.vma.gz
      vzdump-qemu-500-2021_11_02-03_02_52.vma.gz
      vzdump-qemu-500-2021_11_09-03_02_57.vma.gz
      vzdump-qemu-500-2021_11_16-03_02_54.vma.gz
      vzdump-qemu-500-2021_11_23-03_02_55.vma.gz
      vzdump-qemu-500-2021_11_30-03_02_52.vma.gz
      vzdump-qemu-500-2021_12_07-03_02_50.vma.gz
      vzdump-qemu-500-2021_12_14-03_02_54.vma.gz
      vzdump-qemu-500-2021_12_21-03_03_16.vma.gz
      vzdump-qemu-600-2021_09_14-03_05_14.vma.gz
      vzdump-qemu-600-2021_09_21-03_04_54.vma.gz
      vzdump-qemu-600-2021_09_28-03_05_06.vma.gz
      vzdump-qemu-600-2021_10_05-03_05_10.vma.gz
      vzdump-qemu-600-2021_10_12-03_05_07.vma.gz
      vzdump-qemu-600-2021_10_19-03_05_46.vma.gz
      vzdump-qemu-600-2021_10_26-03_05_37.vma.gz
      vzdump-qemu-600-2021_11_02-03_05_23.vma.gz
      vzdump-qemu-600-2021_11_09-03_05_20.vma.gz
      vzdump-qemu-600-2021_11_16-03_05_38.vma.gz
      vzdump-qemu-600-2021_11_23-03_05_49.vma.gz
      vzdump-qemu-600-2021_11_30-03_05_38.vma.gz
      vzdump-qemu-600-2021_12_07-03_04_52.vma.gz
      vzdump-qemu-600-2021_12_14-03_05_47.vma.gz
      vzdump-qemu-600-2021_12_21-03_08_46.vma.gz
      vzdump-qemu-700-2021_09_14-03_07_27.vma.gz
      vzdump-qemu-700-2021_09_21-03_07_00.vma.gz
      vzdump-qemu-700-2021_09_28-03_07_15.vma.gz
      vzdump-qemu-700-2021_10_05-03_07_16.vma.gz
      vzdump-qemu-700-2021_10_12-03_07_14.vma.gz
      vzdump-qemu-700-2021_10_19-03_07_52.vma.gz
      vzdump-qemu-700-2021_10_26-03_07_47.vma.gz
      vzdump-qemu-700-2021_11_02-03_07_30.vma.gz
      vzdump-qemu-700-2021_11_09-03_07_28.vma.gz
      vzdump-qemu-700-2021_11_16-03_07_47.vma.gz
      vzdump-qemu-700-2021_11_23-03_08_09.vma.gz
      vzdump-qemu-700-2021_11_30-03_07_48.vma.gz
      vzdump-qemu-700-2021_12_07-03_06_59.vma.gz
      vzdump-qemu-700-2021_12_14-03_08_23.vma.gz
      vzdump-qemu-700-2021_12_21-03_11_50.vma.gz
      vzdump-qemu-900-2021_12_21-21_29_04.log
      vzdump-qemu-900-2021_12_21-21_29_04.vma.gz
      
      1. Danach sucht dieses Skript das aktuellste Backup aus der obigen Liste und schreibt dieses in einen DP. Und zwar für jede VM einzeln. Jetzt hat man in den DP den Namen vom aktuellsten Backup.

      Unbenannt.jpg

      1. Jetzt könne die Backups in den Ersatz NUC restored werden.

      3.1 NUC starten (3 min Pause)

      3.2 VM 100 löschen per simple-ssh (1 min Pause)

      var SSH = require('simple-ssh');
      var ssh = new SSH({
          host: '192.168.178.100',
          user: 'root',
          pass: 'xxxxxxxxxxx'
      });
      
      ssh.exec('qm destroy 101').start();
      

      3.3 Den DP "restore proxmox backup" mit dem aktuellen Befehl aktualisieren. (1 sek Pause)

      cd /mnt/pve/Diskstation/dump && qmrestore "Name letztes Backup VM 100 iobroker" 100
      

      3.4 VM 100 restoren per simple-ssh (30 min Pause)

      var SSH = require('simple-ssh');
      var ssh = new SSH({
          host: '192.168.178.100',
          user: 'root',
          pass: 'xxxxxxxxxxx'
      });
      
      ssh.exec(getState('javascript.0.restore_proxmox_backup').val).start();
      

      3.5 Danach muss noch dafür gesorgt werden, dass beim nächsten backup einspielen die VM nicht startet. Das geht hiermit.

      var SSH = require('simple-ssh');
      var ssh = new SSH({
          host: '192.168.178.100',
          user: 'root',
          pass: 'xxxxxxxxxx'
      });
      
      ssh.exec('qm set 101 --onboot 0').start();
      
      ssh.exec('qm set 200 --onboot 0').start();
      
      ssh.exec('qm set 300 --onboot 0').start();
      
      ssh.exec('qm set 400 --onboot 0').start();
      
      ssh.exec('qm set 500 --onboot 0').start();
      
      ssh.exec('qm set 600 --onboot 0').start();
      
      ssh.exec('qm set 700 --onboot 0').start();
      
      ssh.exec('qm set 900 --onboot 0').start();
      

      Das kann man jetzt für jede VM wiederholen. Danach wird per Telegram eine Nachricht verschickt, dass die backups restored wurden und der Ersatz NUC wird wieder runtergefahren.

      var SSH = require('simple-ssh');
      var ssh = new SSH({
          host: '192.168.178.100',
          user: 'root',
          pass: 'xxxxxxxxxxxx'
      });
      
      ssh.exec('shutdown').start();
      

      Mir ist klar das ein oder andere vielleicht eleganter gehen würde, aber Hauptsache es erfüllt seinen Zweck 🙂 Vielleicht kann es ja der ein oder andere brauchen...

      Hier das ganze blockly Skript:

      proxmox backup blockly.txt

      Unbenannt.jpg

      1 Reply Last reply Reply Quote 0
      • E
        eve11 last edited by

        Vielen Dank für die Anleitung. Ich habe mal versucht diese nachzubauen. Soweit so gut. Ich kann eine VM soweit sichern.
        Wie würde dies:

        cd /mnt/pve/Diskstation/dump && qmrestore "Name letztes Backup VM 100 iobroker" 100
        

        für einen LXC Container ausschauen. Bzw. der Destroy befehl.

        Danke

        Heiko

        S 1 Reply Last reply Reply Quote 0
        • S
          saeft_2003 Most Active @eve11 last edited by

          @eve11 sagte in Automatischer proxmox backup restore auf einen anderen NUC.:

          re "Na

          Tut mir leid ich verwende keine Container. Vielleicht findest du in der proxmox doku etwas?!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Support us

          ioBroker
          Community Adapters
          Donate

          700
          Online

          32.0k
          Users

          80.5k
          Topics

          1.3m
          Posts

          2
          3
          608
          Loading More Posts
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes
          Reply
          • Reply as topic
          Log in to reply
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
          The ioBroker Community 2014-2023
          logo