Version 3.1-enSolaris 10 Container Guide - 3.1 5. Cookbooks

Effective: 30/11/2009

5.1.12.8. Several zones share a file system

[dd]The zone model makes it very easy for several zones to share a writable file system. This becomes possible if the global zone mounts a file system and makes this same file system available to several zones as a read/write loopback file system (Cookbook 5.1.12.2 The global zone supplies a file system per lofs to the local zone). From the point of view of Solaris, the operations on the filesystem are like are equal writing operations in a local file system. The applications must implement file-locking as usual, it works like with a shared filesystem.

This corresponds to an NFS file system being accessed by several clients. The global zone corresponds to the NFS server and the local zones correspond to the NFS clients.

5.1.12.9. ZFS in a zone

[ug] A ZFS file system can be assigned to a zone such that the zone administrator can use it as the base for further configuration and administration.

The ZFS can be assigned to the zone through add dataset of the zonecfg command.

Within the zone, the administrator can derive additional ZFS file systems from the file system by zfs create.

The attribute quota specified in the global zone cannot be changed or exceeded in the zone.

However, the zone administrator can specify the mount point within the zone.

#zpool create -m none tank

#zfs create tank/zone1

#zfs set quota=1g tank/zone1

#zfs set mountpoint=/mnt tank/zone1

#

#zonecfg -z zone1 zonecfg:zone1> add dataset zonecfg:zone1:device> set name=tank/zone1 zonecfg:zone1:device> end zonecfg:zone1> commit

zonecfg:zone1> exit

. . . reboot der Zone zone1 . . .

. . . login in die Zone zone1 . . .

zone1# zfs list

 

 

 

 

NAME

USED

AVAIL

REFER

MOUNTPOINT

tank

30.2M

10G

18K

none

tank/zone1

16.3M

983M

16.3M

/mnt

5.1.12.10. User attributes for ZFS within a zone

[ug] ZFS allows additional attributes to be managed for each file system that are stored together with the file system (since Solaris 10 5/08). It is necessary, that the name of these additional attributes contains a ":". These so-called user attributes can both be viewed manually as well as be used in scripts. The advantage is that they can be stored within the file system, allowing the documentation to remain with the file system even when used by another computer.

# zfs set admin:application="DB Webportal"

tank/db234_01

# zfs set admin:importance="critical"

tank/db234_01

# zfs set admin:costcenter="47110815"

tank/db234_01

# zfs set admin:application="App-Server Webportal"

tank/web234_01

# zfs set admin:costcenter="47110815"

tank/web234_01

# zfs get all

tank/web234_01 fgrep admin:

 

tank/web234_01

admin:application

App-Server Webportal local

tank/web234_01

admin:costcenter

47110815

local

#

 

 

 

# zfs get -H -o value admin:costcenter tank/db234_01

 

47110815

 

 

 

 

 

 

 

78

Page 85
Image 85
Sun Microsystems Several zones share a file system, ZFS in a zone, Tank 30.2M 10G 18K None Tank/zone1 16.3M 983M Mnt