Following up on earlier mail, here's a proposal for create-time
properties.  As usual, any feedback or suggestions is welcome.

For those curious about the implementation, this finds its way all the
way down to the create callback, so that we can pick out true
create-time properties (e.g. volblocksize, future crypto properties).
The remaining properties are handled by the generic creation code.

- Eric

A. INTRODUCTION

A complicated ZFS installation will typically create a number of
datasets, each with their own property settings.  Currently, this
requires several steps, one for creating the dataset, and one for each
property that must be configured:

        # zfs create pool/fs
        # zfs set compression=on pool/fs
        # zfs set mountpoint=/export pool/fs
        ...

This has several drawbacks, the first of which is simply unnecessary
steps.  For these complicated setups, it would be simpler to create the
dataset and all its properties at the same time.  This has been
requested by the ZFS community, and resulted in the following RFE:

6367103 create-time properties

More importantly, it forces the user to instantiate (and often mount)
the dataset before assigning properties.  In the case of the
'mountpoint' property, it means that we create an inherited mountpoint,
only to be later changed when the property is modified.  This also makes
setting the 'canmount' property (PSARC 2006/XXX) more intuitive.

This RFE is also required for crypto support, as the encryption
algorithm must be known when the filesystem is created It also has the
benefit of cleaning up the implementation of other creation-time
properties (volsize and volblocksize) that were previously special
cases.

B. DESCRIPTION

This case adds a new option, 'zfs create -o', which allows for any ZFS
property to be set at creation time.  Multiple '-o' options can appear
in the same subcommand.  Specifying the same property multiple times in
the same command results in an error.  For example:

        # zfs create -o compression=on -o mountpoint=/export pool/fs

The option '-o' was chosen over '-p' (for 'property') to reserve this
for a future RFE:

6290249 zfs {create,clone,rename} -p to create parents

The functionality of 'zfs create -b' has been superceded by this new
option, though it will be retained for backwards compatibility.  There
is no plan to formally obsolete or remove this options.  For example:

        # zfs create -b 16k -V 10M pool/vol

                is equivalent to

        # zfs create -o volblocksize=16k -V 10M pool/vol

If '-o volblocksize' is specified in addition to '-b', the resulting
behavior is undefined.

C. MANPAGE CHANGES

TBD

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to