-
Notifications
You must be signed in to change notification settings - Fork 36
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
A couple of issues related to initial zvol replication #45
Comments
Both of these are the intended behavior. For issue 1, pyznap should always preserve local options, not take the source values. The idea is that you create the remote dataset manually and set different options. In my case for example I use gzip instead of lz4 for my backup datasets. So I wouldn't want that zfs overwrites the remote gzip option with the source dataset option lz4. Issue 2 is exactly how it's supposed to work, same for datasets. If the dataset does not exist on the remote, it does not send. You should create the parent dataset manually. All dependent datasets are then automatically created, once pyznap is sure that the parent exists. Note that I cannot use the |
That makes 100% sense for datasets, and Pyznap seems to work perfectly for that. I just wonder if zvols should be treated a little differently. Essentially what is happening when ‘refreservation’ is not transferred is that a non-sparse zvol on source become a sparse zvol on destination. And sparse zvols can become corrupt if written to when disk space is low. |
I'd rather not add more code for this special case. It shouldn't make that much difference if the zvol data is written to a sparse or nonsparse zvol. If you want to restore from your backup then you can simply create a new nonsparse zvol and transfer the data from your backup. And if you really want to make sure that your data ends up in a nonsparse zvol, you can easily create the zvol on your remote and then transfer the data. |
Well it's not as simple as that. The other issue is how to do the initial transfer of a single zvol to a destination. If you have a dataset with let’s say 100 of zvols and you want pyznap to replicate just one of those zvols, you can't. You either have to do all the zvols in the dataset or make an exclude rule for 99. A zvol is not like a dataset. Nonetheless, I do have to say that pyznap is a wonderful tool and it's definitely a keeper for me. I just wanted to make you aware of these issues related to zvol. As I said earlier there is an easy workaround on these both these issues by using |
Fair points. I never really used zvols extensively, so I never encountered this. As you mentioned, there are workarounds, either use |
I don't know how it should be implemented. I'm not even sure if there are additional zvol properties that are important and should be kept the same on source and destination. Using zfs send -R on the first zvol replication (only) will duplicate everything of course, but that is probably not the right way to implement it. Maybe someone else have some ideas. At least you are aware of the issue. The workaround works perfectly too. |
I believe there are a couple of issues related to initial Pyznap replication of zvol. These issues could be related to each other...?
Issue no. 1: Zvol sparse-setting is not preserved during initial Pyznap send
ZFS property related to sparse/non-sparse zvol, ‘refreservation’, is somehow not transferred as part of initial Pyznap send.
Using ‘zfs send’ with ‘-R’, the source ‘refreservation’ is preserved. Without ‘-R’ destination local default value seems to be used rather than the value of the source zvol.
When replicating zvols on FreeNAS the ‘refreservation’ is always preserved, so I assume that is the right way to do it…
Simple non-sparse and sparse zvol (1Gb) can be created using:
Issue no. 2: Initial Pyznap send of zvol only works recursively
When performing the initial replication to a new destination, pyznap doesn’t create a remote Zvol unless the Zvol is in a dataset that is recursively replicated.
Using Pyznap snap/send to replicate the zvol 'nonsparse':
generates the error
A destination zvol is created automatically on initial replication when using
zfs send -R ...
:A workaround to both these issues is to run
zfs send -R ....
for the initial zvol replication, then use Pyznap.The text was updated successfully, but these errors were encountered: