Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: August 2019
 
 

Zones and the Service Management Facility

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).

Zone SMF Dependencies

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:

require_all Dependencies
  • svc:/system/filesystem/local:default
  • svc:/milestone/name-services:default
  • svc:/milestone/devices:default
  • svc:/milestone/network:default
optional_all Dependencies
  • svc:/system/pools:default
  • svc:/system/zones-monitoring:default

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

    Dependency descriptions:

  • require_all: svc:/application/list:default

  • require_any: svc:/system/zones/zone:appfirewall

  • require_any: svc:/3rdparty/my-firewall:default

  • exclude_all: svc:/system/zones/zone:dataload

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

For more information about the smf-dependency resource, see Oracle Solaris Zones Configuration Resources and the zonecfg(8) man page.


Note -  Failures during the infrastructure setup of a particular zone will place that zone in the maintenance state. Use the svcadm clear command on a zone instance to cause the zones delegated restarter to retry failed zoneadm boot or zoneadm attach operations for that zone.

About the Zone SMF Instance Service State

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

Zone SMF Instance Service States

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:

degraded

The zone SMF instance reached the online state, but zoneadmd failed multiple times and the daemon is not running.

disabled

The zone is halted and cannot be booted up by the zones restarter.

maintenance

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.

offline

The zone SMF instance is enabled, but its SMF dependencies have not been satisfied.

online

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:

svc:/milestone/multi-user-server:default

See Creating a Goal Service in Developing System Services in Oracle Solaris 11.4 for more information about milestone/goals.

uninitialized

svc.zones has not yet processed the corresponding zone.

SMF Goal Services and Zones

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.

Zones Boot Ordering

    Two steps establish zones boot order:

  1. 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.

  2. 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.

    See boot-priority Global Property in Oracle Solaris Zones Configuration Resources and smf-dependency Resource Type in Oracle Solaris Zones Configuration Resources.