Project

General

Profile

Feature #2594

implement graceful shutdown for local zones in zoneadm

Added by Jim Klimov almost 8 years ago. Updated about 6 years ago.

Status:
Resolved
Priority:
Normal
Category:
-
Start date:
2012-04-06
Due date:
2014-02-24
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

It is a long-sought feature (and apparently available in Solaris 11) to have a graceful shutdown command for zones via zoneadm (and further up-stack, from global zone/s halt/poweroff/reboot command).
Currently there are the following options:
  • "zoneadm -z ZONE halt" - aborts local zone processes ungracefully and revokes its resources (like poweroff)
  • "zoneadm -z ZONE reboot" - aborts local zone processes ungracefully and restarts it
  • "zlogin ZONE init 0" - gracefully shuts down the local zone, invoking its SMF stop methods and RC stop scripts
  • "zlogin ZONE init 6" - gracefully shuts down the local zone, invoking its SMF stop methods and RC stop scripts, then halts and restarts it

The first part of the newly proposed feature is to implement a "zoneadm -Z shutdown (-r)" method for feature-parity with Solaris 11 (http://docs.oracle.com/cd/E23824_01/html/821-1462/zoneadm-1m.html):

shutdown [-r [-— boot_options]]

    Cleanly shut down the zone (equivalent to running /usr/sbin/init 0 in the zone).
    The shutdown subcommand waits until the zone is successfully shut down; a zoneadm halt
    can be used to forcibly halt the zone, if the shutdown process takes a long time.

    If -r is specified, reboot the zone. See the boot subcommand for supported boot options.

The second part of the quest is to update halt.c and/or bootadm.c to invoke "zoneadm shutdown" when stopping the global zone gracefully (unless the fast halt/poweroff/reboot method is requested in GZ explicitly to bypass all stop methods).

Otherwise server processes running in local zones receive a SIGTERM signal via LZ "zoneadm halt" invokation, and at most 30 seconds to complete (from halt.c, see http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/halt/halt.c#check_zones_haltedness). For certain processes, especially in distributed systems like databases and their application servers, this timeframe may be inadequate for a proper clean shutdown, and should not be forced by the OS -- the local zone shutdown should behave just like global zone shutdown in both graceful and ungraceful modes.

History

#1

Updated by Alexander Eremin over 6 years ago

  • Assignee set to Alexander Eremin
  • % Done changed from 0 to 20
#2

Updated by Alexander Eremin over 6 years ago

  • Subject changed from Implement graceful shutdown for local zones in zoneadm, and use it for graceful shutdowns of global zone to implement graceful shutdown for local zones in zoneadm
#3

Updated by Electric Monk about 6 years ago

git commit 3c7284bd3243d42a710edac3a15f6019b4c849be

Author: Alexander Eremin <a.eremin@nexenta.com>

2594 implement graceful shutdown for local zones in zoneadm
Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Dan McDonald <danmcd@omniti.com>

#4

Updated by Alexander Eremin about 6 years ago

  • Due date set to 2014-02-24
  • Status changed from New to Resolved
  • % Done changed from 20 to 100

Also available in: Atom PDF