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

when cloning and the file backend system is zfs use zfs clone instead of rsync #111

Closed
palica opened this issue Nov 26, 2016 · 3 comments
Assignees

Comments

@palica
Copy link
Contributor

@palica palica commented Nov 26, 2016

No description provided.

@olevole olevole self-assigned this Nov 29, 2016
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Nov 29, 2016

Yes, I thought about it many times, but still have no idea how to do it in the best possible way. The fact that while clone exist you can not delete the original FS.

At the moment, CBSD has the ability to create a new jail from snapshot via clone:

  1. make snapshot of original jail and remember snapshot name
  2. cbsd jconstruct-tui:
  • fill settings as usual
  • insert snapshot name in menu: zfs_snapsrc

The operation on the creation of container is momentary, but you can't delete snapshot while new jail exist, cause this copy-on-write

@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Nov 30, 2016

upd via xmpp:
[17:11:12] You can do something like zfs clone - promote to be able to delete the original dataset
[17:11:32] this is what you could do to use zfs to clone a jail
[17:12:43] 1. create a zfs snapshot of the origin jail
[17:13:55] zfs snap storage/jail1@clone
[17:14:13] 2. create a clone from the snapshot
[17:14:54] zfs clone storage/jail1@clone storage/jail2
[17:16:07] 3. promote the clone to a dataset (we can make this optional as it would save space for jail clones)
[17:16:50] zfs promote storage/jail2
[17:17:31] now you can delete @clone and/or delete the jail1 dataset
[17:17:44] 4. optional delete other datasets
[17:17:58] zfs delete storage/jail2@clone
[17:18:09] zfs delete storage/jail1
[17:18:15] :)
[17:18:49] or the second approach one can take to make this possible is to add something like a zfs_image
[17:19:28] so you would say this is a prototype image and from this image I would like to have all my clones to be built
[17:25:43] zfs snap storage/jail@origin
[17:26:11] zfs clone storage/jail@origin storage/jailwww1
[17:26:28] zfs clone storage/jail@origin storage/jailwww2
[17:26:29] ...
[17:27:04] or we could have both possibilities
[17:27:56] a) clone a jail from a running jail and promote it so you can eventually delete the origin
[17:28:36] b) clone a jail from a "special" jail and keep reference to save space
[17:30:08] other thing is it would be also nice to use zfs send between two cbsd instances instead of rsync to move jails if both use zfs

olevole added a commit that referenced this issue Mar 4, 2017
copy jclone to bclone; clone via zfs snapshot WIP, step 1/2, Issue #111
olevole added a commit that referenced this issue Mar 5, 2017
clone via zfs snapshot WIP, step 2/2, Issue #111
@olevole

This comment has been minimized.

Copy link
Collaborator

@olevole olevole commented Mar 5, 2017

This method will be by default on ZFS-based systems.
Will be in 11.0.10 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.