Elaborating upon zfs and zpool enhancements to AI. BE considerations -
add name of BE to create.
As always, feedback is desired. Also opinions as to the value of these
features - how useful are they?
The concept of overwriting existing pools was reconsidered. The
question here is what to do with a pool if it has <zpool_create> and it
already exists. "Overwrite" is a misnomer and will not be used here.
There are a few different pool reuse cases:
1) the user wants to reuse the manifest and preserve the pool the
created with the manifest
2) the user wants to remove contents from the pool and reuse it without
having to know its options or vdevs
3) the user wants to redefine the pool, changing options or vdevs
For the first option, adding boolean attribute "preserve" will result in
any associated manifest definitions of vdevs, mirrors, and options being
ignored, and the zpool will be unchanged, except for BEs in the root
pool (discussed below)
For the second, adding boolean attribute "destroy_all_datasets" will
cause any datasets to be destroyed, including any BEs
For the third, the user must <zpool_destroy>, then <zpool_create>
according to the new specifications.
For root pools, the preserve options become more interesting. If the
root pool exists, it could contain BEs that the user may want to
preserve. Propose for the zfs_root_pool section, add BE_name element.
If named BE does not exist, just install OpenSolaris into that BE. If
it does exist, fail the install unless boolean attribute
destroy_be_if_it_exists is true in which case the BE is first deleted,
then recreated. When a BE is not named, take the default behavior,
which is to use 'opensolaris' BE, destroying it if it exists.
My original draft of the AI manifest schema allowed the user to create a
filesystem in the context of a zpool:
<ai_manifest name="default">
...
<ai_zfs_pool>
<zpool_create name="zoolpool">
<vdev>c0t0d0</vdev>
<zfs_fs_create path="mynewzfs"/>
</zpool_create>
</ai_zfs_pool>
would result in:
zpool create zoolpool /dev/dsk/c0t0d0
zfs create zpoolpool/mynewzfs
Added the ability to create a zfs file system without the pool context,
at the top XML level:
<ai_manifest name="default">
...
<zfs_fs_create path="poolname/fully_specified_path"/>
would result in:
zpool create poolname/fully_specified_path
Also added to the manifest the ability to create a zfs filesystem as a
child of another zfs filesystem.
<zfs_fs_create path="mynewzfs">
<zfs_fs_create path="child_of_mynewzfs"/>
</zfs_fs_create> <!-- end mynewzfs -->
References:
http://www.opensolaris.org/os/project/caiman/auto_install/ai_design/
http://www.opensolaris.org/os/project/caiman/auto_install/ai_manifest_schema.xml
http://www.opensolaris.org/os/project/caiman/auto_install/ai_manifest_example.xml