Pages

Monday, January 10, 2011

How to delegate dataset to non global zone

You can delegate ZFS filesystem as dataset from global zone to non global zone. With this method, non global zone administrator can administer property of filesystem delegated. Tips to delegate dataset as below.

  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 168K 976M 18K /mirrpool
    mirrpool/fs1 18K 976M 18K legacy
    mirrpool/fs2 18K 976M 18K /mirrpool/fs2
  2. 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 dataset
    zonecfg:zone1:dataset> set name=mirrpool/fs2
    zonecfg:zone1:dataset> end
    zonecfg:zone1> exit
  3. See the zoned property of your ZFS filesystem.
    bash-3.00# zfs get -r zoned mirrpool
    NAME PROPERTY VALUE SOURCE
    mirrpool zoned off default
    mirrpool/fs1 zoned off default
    mirrpool/fs2 zoned off default
  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 mirrpool/fs2
    Filesystem size used avail capacity Mounted on
    mirrpool/fs2 976M 18K 976M 1% /mirrpool/fs2
  6. Remember that non global zone administrator can administer the file system. List the ZFS filesystem.
    # zfs list
    NAME USED AVAIL REFER MOUNTPOINT
    mirrpool 168K 976M 18K /mirrpool
    mirrpool/fs2 18K 976M 18K /mirrpool/fs2
  7. Return to the global zone and see the zoned property of filesystem that you have delegated to non global zone.
    bash-3.00# zfs get -r zoned mirrpool
    NAME PROPERTY VALUE SOURCE
    mirrpool zoned off default
    mirrpool/fs1 zoned off default
    mirrpool/fs2 zoned on local

No comments:

Post a Comment