In Solaris 11.2 Zones could be installed on shared storage (ZOSS) using iSCSI devices. With Solaris 11.3 Beta the shared storage for Kernel Zones can also be placed on NFS files.
To setup an NFS SURI (storage URI), you'll need to identify the NFS host, share and path where the file will be placed and the user and group allowed to access the file. The file does not need to exist, but the parent directory of the file must exist. The user and group are specified so a user can control access of their zone storage via NFS.
Then in the zone configuration, you can setup a device (including a boot device) using the NFS SURI that looks like:
If the file does not yet exist, you'll need to specify a size.
Here's my setup of a 16g file for the zone root on an NFS share "/test" on system "sys1" owned by user "user1". My NFS server has this mode/owner for the directory /test/z1kz:
# ls -ld /test/z1kz
drwx------ 2 user1 staff 4 Jun 12 12:36 /test/z1kz
In zonecfg for the kernel zone "z1kz", select device 0 (the boot device) and set storage and create-size:
zonecfg:z1kz> select device 0
zonecfg:z1kz:device> set storage=nfs://user1:staff@sys1/test/z1kz/z1kz_root
zonecfg:z1kz:device> set create-size=16g
zonecfg:z1kz> info device
match not specified
To add another device to this kernel zone, do:
zonecfg:z1kz> add deviceWhen installing the kernel zone, use the "-x storage-create-missing" option to create the NFS files owned by user1:staff.
zonecfg:z1kz:device> set storage=nfs://user1:staff@sys1/test/z1kz/z1kz_disk1
zonecfg:z1kz:device> set create-size=8g
# zoneadm -z z1kz install -x storage-create-missingOn my NFS server:
# ls -l /test/z1kz
-rw------- 1 user1 staff 8589934592 Jun 12 12:36 z1kz_disk1
-rw------- 1 user1 staff 17179869184 Jun 12 12:43 z1kz_root
When the zone is uninstalled, the option "-x force-storage-destroy-all" will be needed to destroy the NFS files z1kz_root and z1kz_disk1. If the "-x force-storage-destroy-all" option isn't used, then the NFS files will still exist on the NFS server after the zone uninstall.