Matthew Ahrens wrote:
now wouldnt it be more natural way of usage when I intend to create a
clone, that by default
the zfs clone command will create the needed snapshot from the current
image internally as part
of taking the clone unless I explicitely specify that I do want to
take a clone of a specific snapshot ?
While that might be convenient, hiding what's really going on can result
in confusion.
So really, administrators need to be aware of the underlying snapshot.
Therefore, providing a "clone a fs by taking a snapshot under the
covers" feature would serve only as syntactic sugar. I believe that the
potential for confusion outweighs this benefit.
I agree with both of you.
I agree with Frank that there should be the ability to run a single ZFS
command to create a clone without the admin need to manually create a
snapshot first. This isn't a reduction from one command to two in
scripting but more like three or four commands because you would need to
calculate a snapshot name then snapshot with that then use it to clone.
I agree completely with Matt that we should never hide the fact from the
admin that for a clone you need a snapshot to first exist.
What I would like to see it that zfs clone when given an additional
argument creates the snapshot and the clone for you. This means we need
a way to name the snapshots to ensure they will never clash, I'd suggest
using the date and time in an ISO format eg:
$ zfs clone -s homes/template/user homes/bob
Would be equivalent to doing the following:
$ snapname=`date +%F:%T`
$ zfs snapshot homes/template/[EMAIL PROTECTED]
$ zfs clone homes/template/[EMAIL PROTECTED] homes/bob
In both cases running zfs list would show the snapshot.
Where this becomes really useful is if we also had '-r' for clones, for
example cloning a whole part os the namesoace might go something like this:
$ snapname=`date +%F:%T`
$ zfs snapshot -r [EMAIL PROTECTED]
$ for i in `zfs list -t snapshot -H -o name | sort | tail -1` ; do
zfs clone $i nhomes/${i%%$snapname}
done
If we had implicit snapshot with clones and a recursive capability
we could do this:
$ zfs clone -s -r homes nhomes
Its a easy of use thing in the UI, just like when running zpool to
create a new pool you get the top level filesystem without running zfs
create.
It could also be used when cloneing zones using zoneadm(1M), that
currently uses @SUNWzone as a prefix of the snapshot name.
Now I don't think this is particularly high priority, I'd much rather
see '-r' for zfs send/recv before I saw this.
--
Darren J Moffat
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss