[SOLVED] ZFS send/recv zum Übertragen eines produktivem ZVOL'S

Horus92

Member
Mar 11, 2017
32
1
13
51
Hallo!
Ich habe folgendes Problem bzw. Frage:

Produktives System:
Proxmox v6.3 mit zfs-auto-snapshots
Zpool: "datastore"
Z-Vol: "datastore/virt_hdd/vm-100-disk-0"

ZpoolDatastoret.JPG

die zugehörigen Snapshots per "zfs-auto-snapshot":

ZpoolDatastores_snaps.JPG

Nun habe 2 HDD als Raid1 hinzugesteckt und einen zweiten Zpool namens "datastore2" mit Dataset "datastore/virt_hdd erstellt:

Zpool_Datastore2.JPG

Ziel soll sein:
per send/recv das ZVOL "/datastore/virt_hdd/vm-100-disk-0" auf den Pool "datastore2" unter "datastore2/virt_hdd" zu KOPIEREN (als Backup, d.h. also "vm-100-disk-0" soll unter "datastore/virt_hhd" und "datastore2/virt_hdd" vorhanden sein)

Frage:
1. muss zfs-auto-snapshots für "datastore" für die Zeit von send| recv gestoppt werden, wenn ja wie? Oder alle Snapshots vorher löschen?

2. ist das der richtige Ansatz für send/recv ???

zfs send -pvR datastore/virt_hdd/vm-100-disk-0@zfs-auto-snap_hourly-2020-12-31-1117 | zfs recv -v datastore2/virt_hdd/vm-100-disk-0@zfs-auto-snap_hourly-2020-12-31-1117

3. nach dem erfolreichen send/recv sollen die beiden HDD's mit Zpool "datastore2" in einen zweiten Rechner und dann per inkrementellem Snapshot per ssh weiter mit dem ersten Rechner syncronisiert werden? Wie geht das???

meine Vorstellung:
zfs send -Rv -I datastore/vm-100-disk-0@zfs-auto-snap_hourly-2020-12-30-1217 | ssh 192.168.2.68 zfs receive -v datastore2/virt_hdd/vm-100-disk-0

4. Wie bekomme ich aus dem übertragenen Snapshot das ZVOL auf den 2. Rechner - per Rollback auf System 2? Wenn ja von welchem Snapshot?


MFG, Torsten
 

Attachments

  • ZpoolDatastoret.JPG
    ZpoolDatastoret.JPG
    31.5 KB · Views: 3
Habe jetzt folgendes gemacht:


1.) vm100 herunterfahren

2.) zfs-auto-snapshot für beide ZPools deaktiviert:

zfs set com.sun:auto-snapshot=false datastore

zfs set com.sun:auto-snapshot=false datastore2

3.) das ZVOL per send/recv nach Zpool mit allen zugehörigen Snapshots nach "datastore" geschickt:

zfs send -pvR datastore/virt_hdd/vm-100-disk-0@zfs-auto-snap_frequent-2021-01-01-1330 | zfs recv -v datastore2/virt_hdd/vm-100-disk-0

Also ist jetzt ist jetzt jeweils eine exakte Kopie von ZVOL "vm-100-disk-0" in:
datastore/virt_hdd/vm-100-disk-0
datastore2/virt_hdd/vm-100-disk-0

4.) inkrementelles send/recv:

Es bleibt aber die Frage wie ich jetzt die incrementellen Snapshots zunächst local von "datastore" an "datastore2" (später dann auf Rechner 2 "datastore") senden kann?????

irgendwie so???:

testweise neue Snapshot machen (später wieder mit zfs-auto-snapshot):
zfs snapshot datastore/virt_hdd/vm-100-disk-0@new1
zfs snapshot datastore/virt_hdd/vm-100-disk-0@new2
zfs snapshot datastore/virt_hdd/vm-100-disk-0@new3

wie jetzt senden??? So???:
zfs send -Rv -I [letzter gesendeter Snapshot] [neuester Snapshot] | zfs recv -v datastore2/virt_hd/vm-100-disk-0
also:
zfs send -Rv -I vm-100-disk-0@zfs-auto-snap_frequent-2021-01-01-1330 datastore/virt_hdd/vm-100-disk-0@new3 | zfs recv -v datastore2/virt_hd/vm-100-disk-0
 
Also nach mehrfachem Ausprobieren war das erfolgreich:

datastore = Ursprung
datastore2= Ziel

nur den allererster Snapshot senden:
********************************
zfs send -v datastore/virt_hdd/vm-301-disk-1@snap1 | pv | zfs recv -dvF datastore2

(wobei snap1 der allererste gemachte Snapshot ist, pv zeigt den Fortschritt und die Geschwindigkeit des Kopierens an)

neuster Snapshot und alle davorliegenden bis zum allerersten Snapshot senden:
**********************************************************************
zfs send -v -R datastore/virt_hdd/vm-301-disk-1@new3 | pv | zfs recv -dvF datastore2


Differenz zw. neuestem Snapshot bis zum vorherigen zuletzt gesendetem senden:
**********************************************************************
zfs send -v -I <Snapshot zuletzt gesendet> <neuester zu sendender Snapshot> | pv | zfs revc -dvF datastore2
z.B.:
zfs send -v -I datastore/virt_hdd/vm-301-disk-2@snap1 datastore/virt_hdd/vm-301-disk-1@snap5 | pv | zfs revc -dvF datastore2

wobei:
-I = alle dazwischenliegenden Snaps mitnehmen
-i = nur von Snap zu Snap (z.B. Snap_hourly-2021-01-01-1200 zu Snap_hourly-2021-01-06-1200, überspringt die dazwischenliegenden Snaps )
 

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!