How to remove dataset from Solaris zone and mount it as lofs

Because of building mail system I need to export ZFS filesystem via NFS to other node, where postfix with deliver will save messages to mail boxes. As you can see in this installation transcript I configured whole zpool “studmail” as ZFS dataset for zone st1. Unfortunatelly, you can not simply share ZFS via NFS in non-global zone:

root@st1:~# zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
studmail                     301M  1.78T  28.0K  none
studmail/etc                4.52M  1.78T  4.19M  /data/etc
studmail/studmail            480K  1.78T   417K  /data/studmail
studmail/var                 296M  1.78T   294M  /data/var

root@st1:~# zfs set sharenfs=rw=@192.168.X.X/32,anon=0 studmail/studmail
cannot set property for 'studmail/studmail': 'sharenfs' cannot be set in a non-global zone

04.02 Configuration of container st1

After installation and initial configuration of st1 container you need to look on working services and disable those, which are not necessary. But at first I will set up more comfortable environment to work. I will change default shell to zsh and home directory of root user. I will use GNU sed for this purpose. Remember that /usr/local directory is inherited from global zone in read-only mode.

04. Containers (Solaris zones)

Solaris 10 has embedded some kind of virtualization mechanism, which is known as Solaris Zones. This is not only jail, but also resource controller for zones. I will not write about mechanism, because you can find this in documentation on Sun/Oracle sites and other blogs. I will give you some simple examples how to configure and install zone on Solaris 10.

03. Additional software

When you have installed operating system and developement tools, then we can install additional software which will serve network services on server or cluster. Again – there is several ways to install this kind of software: prepared packages from Sun, binary packages from community or other companies or sources, which you must to unpack and compile. I usually prefer last option.

02. System software

After installation and basic configuration of operating system, you usually need to install additional software from Sun/Oracle. I install developement toolkit and compilers from SunStudio. If you wiil build cluster, then you will need Solaris Cluster and related packages.

01. Installation

You can install Solaris different ways. The simpliest one is to put DVD to drive, sit down near graphical console, keyboard, mouse and click for installation options. But this way you can install Desktop station or small server install.
If you have more hardware and especially you want to build High Availability installation, where essential thing is homogenous of systems then worth of attention are other methods of installation as Flash Archive or Custom Jumpstart.
You must to find your own preffered type, I prefer now Custom Jumpstart.