How to Add a ZFS Cluster File System to a Zone Cluster (CLI)

This procedure shows how to add a ZFS cluster file system for use by a zone cluster.

Note:

Alternatively, you can use the clsetup utility to perform this task. See How to Add a Cluster File System to a Zone Cluster (clsetup).
  1. Assume the root role on a node of the global cluster that hosts the zone cluster.

    Perform all steps of this procedure from a global cluster node.

  2. On the global cluster, configure the ZFS pool and the file system that you want to use in the zone cluster.
    phys-schost# zpool create poolname device
    phys-schost# zfs create poolname/fsname

    For information on how to set up a ZFS pool, see the zfs(8) and the zpool(8) man pages.

  3. Add the file system to the zone cluster configuration.
    phys-schost# clzonecluster configure zone-cluster-name
    clzc:zone-cluster-name> add fs
    clzc:zone-cluster-name:fs> set dir=zone-cluster-lofs-mountpoint
    clzc:zone-cluster-name:fs> set special=global-cluster-mount-point
    clzc:zone-cluster-name:fs> set type=lofs
    clzc:zone-cluster-name:fs> end
    clzc:zone-cluster-name> verify
    clzc:zone-cluster-name> commit
    clzc:zone-cluster-name> exit
  4. Verify the addition of the LOFS file system.
    phys-schost# clzonecluster show -v zone-cluster-name
  5. (Optional) Create an HAStoragePlus resource to manage and monitor the global ZFS pool in the global zone.

    Although this step is considered to be optional, it is recommended to perform this step as a best practice.

    phys-schost# clresource create -t HAStoragePlus \
    -p GlobalZpools=poolname \
    -g resource-group-name global-zpool-hastorageplus-resource-name

    Bring the resource group online.

    Proceed to Step 6 only if you skipped Step 5. Otherwise, proceed to Step 7.

  6. If the global ZFS pool is not managed by HAStoragePlus, then create the zpool device group and bring it online.
    phys-schost# cldevicegroup create -p poolaccess=global \
    -n phys-schost-1,phys-schost-2 -t zpool global-zfs-pool
    phys-schost# cldevicegroup online global-zfs-pool

    For more information, see How to Configure a zpool for Globally Mounted ZFS File Systems Without HAStoragePlus HAStoragePlus in Administering an Oracle Solaris Cluster 4.4 Configuration.

  7. Ensure that the global zone file system is globally mounted by looking at the mount flags for the word, global.
    phys-schost# mount -p | grep global-cluster-mount-point
    global-zfs-dataset - global-cluster-mount-point zfs - no rw,devices,setuid,nonbmand,exec,
    rstchown,noxattr,atime,global
  8. Configure an HAStoragePlus resource in the zone cluster to perform the loopback mount of the global file system in the zone cluster node.

    Note:

    The global file system will be mounted on the node(s) where the HAStoragePlus is brought online. If you require the filesystem online on multiple zone cluster nodes, the resource group must be scalable.
    ZC-schost# clresource create -g resource-group-name
    -t HAStoragePlus \
    -p FileSystemMountPoints=
    zone-cluster-lofs-mountpoint hastorageplus-resource-name
  9. If an HAStoragePlus resource was created to manage and monitor the global ZFS pool in the global zone as shown in Step 5, then set the offline restart dependency.
    phys-schost# clresource set -Z zone-cluster-name \
    -p Resource_dependencies_offline_restart=global:global-zpool-hastorageplus-resource-name
    \
    hastorageplus-resource-name

Example 6-5 Adding a ZFS Cluster File System to a Zone Cluster (CLI)

The following example shows how to add a ZFS cluster file system in global ZFS poolglobalpool1, with mount point /globalpool1/apache to a zone cluster sczone. The file system is available to the zone cluster using the loopback mount mechanism at the mount point /zone/apache.

phys-schost-1# mount -p | grep 'globalpool1/apache'
...
globalpool1/apache - /globalpool1/apache zfs - no
rw,devices,setuid,nonbmand,exec,rstchown,noxattr,atime,global
...
phys-schost-1# clzonecluster configure sczone
clzc:zone-cluster-name> add fs
clzc:zone-cluster-name:fs> set dir=/zone/apache
clzc:zone-cluster-name:fs> set special=/globalpool1/apache
clzc:zone-cluster-name:fs> set type=lofs
clzc:zone-cluster-name:fs> end
clzc:zone-cluster-name> verify
clzc:zone-cluster-name> commit
clzc:zone-cluster-name> exit

phys-schost-1# clzonecluster show -v sczone
…
Resource Name:                            fs
dir:                                       /zone/apache
special:                                   /globalpool1/apache
raw:
type:                                      lofs
options:                                   []
cluster-control:                           true
…
phys-schost-1# clresourcegroup create gpoolRG
phys-schost-1# clresource create -t HAStoragePlus -p GlobalZpools=globalpool1 \
-g gpoolRG gpoolResource
phys-schost-1# mount -p | grep '/globalpool1/apache'
globalpool1/apache - /globalpoo1/apache zfs - no
rw,devices,setuid,nonbmand,exec,rstchown,noxattr,atime,global

phys-schost-1# clresource create -Z sczone -g zone-rg -t HAStoragePlus \
-p FileSystemMountPoints=/globalpool1/apache -p \ 
Resource_dependencies_offline_restart=global:gpoolResource zc-hasp-resource

Data service resources in the zone cluster that require access to the global ZFS file system must declare a resource dependency on this HAStoragePlus resource zc-hasp-resource.