The Oracle Solaris Service Management Facility (SMF) framework manages system and application services. SMF manages critical system services essential to the working operation of the system and also manages application services such as a database or web server. SMF improves the availability of a system by ensuring that essential system and application services run continuously, even in the event of a hardware or software failure.
The zones SMF service has mechanisms for prioritizing zones booting order, setting a threshold for the number of zones booting in parallel, and providing integration with Fault Management Architecture (FMA).
The set of Oracle Solaris Service Management Facility (SMF) Fault Management Resource Identifiers (FMRIs) that establish the dependencies for the zone are defined in the smf-dependency resource. The dependencies are comprised of name, fmri, and grouping properties. The dependencies of the svc:/system/zones:default service are as follows:
The set of SMF FMRIs that make up the zone dependencies is defined in the smf-dependency resource in the zonecfg command.
For more information about setting dependencies, see Chapter 1, Non-Global Zone Configuration Command and Resources in Oracle Solaris Zones Configuration Resources.Example 15 Setting SMF Dependencies on a Zone
global$ pfbash zonecfg -z my-zone zonecfg:my-zone> add smf-dependency zonecfg:my-zone:smf-dependency> set fmri=svc:/application/list:default zonecfg:my-zone:smf-dependency> end zonecfg:my-zone> add smf-dependency zonecfg:my-zone:smf-dependency> set name=firewall zonecfg:my-zone:smf-dependency> set fmri=svc:/system/zones/zone:appfirewall zonecfg:my-zone:smf-dependency> set grouping=require_any zonecfg:my-zone:smf-dependency> end zonecfg:my-zone> add smf-dependency zonecfg:my-zone:smf-dependency> set name=firewall zonecfg:my-zone:smf-dependency> set fmri=svc:/3rdparty/my-firewall:default zonecfg:my-zone:smf-dependency> end zonecfg:my-zone> add smf-dependency zonecfg:my-zone:smf-dependency> set fmri=svc:/system/zones/zone:dataload zonecfg:my-zone:smf-dependency> set grouping=exclude_all zonecfg:my-zone:smf-dependency> end zonecfg:my-zone> exit
The zone SMF instance service state is determined by the zone milestone/goals state. The milestone/goals goal service provides an unambiguous point where a system can be considered up and running.
The zones restarter is notified of the state of the milestone/goals service of each non-global zone that supports it. The zone SMF instance state of each non-global zone matches the state of its milestone/goals.
The zones delegated restarter can be instructed to ignore milestone/goals to move the zone SMF instance online, based on the success of the zoneadm boot command. If the boot operation fails, the zone SMF instance is placed in maintenance. This switch is controlled by the following SMF property group under the zones delegated restarter service:
PG name=config type=application config/track-zone-goals = true | false
As part of service management duties, the svc.zones command implements a state machine for each of its managed zone SMF instances. The states in this machine are made up of the states described in the smf(7) man page. The following are descriptions of these states:
The zone SMF instance reached the online state, but zoneadmd failed multiple times and the daemon is not running.
The zone is halted and cannot be booted up by the zones restarter.
Use the output of the svcs -vx command to determine the reason for the maintenance state. A zone SMF instance in the maintenance state will not clear the maintenance state on a disable event. A zone SMF instance can be in the maintenance state for the following reasons:
Failed boot attempt.
The zone is in a state from which it cannot be booted.
The zone's milestone/goals dependencies cannot be satisfied without administrative action.
The zone SMF instance is enabled, but its SMF dependencies have not been satisfied.
The zone is running and has reached milestone/goals. For zones that do not support milestone/goals, the online state will be reached immediately, when the zone begins booting.
The milestone/goals provide an unambiguous point where a system can be considered up and running. The dependencies of milestone/goals should be configured to align with the mission critical services for the system. The default dependency of milestone/goals is:
See Creating a Goal Service in Developing System Services in Oracle Solaris 11.4 for more information about milestone/goals.
svc.zones has not yet processed the corresponding zone.
A goal service defines the set of services that must be running for the zone to function as intended. The goal service notifies you if any of these services are not running at system start.
The milestone/goals goal service provides a clear, unambiguous, and well-defined point where a system can be considered up and running. The dependencies of milestone/goals should be configured to represent the mission critical services for the system. The default dependency of milestone/goals is: svc:/milestone/multi-user-server:default.
System administrators can use goal services to define the expected set of services that should be running when a system is up and functioning for its intended purpose. Goals services are administered by using the goals svcadm subcommand.
Goal services are expected to have all their dependencies satisfiable without intervention. If administrative intervention is required to have a dependency satisfied, the goal service will be placed in the maintenance state. Goal services that are in the maintenance state will automatically leave that state once their dependencies are satisfied.
In general, the goal service setting should not be used for services that perform actual work.
A service is set to behave as a goal service when the property general/goal-service= property is set to true.
Goal services should not depend on dynamically enabled services. Having dynamically enabled services will cause a goal service to enter the maintenance state until the dependency is enabled by another service. You can use svcadm subcommand goals to set the dependencies of goal services.
Two steps establish zones boot order:
Boot order is partially determined by the SMF dependencies of a zone SMF instance.
For example, if ZoneA should be booted before ZoneB, add ZoneA as a dependent of ZoneB. See the smf-dependency property in the zonecfg(8) man page.
Boot order is further controlled by assigning a boot priority for each zone. After the SMF dependencies are satisfied for a zone, then the zone will boot according to its configured boot-priority resource property. Accepted values are high, normal, and low. The default value is normal.