Replication Tasks is not really working

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
Make sense... thanks.

But I get the same error:

1691606453777.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Could you please post text instead of images so I can copy and paste? Thanks. There are "CODE" tags available in this forum software to format commands and output.

What do
Code:
zpool list
zfs get refreservation Pool/path/to/your/zvol

result in?
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
I am sorry.... I tried to copy, but its not possible and SSH is also not possible, because I need my key for login via ssh and I don't understand it so fast..... Sorrrry! :/

1691607089690.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
And the zpool list output?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Could you try zfs inherit -S refreservation Pool/Nextcloud-Data and then the snapshot command again?
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
Now the snapshot worked and the Replication is running, thanks!!

But I am a little bit worried about the command "zfs inherit -S refreservation". I think the storage reservation is needed, but now I deleted it. Maybe you can explain why its okay to delete this? Come this reservation back? Why is it there, when I can delete it any everything is like before?

And I can do everything with my Nextcloud now, because the replication does not affect the running system, because of the snapshot, right?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What you now did is you turned your zvol into a "sparse volume". I run all my VM virtual disks like that. So the zvol only takes up the space that was actually written by the guest OS inside the VM.

There is only one risk/downside: you can now overprovision the space of your pool. If you create another zvol taking up short of a TB of space and then fill your Nextcloud volume to the brim, the pool will be 100% full and you will need to recreate and restore from backups.

This looks much more dramatic than it is. >90% of all VMware installations I know run their virtual disks "sparse". You just need to either
* keep in mind not to create zvols taking any more space than your pool actually has - and watch the space taken by snapshots!
* or just set up emails for your TN properly - it will monitor the free space in the pool and alarm you if things run tight.

Whenever that happens, you need to increase your storage capacity somehow, but that's like it is anyway. :smile:
 

Kienaba

Explorer
Joined
May 24, 2022
Messages
52
Thank you so much, I understood it now very well!

So I should have not any problems, when I still have some GiB left in the yellow area, right? I mean I don't want to change anything at the NAS configuration in the next month or hopefully years, so I should be totally fine then I think.

1691609095560.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Right. And you can run the same command for all your VM zvols and they will show with the amount of data actually used instead of a reserved size. You just need to monitor your free space.

Example how your current setup could go wrong:

- create a snapshot for Nextcloud-Data
- by some means write 1 TB of new data into that volume from inside the guest OS

*boom*

So watch your free space and you are fine.

Some hints for backup/replication:

You could create a dataset named e.g. "VM" as "Pool/VM" and move your zvols there. So Pool/Nextcloud-Data becomes Pool/VM/Nextcloud-Data. Then you can create a recursive snapshot and replication task for Pool/VM to backup all your VM zvols. That's what I do.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
@sretalla Why should a snapshot of a zvol behave different from a dataset in that regard?
I agree that what I wrote is something I don't really agree with, but I was going with evidence from the forum and the reported error saying as much (in many threads... try a search).

A snapshot should not need any more than a small number of MBs to store the block pointers needed to protect the impacted blocks.

I wonder if there's some mechanism that "reserves" free blocks when a snapshot is taken for a ZVOL, to ensure that the ZVOL is guaranteed continued operation while the snapshot is in place (since if you were to modify any block of the ZVOL while the snapshot exists, a new block is needed on the disk or the ZVOL can't operate.

This salty little rant seems to cover it and points to the reservation too:
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
From the results we achieved in this thread I conclude that the refreservation is to blame. It seems when this parameter is set, ZFS expects the same amount (?) to be free to take a snapshot.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think what you did here was great in terms of getting to the real answer... a non-sparse ZVOL needs equal space free for a snapshot due to that refreservation.
 

samarium

Contributor
Joined
Apr 8, 2023
Messages
192
And can be an unpleasant surprise if you are not expecting that behavior. IIRC this point, that you require sufficient space to take a full snapshot of a zvol, was illustrated on Jim Salter's ZFS blog years ago with examples, along with some pros/cons vs .qcow2 files.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
And can be an unpleasant surprise if you are not expecting that behavior
The key is to only use sparse ZVOLs, which don't create that requirement.
 
Top