Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use source pool names as target pool name #41

Closed
ryszard-suchocki opened this issue May 2, 2020 · 11 comments
Closed

Use source pool names as target pool name #41

ryszard-suchocki opened this issue May 2, 2020 · 11 comments
Milestone

Comments

@ryszard-suchocki
Copy link

As a user, I want to backup multiple pools to Backup Server that has the same pool schema, so I'm able to create a full replica ready to go in a disaster scenario.

Let's imagine the situation where you have 2 servers in equal hardware configuration, ZFS pools on those servers are divided on fast and slow storage (SSD/fs and HDD/fs) and you want to perform a backup.

Best regards!

@psy0rz
Copy link
Owner

psy0rz commented May 6, 2020

Can you explain what you mean exactly?

We already support multiple pools automaticly, just set the autobackup: property like usual, but on multiple pools.

Edwin

@ryszard-suchocki
Copy link
Author

ryszard-suchocki commented May 6, 2020

1:1 replication, like using standard PVE built-in replication mechanism.
[host A]------------------[host B]
ssd1/vm-100-disk-0 => ssd1/vm-100-disk-0
hdd/vm-100-disk-0 => hdd/vm-100-disk-0

Currently, all FS with autobackup:property=true gives such a result:
[host A]------------------[host B]
ssd1/vm-100-disk-0 => ssd1/ssd1/vm-100-disk-0
hdd/vm-100-disk-0 => ssd1/hdd/vm-100-disk-0

Best regards

@psy0rz
Copy link
Owner

psy0rz commented May 8, 2020

Ah i understand.

Can you try using --strip-path as workaround?

In your example a --strip-path 1 should result in:

[host A]------------------[host B]
ssd1/vm-100-disk-0 => ssd1/vm-100-disk-0
hdd/vm-100-disk-0 => ssd1/vm-100-disk-0

It strips the first "part" of the source name. In this case it strips ssd1 and hdd from it.

I assume the other vm has a different number than 100, so there should be no naming conflict.

Edwin

@ryszard-suchocki
Copy link
Author

Well, you discovered the problem with PVE and VM disk naming when using ZFS storage (disk name is unique in storage scope, but not in whole VM). So stripping the first part of the source name is not an option because you will achieve a dangerous situation like below (this is the schema you created) :

[host A]------------------[host B]
ssd1/vm-100-disk-0 => ssd1/vm-100-disk-0
hdd/vm-100-disk-0 => ssd1/vm-100-disk-0

Additionally, I don't want to store virtual-disk which is assumed to contain lots of rarely used data (slow access is acceptable) on SSD storage.

The Strip-path parameter gives some possibilities, but it still not what I'm trying to achieve. I tried it earlier but to make full replication (1:1 between identical servers) I need 3 different commands and different properties for each of storage's type:

  1. Set the common property to all storages used by VM to distinguish virtual machine drives among other i.e "mybackup-100"

  2. Set property for SSD storage -> "mybackup-100-ssd"

  3. Set property for HDD storage -> "mybackup-100-hdd"

  4. Create snapshot (only snapshot, do not send) for all filesystems marked "mybackup-100" (--no-send and --allow-empty parameter ) [ here we have time consistent snapshot among all storages ]
    zfs-autobackup --ssh-source X mybackup-100 ThisIsNotImportant --verbose --keep-source X --keep-target X --no-hold --no-send --allow-empty

  5. Pull snapshot of filesystem marked "mybackup-100-ssd" to SSD1
    zfs-autobackup --ssh-source X mybackup-100-ssd ssd1 --progress --verbose --strip-path 1 --keep-source X --keep-target X --no-hold --rollback --other-snapshots --destroy-incompatible --no-snapshot

  6. Pull snapshot of filesystem marked "mybackup-100-hdd" to HDD
    zfs-autobackup --ssh-source X mybackup-100-hdd hdd --progress --verbose --strip-path 1 --keep-source X --keep-target X --no-hold --rollback --other-snapshots --destroy-incompatible --no-snapshot

What I want to achieve - preserve source pool name and replicate data to pool with the same name on another machine using the minimal count of commands
--preserve-pool-name | ignore destination pool name and use source pool name

@psy0rz
Copy link
Owner

psy0rz commented May 18, 2020

You basically want something like rsync for zfs pools? :)

@ryszard-suchocki
Copy link
Author

You basically want something like rsync for zfs pools? :)

yes, 1:1 replication with all benefits from zfs-autobackup (custom properties, autoprune).

@psy0rz
Copy link
Owner

psy0rz commented May 18, 2020

Ok, first i have to fix some more stuff and then i'll figure out how to do this in a nice way.

@psy0rz psy0rz changed the title [enhancement] Multiple pool support Use source pool names as target pool name May 18, 2020
@psy0rz psy0rz added this to the 3.1 milestone May 18, 2020
@psy0rz psy0rz modified the milestones: 3.1, 3.2 Jul 3, 2021
@psy0rz
Copy link
Owner

psy0rz commented Jul 5, 2021

update: the fixing some stuff turned into adding full regression testing and a lot of new features for 3.1. this one is still on the table however. :)

@psy0rz
Copy link
Owner

psy0rz commented Jan 28, 2022

please have a look at #114 and let me know overthere what you think of it

@psy0rz
Copy link
Owner

psy0rz commented Feb 23, 2022

In the mean time, if you want 1:1 replication on a per-pool basis, look here:

https://github.com/psy0rz/zfs_autobackup/wiki#making-source-and-target-paths-look-the-same

@psy0rz
Copy link
Owner

psy0rz commented Feb 26, 2023

closing this, since its essentially fixed via that documentation. zfs-rsync is a different thing.

@psy0rz psy0rz closed this as completed Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants