2 .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
3 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH ZONEADM 1M "Sep 8, 2015"
9 zoneadm \- administer zones
13 \fBzoneadm\fR \fB-z\fR \fIzonename\fR [\fB-u\fR \fIuuid-match\fR] \fIsubcommand\fR
14 [\fIsubcommand_options\fR]
19 \fBzoneadm\fR [\fB-R\fR \fIroot\fR] [\fB-z\fR \fIzonename\fR] [\fB-u\fR \fIuuid-match\fR] list
25 \fBzoneadm\fR [\fB-R\fR \fIroot\fR] \fB-z\fR \fIzonename\fR [\fB-u\fR \fIuuid-match\fR] mark incomplete
30 The \fBzoneadm\fR utility is used to administer system zones. A zone is an
31 application container that is maintained by the operating system runtime.
34 Once a process has been placed in a zone other than zone \fB0\fR, the process
35 or any of its children cannot change zones.
38 The following options are supported:
42 \fB\fB-R\fR \fIroot\fR\fR
46 Specify an alternate root (boot environment). This option can only be used in
47 conjunction with the "\fBlist\fR" and "\fBmark\fR" subcommands.
53 \fB\fB-u\fR \fIuuid-match\fR\fR
57 Unique identifier for a zone, as assigned by \fBlibuuid\fR(3LIB). If this
58 option is present and the argument is a non-empty string, then the zone
59 matching the \fBUUID\fR is selected instead of the one named by the \fB-z\fR
60 option, if such a zone is present.
66 \fB\fB-z\fR \fIzonename\fR\fR
70 String identifier for a zone.
75 Subcommands which can result in destructive actions or loss of work have a
76 \fB-F\fR flag to force the action. If input is from a terminal device, the user
77 is prompted if such a command is given without the \fB-F\fR flag; otherwise, if
78 such a command is given without the \fB-F\fR flag, the action is disallowed,
79 with a diagnostic message written to standard error. If a zone installation or
80 uninstallation is interrupted, the zone is left in the incomplete state. Use
81 uninstall to reset such a zone back to the configured state.
84 The following subcommands are supported:
88 \fB\fBattach\fR [\fB-F\fR] [\fB-n\fR \fIpath\fR] [\fIbrand-specific
93 The \fBattach\fR subcommand takes a zone that has been detached from one system
94 and attaches the zone onto a new system. Therefore, it is advised (though not
95 required) that the \fBdetach\fR subcommand should be run before the "attach"
96 takes place. Once you have the new zone in the configured state, use the
97 \fBattach\fR subcommand to set up the zone root instead of installing the zone
100 The \fB-F\fR option can be used to force the zone into the "installed" state
101 with no validation. This option should be used with care since it can leave the
102 zone in an unsupportable state if it was moved from a source system to a target
103 system that is unable to properly host the zone. The \fB-n\fR option can be
104 used to run the \fBattach\fR subcommand, without executing the command. It uses
105 the output of the "\fBdetach\fR \fB-n\fR" subcommand as input and is useful to
106 identify any conflicting issues, such as the network device being incompatible,
107 and can also determine whether the host is capable of supporting the zone. The
108 path can be "\fB-\fR", to read the input from standard input.
110 The zone's brand may include additional options that govern how the zone will
111 be attached. See \fBbrands\fR(5) for specific brand information.
113 The zone being attached must first be configured using the \fBzonecfg\fR (see
114 \fBzonecfg\fR(1M)) command. This does not apply when running "\fBattach\fR
117 Use the following command to attach a zone:
121 # \fBzoneadm -z my-zone attach\fR
131 \fB\fBboot\fR [\fB--\fR \fIboot_options\fR]\fR
135 Boot (or activate) the specified zones.
137 The following \fIboot_options\fR are supported:
141 \fB\fB-i\fR \fIaltinit\fR\fR
145 Select an alternative executable to be the primordial Process. \fIaltinit\fR is
146 a valid path to an executable. The default primordial process is
153 \fB\fB-m\fR \fIsmf_options\fR\fR
157 The \fIsmf_options\fR include two categories of options to control booting
158 behavior of the service management facility: recovery options and messages
161 Message options determine the type and amount of messages that \fBsmf\fR(5)
162 displays during boot. Service options determine the services which are used to
163 boot the system. See \fBkernel\fR(1M) for a listing of the \fB-m\fR suboptions.
173 Boots only to milestone \fBsvc:/milestone/single-user:default\fR. This
174 milestone is equivalent to init level \fBs\fR. See \fBsvc.startd\fR(1M) and
183 \fB\fBclone\fR [\fB-m\fR \fIcopy\fR] [\fB-s\fR \fIzfs_snapshot\fR]
188 Install a zone by copying an existing installed zone. This subcommand is an
189 alternative way to install the zone.
193 \fB\fB-m\fR \fIcopy\fR\fR
197 Force the clone to be a copy, even if a "\fBZFS\fR clone" is possible.
203 \fB\fB-s\fR \fIzfs_snapshot\fR\fR
207 Specify the name of a \fBZFS\fR snapshot to use as the source of the clone. The
208 \fIsnapshot\fR must be a \fIsnapshot\fR of the source zone taken from a
209 previous "\fBzoneadm\fR clone" installation.
212 The source zone must be halted before this subcommand can be used.
218 \fB\fBdetach\fR [\fB-n\fR]\fR
222 Detach the specified zone. Detaching a zone is the first step in moving a zone
223 from one system to another. The full procedure to migrate a zone is that the
224 zone is detached, the \fIzonepath\fR directory is moved to the new host, and
225 then the zone is attached on the new host. Once the zone is detached, it is
226 left in the configured state. If you try to install or clone to a configured
227 zone that has been detached, you will receive an error message and the
228 \fBinstall\fR or \fBclone\fR subcommand will not be allowed to proceed. The
229 \fB-n\fR option can be used to run the \fBdetach\fR subcommand, without
230 executing the command. This generates the information needed for running the
231 "\fBattach\fR \fB-n\fR" subcommand, which is useful to identify any conflicting
232 issues, such as the network device being incompatible or if the host is capable
233 of supporting the zone. The information is sent to standard output and can be
234 saved to a file or piped to the "\fBattach\fR \fB-n\fR" subcommand.
236 Use the following command to detach a zone:
240 # zoneadm -z my-zone detach
245 The source zone must be halted before this subcommand can be used.
255 Halt the specified zones. \fBhalt\fR bypasses running the shutdown scripts
256 inside the zone. It also removes run time resources of the zone.
262 \fB\fBhelp\fR [\fIsubcommand\fR]\fR
266 Display general help. If you specify \fIsubcommand\fR, displays help on
273 \fB\fBinstall\fR [\fB-x\fR \fInodataset\fR] [\fIbrand-specific options\fR]\fR
277 Install the specified zone on the system. This subcommand automatically
278 attempts to verify first, most verification errors are fatal. See the
279 \fBverify\fR subcommand.
283 \fB\fB-x\fR \fInodataset\fR\fR
287 Do not create a \fBZFS\fR file system.
290 The zone's brand may include additional options that govern how the software
291 will be installed in the zone. See \fBbrands\fR(5) for specific brand
298 \fB\fBlist\fR [\fIlist_options\fR]\fR
302 Display the name of the current zones, or the specified zone if indicated.
304 By default, all running zones are listed. If you use this subcommand with the
305 \fBzoneadm\fR \fB-z\fR \fIzonename\fR option, it lists only the specified zone,
306 regardless of its state. In this case, the \fB-i\fR and \fB-c\fR options are
309 If neither the \fB-i\fR or \fB-c\fR options are given, all running zones are
312 The following \fIlist_options\fR are supported:
320 Display all configured zones. This option overides the \fB-i\fR option.
330 Expand the display to all installed zones.
340 Request machine parsable output. The output format is a list of lines, one per
341 zone, with colon- delimited fields. These fields are:
345 zoneid:zonename:state:zonepath:uuid:brand:ip-type
350 If the \fBzonepath\fR contains embedded colons, they can be escaped by a
351 backslash ("\:"), which is parsable by using the shell \fBread\fR(1) function
352 with the environmental variable \fBIFS\fR. The \fIuuid\fR value is assigned by
353 \fBlibuuid\fR(3LIB) when the zone is installed, and is useful for identifying
354 the same zone when present (or renamed) on alternate boot environments. Any
355 software that parses the output of the "\fBzoneadm list -p\fR" command must be
356 able to handle any fields that may be added in the future.
358 The \fB-v\fR and \fB-p\fR options are mutually exclusive. If neither \fB-v\fR
359 nor \fB-p\fR is used, just the zone name is listed.
369 Display verbose information, including zone name, id, current state, root
370 directory, brand type, ip-type, and options.
372 The \fB-v\fR and \fB-p\fR options are mutually exclusive. If neither \fB-v\fR
373 nor \fB-p\fR is used, just the zone name is listed.
381 \fB\fBmark incomplete\fR\fR
385 Change the state of an installed zone to "incomplete." This command may be
386 useful in cases where administrative changes on the system have rendered a zone
387 unusable or inconsistent. This change cannot be undone (except by uninstalling
394 \fB\fBmove\fR \fInew_zonepath\fR\fR
398 Move the \fIzonepath\fR to \fInew_zonepath\fR. The zone must be halted before
399 this subcommand can be used. The \fInew_zonepath\fR must be a local file system
400 and normal restrictions for \fIzonepath\fR apply.
410 Prepares a zone for running applications but does not start any user processes
417 \fB\fBreboot\fR\ [\fB--\fR \fIboot_options\fR]]\fR
421 Restart the zones. This is equivalent to a \fBhalt\fR \fBboot\fR sequence. This
422 subcommand fails if the specified zones are not active. See \fIboot\fR subcommand
423 for the boot options.
429 \fB\fBshutdown\fR [\fB-r\fR [\fB--\fR \fIboot_options\fR]]\fR
433 Gracefully shutdown the specified zone. This subcommand waits for all zone
434 processes to finish; the default timeout is SCF_PROPERTY_TIMEOUT value from
435 the SMF service system/zones. If the \fB-r\fR option is specified, reboot the
436 zone. See \fIboot\fR subcommand for the boot options.
442 \fB\fBuninstall [\fR\fB-F\fR\fB]\fR\fR
446 Uninstall the specified zone from the system. Use this subcommand with caution.
447 It removes all of the files under the \fIzonepath\fR of the zone in question.
448 You can use the \fB-F\fR flag to force the action.
458 Check to make sure the configuration of the specified zone can safely be
459 installed on the machine. Following is a break-down of the checks by
460 \fBresource/property\fR type:
468 \fBzonepath\fR and its parent directory exist and are owned by root with
469 appropriate modes . The appropriate modes are that \fBzonepath\fR is \fB700\fR,
470 its parent is not \fBgroup\fR or \fBworld-writable\fR and so forth.
471 \fBzonepath\fR is not over an NFS mount. A sub-directory of the \fBzonepath\fR
472 named "root" does not exist.
474 If \fBzonepath\fR does not exist, the \fBverify\fR does not fail, but merely
475 warns that a subsequent install will attempt to create it with proper
476 permissions. A \fBverify\fR subsequent to that might fail should anything go
479 \fBzonepath\fR cannot be a symbolic link.
489 Any \fBfs\fR resources have their \fItype\fR value checked. An error is
490 reported if the value is one of \fBproc\fR, \fBmntfs\fR, \fBautofs\fR,
491 or \fBnfs\fR or the filesystem does not have an associated mount
492 binary at \fB/usr/lib/fs/\fI<fstype>\fR/mount\fR.
494 It is an error for the \fIdirectory\fR to be a relative path.
496 It is an error for the path specified by \fBraw\fR to be a relative path or if
497 there is no \fBfsck\fR binary for a given filesystem type at
498 \fB/usr/lib/fs/\fI<fstype>\fR/fsck\fR. It is also an error if a corresponding
499 \fBfsck\fR binary exists but a \fBraw\fR path is not specified.
509 All physical network interfaces exist. All network address resources are one
515 a valid IPv4 address, optionally followed by "\fB/\fR" and a prefix length;
521 a valid IPv6 address, which must be followed by "\fB/\fR" and a prefix length;
527 a host name which resolves to an IPv4 address.
529 Note that hostnames that resolve to IPv6 addresses are not supported.
531 The physical interface name is the network interface name.
533 A zone can be configured to be either exclusive-IP or shared-IP. For a
534 shared-IP zone, both the physical and address properties must be set. For an
535 exclusive-IP zone, the physical property must be set and the address property
546 It also verifies that any defined resource control values are valid on the
547 current machine. This means that the privilege level is \fBprivileged\fR, the
548 limit is lower than the currently defined system value, and that the defined
549 action agrees with the actions that are valid for the given resource control.
556 \fBExample 1 \fRUsing the \fB-m\fR Option
559 The following command illustrates the use of the \fB-m\fR option.
564 # \fBzoneadm boot -- -m verbose\fR
570 \fBExample 2 \fRUsing the \fB-i\fR Option
573 The following command illustrates the use of the \fB-i\fR option.
578 # \fBzoneadm boot -- -i /sbin/init\fR
584 \fBExample 3 \fRUsing the \fB-s\fR Option
587 The following command illustrates the use of the \fB-s\fR option.
592 # \fBzoneadm boot -- -s\fR
599 The following exit values are returned:
607 Successful completion.
632 See \fBattributes\fR(5) for descriptions of the following attributes:
640 ATTRIBUTE TYPE ATTRIBUTE VALUE
642 Interface Stability Committed
647 \fBread\fR(1), \fBsvcs\fR(1), \fBzlogin\fR(1), \fBzonename\fR(1),
648 \fBinit\fR(1M), \fBkernel\fR(1M), \fBsvcadm\fR(1M), \fBsvc.startd\fR(1M),
649 \fBsvc.startd\fR(1M), \fBzonecfg\fR(1M), \fBlibuuid\fR(3LIB),
650 \fBattributes\fR(5), \fBbrands\fR(5), \fBnative\fR(5), \fBsmf\fR(5),
654 The \fBzones\fR(5) service is managed by the service management facility,
655 \fBsmf\fR(5), under the service identifier:
659 svc:/system/zones:default
666 Administrative actions on this service, such as enabling, disabling, or
667 requesting restart, can be performed using \fBsvcadm\fR(1M). The service's
668 status can be queried using the \fBsvcs\fR(1) command.
671 The act of installing a new non-global zone is a fresh installation of the
672 Solaris operating system. A new installation of Solaris must not require
673 interaction with the user (that is, it must be "hands off"). Because of this,
674 packages installed in the global zone and all non-global zones cannot contain
675 request scripts (see \fBpkgask\fR(1M)). If a package did have a request script,
676 then the creation of a non-global zone could not be done without user
677 intervention. Any package that contains a request script is added to the global
678 zone only. See \fBpkgadd\fR(1M).