OmniCube Reference Manualcreate_zone_config.sh(8)

create_zone_config.sh(8)

System Administration Commands · OmniCube · August 10, 2026

NAME

create_zone_config.sh - create the mirrored zpool and datasets of a zone

SYNOPSIS

/opt/omnicube/sbin/create_zone_config.sh zone

DESCRIPTION

create_zone_config.sh builds the storage layout of a single zone out of raw disk files that already exist on the local host and on every NFS-mounted peer, then creates the two ZFS datasets the zone needs.

The local pool name is derived from the short host name: the output of hostname truncated at the first hyphen. The peer list is not taken from config/nodes; instead the script lists the directories of / whose name starts with sr, drops the one matching the local pool, and keeps those whose name contains the site prefix (PROPPREFIX, the value of the SMF property config/site of svc:/omnicube/sysadm:default, or of the instance named by OC_SMF_INSTANCE). Those directories are the NFS mounts of the peers' raw LUN trees, as created by create_zone_pool.sh(8). Each candidate is validated as a name before it is used in a privileged command line.

The work performed, all through pfexec, is:

1. create the zone's zpool on the local raw file /pool/raw/zone/zone-disk0.raw, with mountpoint=none and compression=lz4;
2. for every peer directory found, attach that peer's raw file (/srv/raw/zone/*raw) to the pool, turning it into an n-way mirror;
3. create zone/zones with mountpoint=none;
4. create zone/zones/zone with mountpoint=/zones/zone/ and recordsize=4k.

The script stops at the first failure of any of these steps and exits with that command's status. It is meant to be run by hand, once, when provisioning a zone; the zone configuration itself is not created (the file ends with an empty Zone creation section).

The shared run-level guard applies: the command exits 0 without doing anything when the host is at run level 0, 1, 5, 6, S or s, or when /etc/nologin exists, unless OC_IGNORE_RUNLEVEL is set.

OPERANDS

zone

Name of the zone, which is also the name of the zpool that is created and of the raw LUN directory. Mandatory. Must match [a-zA-Z0-9][a-zA-Z0-9._-]*.

This command takes no options.

EXAMPLES

Example 1: build the storage of a new zone

create_zone_config.sh zbeio01

Example 2: inspect the result

zpool status zbeio01
zfs list -r zbeio01

EXIT STATUS

0

The pool and both datasets were created.

1

No zone name was given.

2

The zone name, or the name of one of the NFS server directories, failed validation.

other

The non-zero exit status of the zpool or zfs command that failed, reported as IO ERROR>.

78

Raised while sourcing the shared library when config/site is not set on the selected SMF instance.

FILES

/opt/omnicube/sbin/create_zone_config.sh

This command.

/opt/omnicube/lib/common/utils.sh

Shared library: SMF configuration, logging, validation, run-level guard.

/pool/raw/zone/zone-disk0.raw

Local raw LUN backing the zone's zpool.

/srv/raw/zone/*raw

Peer raw LUNs, reached over NFS, attached as mirror members.

/zones/zone

Mount point of the zone dataset created by this command.

ENVIRONMENT

OC_SMF_INSTANCE

Selects the svc:/omnicube/sysadm instance whose config/site value is used as the site prefix when filtering the NFS server directories.

OC_IGNORE_RUNLEVEL

When set to a non-empty value, bypasses the run-level guard.

SECURITY

The zpool, zfs and truncate calls run under pfexec, using the root-equivalent OmniCube Administration profile. Both the zone name and every peer directory name obtained from the listing of / are validated before they are interpolated into those command lines.

SEE ALSO

omnicube_utils(3), oc_validate(3), vm_tpl.cfg(5), omnicube(7), create_iscsi_lun.sh(8), create_zone_pool.sh(8), manage_zone.sh(8), sync_pool.sh(8).

NOTES

This is the older, NFS-directory-driven provisioning path. create_zone_pool.sh(8) does the same job for both SYNC and ASYNC layouts, drives the peers from config/nodes over ssh, and creates the raw LUNs itself; prefer it for new deployments.

The raw files must already exist on every node before this command is run. Nothing is cleaned up if a mirror attach fails part way through: the pool exists with fewer members than intended and must be repaired or destroyed by hand.

The recordsize of the zone dataset is fixed at 4k here, whereas create_zone_pool.sh(8) takes it as an option.

man8/create_zone_config.sh.8generated 2026-09-02 05:17 CEST