Procedure for Creating Sparse Root Zone
In this article we will be creating the Sparse root zone.
Pre-Requesties :
• Zonepath ( /export/zones/zone1 FS with atleast approx 300MB Size)
• Interface (e1000g0)
• Ip address with subnetmask (192.168.10.35 255.255.255.0)
Lets us start creating the sparse root zones from Global zone.
bash-3.00# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set autoboot=true
zonecfg:zone1> set zonepath=/export/zones/zone1
zonecfg:zone1> add net
zonecfg:zone1:net> set address=192.168.10.35
zonecfg:zone1:net> set physical=e1000g0
zonecfg:zone1:net> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
When we set zone as autoboot=true function, the zone service needs to be enabled. we can check the status with using "svcs" command.
bash-3.00# svcs -a|grep -i /zones
online 22:27:25 svc:/system/zones:default
Another rule is zones home directory permission should be as 700.
bash-3.00# chmod 700 /export/zones/zone1
bash-3.00# ls -ld /export/zones/zone1
drwx------ 3 root root 96 Jun 27 01:41 /export/zones/zone1
bash-3.00#
Now the zone status is configured status
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 configured /export/zones/zone1 native shared
bash-3.00#
Now we are ready to install the sparse root zone
bash-3.00#
bash-3.00# zoneadm -z zone1 install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <5988> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1114> packages on the zone.
Initialized <1114> packages on zone.
Zone <zone1> is initialized.
Installation of <2> packages was skipped.
The file </export/zones/zone1/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
bash-3.00#
Now the zone status is changed to installed status
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 installed /export/zones/zone1 native shared
bash-3.00#
Now the configuration looks like below and the zone is ready to boot now.
bash-3.00# zonecfg -z zone1 info
zonename: zone1
zonepath: /export/zones/zone1
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 192.168.10.35
physical: e1000g0
defrouter not specified
bash-3.00# zoneadm -z zone1 boot
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
3 zone1 running /export/zones/zone1 native shared
bash-3.00#
Since this is the first time that this zone is being booted up, some initial configurations needs to be performed.
For this we need to login in zone console with using "zlogin -C zone1" command.
Pre-Requesties :
• Zonepath ( /export/zones/zone1 FS with atleast approx 300MB Size)
• Interface (e1000g0)
• Ip address with subnetmask (192.168.10.35 255.255.255.0)
Lets us start creating the sparse root zones from Global zone.
bash-3.00# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set autoboot=true
zonecfg:zone1> set zonepath=/export/zones/zone1
zonecfg:zone1> add net
zonecfg:zone1:net> set address=192.168.10.35
zonecfg:zone1:net> set physical=e1000g0
zonecfg:zone1:net> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
When we set zone as autoboot=true function, the zone service needs to be enabled. we can check the status with using "svcs" command.
bash-3.00# svcs -a|grep -i /zones
online 22:27:25 svc:/system/zones:default
Another rule is zones home directory permission should be as 700.
bash-3.00# chmod 700 /export/zones/zone1
bash-3.00# ls -ld /export/zones/zone1
drwx------ 3 root root 96 Jun 27 01:41 /export/zones/zone1
bash-3.00#
Now the zone status is configured status
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 configured /export/zones/zone1 native shared
bash-3.00#
Now we are ready to install the sparse root zone
bash-3.00#
bash-3.00# zoneadm -z zone1 install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <5988> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1114> packages on the zone.
Initialized <1114> packages on zone.
Zone <zone1> is initialized.
Installation of <2> packages was skipped.
The file </export/zones/zone1/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
bash-3.00#
Now the zone status is changed to installed status
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 installed /export/zones/zone1 native shared
bash-3.00#
Now the configuration looks like below and the zone is ready to boot now.
bash-3.00# zonecfg -z zone1 info
zonename: zone1
zonepath: /export/zones/zone1
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 192.168.10.35
physical: e1000g0
defrouter not specified
bash-3.00# zoneadm -z zone1 boot
bash-3.00#
bash-3.00# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
3 zone1 running /export/zones/zone1 native shared
bash-3.00#
Since this is the first time that this zone is being booted up, some initial configurations needs to be performed.
For this we need to login in zone console with using "zlogin -C zone1" command.