I will start this post creating a default solaris zone, so we can see the main differences with our lightweight zone
We can see that there's no zones created in our box, we are only running the default. global zone.
jack@t4-1:/$ zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
I will create the defaultzone zone
root@t4-1:/zones# zonecfg -z defaultzone
Use 'create' to begin configuring a new zone.
zonecfg:defaultzone> create
create: Using system default template 'SYSdefault'
zonecfg:defaultzone> set zonepath= /zones/defaultzone
zonecfg:defaultzone> commit
zonecfg:defaultzone> exit
root@t4-1:/zones#
root@t4-1:/zones# zoneadm -z defaultzone install
The following ZFS file system(s) have been created:
rpool/zones/defaultzone
Progress being logged to /var/log/zones/zoneadm.20170120T200327Z.defaultzone.install
Image: Preparing at /zones/defaultzone/root.
Install Log: /system/volatile/install.19363/install_log
AI Manifest: /tmp/manifest.xml.EDa4YL
SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
Zonename: defaultzone
Installation: Starting ...
Creating IPS image
Startup linked: 1/1 done
Installing packages from:
..................................
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 277/277 47919/47919 353.1/353.1 3.5M/s
PHASE ITEMS
Installing new actions 65417/65417
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Updating package cache 3/3
Installation: Succeeded
Note: Man pages can be obtained by installing pkg:/system/manual
done.
Done: Installation completed in 288.340 seconds.
Next Steps: Boot the zone, then log into the zone console (zlogin -C)
to complete the configuration process.
I will finish the zone setup booting the zone and finishing the configuration (i will skip booting and config process to speed up the lecture of this post)
root@t4-1:/zones# zoneadm -z defaultzone boot
root@t4-1:/zones# zlogin -C defaultzone
After network setup and after finish installation, we can see our new zone
root@t4-1:/zones# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
3 defaultzone running /zones/defaultzone solaris excl
root@t4-1:/zones# zlogin -C defaultzone
[Connected to zone 'defaultzone' console]
We can see right now some numbers about the defaultzone
N°of process running
defuser@defaultzone:~$ ps -ef | wc -l
36
N°of pkg installed
defuser@defaultzone:~$ pkg list | wc -l
278
N° of services running
defuser@defaultzone:~$ svcs -a | grep online | wc -l
90
defuser@defaultzone:~$
In order to create the zone using the lightweight package group, we need to use another manifest using that group, for that we can create a new one, copying the default one and changing the group information
root@t4-1:/zones# cd /usr/share/auto_install/manifest/
root@t4-1:/usr/share/auto_install/manifest#
root@t4-1:/usr/share/auto_install/manifest# ls
ai_manifest.xml default.xml editor zone_default_unified_archive.xml
default.ksh.tmpl default_archive.xml zone_default.xml
root@t4-1:/usr/share/auto_install/manifest# cp zone_default.xml zone_min.xml
Now we need to edit the zone_min.xml file and change the package group entry for pkg:/group/system/solaris-minimal-server
<facet set="true">facet.locale.zh</facet>
<facet set="true">facet.locale.zh_CN</facet>
<facet set="true">facet.locale.zh_TW</facet>
</image>
</destination>
<software_data action="install">
<name>pkg:/group/system/solaris-minimal-server</name>
</software_data>
</software>
Now that we have done this, we can proceed to create our zone and call our new manifest
(zone_min.xml)
root@t4-1:/# zonecfg -z minimalzone
Use 'create' to begin configuring a new zone.
zonecfg:minimalzone> create
create: Using system default template 'SYSdefault'
zonecfg:minimalzone> set zonepath=/zones/minimalzone
zonecfg:minimalzone> commit
zonecfg:minimalzone> exit
root@t4-1:/#
zoneadm install -z minimalzone -m /usr/share/auto_install/manifest/zone_min.xml
The following ZFS file system(s) have been created:
rpool/zones/minimalzone
Progress being logged to /var/log/zones/zoneadm.20170120T211831Z.minimalzone.install
Image: Preparing at /zones/minimalzone/root.
Install Log: /system/volatile/install.22649/install_log
AI Manifest: /tmp/manifest.xml.OcaOnS
SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
Zonename: minimalzone
Installation: Starting ...
Creating IPS image
Startup linked: 1/1 done
Installing packages from:
.........................................
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 203/203 39178/39178 258.0/258.0 3.1M/s
PHASE ITEMS
Installing new actions 53458/53458
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Updating package cache 3/3
Installation: Succeeded
Note: Man pages can be obtained by installing pkg:/system/manual
done.
Done: Installation completed in 241.959 seconds.
Next Steps: Boot the zone, then log into the zone console (zlogin -C)
to complete the configuration process.
Log saved in non-global zone as /zones/minimalzone/root/var/log/zones/zoneadm.20170120T211831Z.minimalzone.install
root@t4-1:/zones# zoneadm -z minimalzone boot
root@t4-1:/zones# zlogin -C minimalzone
After network setup and after finish installation, we can see our new zone
minimalzone console login: minuser
Password:
Oracle Corporation SunOS 5.11 11.3 September 2015
minuser@minimalzone:~$
minuser@minimalzone:~$
minuser@minimalzone:~$
Now we can see some numbers from the minimalzone
N°of process running
minuser@minimalzone:~$ ps -ef | wc -l
28
N°of pkg installed
minuser@minimalzone:~$ pkg list | wc -l
204
N° of services running
minuser@minimalzone:~$ svcs -a | grep online | wc -l
80
As we can see there's no big difference between this two configuration, at least at the process and services level.
At the package level we can see a difference of 74 pkg that are not installed in the minimal server group
I will finish my conclusions and final thoughts in the
3rd and final part of this post.
Cheers
Rodolfo