Wednesday, 13 November 2013

First question in your mind is to identify the Non-Global Zone whether they Sparse or Whole Root Zone in real time. This post will help you to find those details in handy ways. Theoretically everyone having good knowledge about Sparse and Whole Root Zones. But in real time.....Please follow the Steps.

Here We have 2 Non-Global zone, but we are not sure which one is Sparse or Whole Root Zones. Let we identify them.
[root@unixrock ~]# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global          running    /                             native   shared
   1 unixrockLZ      running    /export/zones/unixrockLZ      native   shared
   2 unixrockLZ1     running    /export/zones/unixrockLZ1     native   shared
[root@unixrock ~]#
There is a Command called "pkgcond" allows you to determine the type of target being operated on (global zone, non-global zone). more details you can refer man Page of pkgcond. I'm executing the command on one Local zone let we can see the result.
[root@unixrockLZ ~]#  pkgcond -n is_what
can_add_driver=1
can_remove_driver=1
can_update_driver=1
is_alternative_root=0
is_boot_environment=0
is_diskless_client=0
is_global_zone=0
is_mounted_miniroot=0
is_netinstall_image=0
is_nonglobal_zone=1
is_path_writable=1
is_running_system=0
is_sparse_root_nonglobal_zone=0
is_whole_root_nonglobal_zone=1
[root@unixrockLZ ~]#
you can see the parameter "is_whole_root_nonglobal_zone=1" is stating that this zone is whole Root. I'm executing the same command on another LZ,
[root@unixrockLZ1 ~]#  pkgcond -n is_what
can_add_driver=1
can_remove_driver=1
can_update_driver=1
is_alternative_root=0
is_boot_environment=0
is_diskless_client=0
is_global_zone=0
is_mounted_miniroot=0
is_netinstall_image=0
is_nonglobal_zone=1
is_path_writable=1
is_running_system=0
is_sparse_root_nonglobal_zone=1
is_whole_root_nonglobal_zone=0
[root@@unixrockLZ1 ~]#
you can see the parameter "is_sparse_root_nonglobal_zone=1" is stating that this zone is Sparse Root. is there any way to check the same details from Global zone, yes we can. just follow the steps
[root@unixrock ~]# zonecfg -z unixrockLZ info
zonename: unixrockLZ
zonepath: /export/zones/unixrockLZ
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class: FSS
ip-type: shared
hostid:
net:
        address: 192.168.1.20/24
        physical: e1000g0
[root@unixrock ~]#
above configuration is for Whole Root zone
[root@unixrock ~]# zonecfg -z unixrockLZ1 info
zonepath: /export/zones/unixrockLZ1
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
ip-type: shared 
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
net:
        address: 192.168.1.21/24
        physical: e1000g0
[root@unixrock ~]#
If you find those inherit-pkg-dir of /lib, /platform, /sbin, /usr then blindly we can tell this is Sparse Root Zone. these files shared as Read Only file systems from its Global. FYI, Still we can't identify the GlobalZone Name from its non-global zone until unless you placed any script to find those details or "arp -a|grep -i SPLA" you might get more IP, But one of the IP is from Global, however its hard to find the details. I will post soon to find the Global Zone Name from non-global in easiest way. Thanks for reading this Post, if you have any doubt please comment, i will respond you.