Pages

Wednesday, December 8, 2010

How to add ZFS filesystem to non global zone

You can share ZFS filesystem from global zone to non global zone. But only global zone administrator can administer properties of ZFS filesystem. Below is tips to share ZFS filesystem.

  1. See ZFS file system on your host. In this example you will share mirrpool/fs1 filesystem.
    bash-3.00# zfs list
    NAME USED AVAIL REFER MOUNTPOINT
    mirrpool 170K 976M 21K /mirrpool
    mirrpool/fs1 18K 976M 18K /mirrpool/fs1
  2. Set the mountpoint property for filesystem to legacy.
    bash-3.00# zfs set mountpoint=legacy mirrpool/fs1
    bash-3.00# zfs list
    NAME USED AVAIL REFER MOUNTPOINT
    mirrpool 142K 976M 18K /mirrpool
    mirrpool/fs1 18K 976M 18K legacy
  3. Reconfigure the non global zone to include ZFS filesystem. In this example non global zone name is zone1.
    bash-3.00# zonecfg -z zone1
    zonecfg:zone1> add fs
    zonecfg:zone1:fs> set type=zfs
    zonecfg:zone1:fs> set special=mirrpool/fs1
    zonecfg:zone1:fs> set dir=/zonepool
    zonecfg:zone1:fs> end
    zonecfg:zone1> exit
  4. Reboot the non global zone.
    bash-3.00# zoneadm -z zone1 reboot
    zoneadm: zone 'zone1': WARNING: The zone.cpu-shares rctl is set but
    zoneadm: zone 'zone1': FSS is not the default scheduling class for
    zoneadm: zone 'zone1': this zone. FSS will be used for processes
    zoneadm: zone 'zone1': in the zone but to get the full benefit of FSS,
    zoneadm: zone 'zone1': it should be the default scheduling class.
    zoneadm: zone 'zone1': See dispadmin(1M) for more details.
    zoneadm: zone 'zone1': WARNING: e1000g0:1: no matching subnet found in netmasks(4) for 172.16.31.150; using default of 255.255.0.0.
  5. Login to the non global zone and see the ZFS filesystem that shared from global zone.
    bash-3.00# zlogin zone1
    [Connected to zone 'zone1' pts/5]
    Last login: Tue Nov 2 15:22:28 on pts/5
    Sun Microsystems Inc. SunOS 5.10 Generic January 2005
    # df -h /zonepool
    Filesystem size used avail capacity Mounted on
    mirrpool/fs1 0K 18K 976M 1% /zonepool
  6. Remember that non global zone administrator can not administer the file system. Non global zone can not list ZFS filesystem.
    # zfs list
    no datasets available

No comments:

Post a Comment