2 .\" Copyright (c) 2004, 2009 Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2013 Joyent, Inc. All Rights Reserved.
4 .\" Copyright 2017 Peter Tribble
5 .\" 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. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
6 .\" See the License for the specific language governing permissions and limitations under the License. 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
7 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH ZONECFG 8 "Jul 24, 2017"
10 zonecfg \- set up zone configuration
14 \fBzonecfg\fR \fB-z\fR \fIzonename\fR
19 \fBzonecfg\fR \fB-z\fR \fIzonename\fR \fIsubcommand\fR
24 \fBzonecfg\fR \fB-z\fR \fIzonename\fR \fB-f\fR \fIcommand_file\fR
34 The \fBzonecfg\fR utility creates and modifies the configuration of a zone.
35 Zone configuration consists of a number of resources and properties.
38 To simplify the user interface, \fBzonecfg\fR uses the concept of a scope. The
39 default scope is global.
42 The following synopsis of the \fBzonecfg\fR command is for interactive usage:
46 zonecfg \fB-z\fR \fIzonename subcommand\fR
53 Parameters changed through \fBzonecfg\fR do not affect a running zone. The zone
54 must be rebooted for the changes to take effect.
57 In addition to creating and modifying a zone, the \fBzonecfg\fR utility can
58 also be used to persistently specify the resource management settings for the
62 In the following text, "rctl" is used as an abbreviation for "resource
63 control". See \fBresource_controls\fR(5).
66 Every zone is configured with an associated brand. The brand determines the
67 user-level environment used within the zone, as well as various behaviors for
68 the zone when it is installed, boots, or is shutdown. Once a zone has been
69 installed the brand cannot be changed. The default brand is determined by the
70 installed distribution in the global zone. Some brands do not support all of
71 the \fBzonecfg\fR properties and resources. See the brand-specific man page for
72 more details on each brand. For an overview of brands, see the \fBbrands\fR(5)
76 The following resource types are supported:
90 \fB\fBcapped-cpu\fR\fR
100 \fB\fBcapped-memory\fR\fR
104 Limits for physical, swap, and locked memory.
120 \fB\fBdedicated-cpu\fR\fR
124 Subset of the system's processors dedicated to this zone while it is running.
170 \fB\fBsecurity-flags\fR\fR
174 Process security flag settings.
184 Delegation of administration to specific users.
189 Each resource type has one or more properties. There are also some global
190 properties, that is, properties of the configuration as a whole, rather than of
191 some particular resource.
194 The following properties are supported:
342 \fBscheduling-class\fR
362 \fBdir\fR, \fBspecial\fR, \fBraw\fR, \fBtype\fR, \fBoptions\fR
372 \fBaddress\fR, \fBallowed-address\fR, \fBphysical\fR, \fBdefrouter\fR
392 \fBname\fR, \fBvalue\fR
402 \fBname\fR, \fBtype\fR, \fBvalue\fR
418 \fB\fBdedicated-cpu\fR\fR
422 \fBncpus\fR, \fBimportance\fR
428 \fB\fBcapped-memory\fR\fR
432 \fBphysical\fR, \fBswap\fR, \fBlocked\fR
438 \fB\fBcapped-cpu\fR\fR
448 \fB\fBsecurity-flags\fR\fR
452 \fBlower\fR, \fBdefault\fR, \fBupper\fR.
462 \fBuser\fR, \fBauths\fR.
467 As for the property values which are paired with these names, they are either
468 simple, complex, or lists. The type allowed is property-specific. Simple values
469 are strings, optionally enclosed within quotation marks. Complex values have
474 (<\fIname\fR>=<\fIvalue\fR>,<\fIname\fR>=<\fIvalue\fR>,...)
481 where each <\fIvalue\fR> is simple, and the <\fIname\fR> strings are unique
482 within a given property. Lists have the syntax:
493 where each <\fIvalue\fR> is either simple or complex. A list of a single value
494 (either simple or complex) is equivalent to specifying that value without the
495 list syntax. That is, "foo" is equivalent to "[foo]". A list can be empty
499 In interpreting property values, \fBzonecfg\fR accepts regular expressions as
500 specified in \fBfnmatch\fR(5). See \fBEXAMPLES\fR.
503 The property types are described as follows:
507 \fBglobal: \fBzonename\fR\fR
511 The name of the zone.
517 \fBglobal: \fBzonepath\fR\fR
521 Path to zone's file system.
527 \fBglobal: \fBautoboot\fR\fR
531 Boolean indicating that a zone should be booted automatically at system boot.
532 Note that if the zones service is disabled, the zone will not autoboot,
533 regardless of the setting of this property. You enable the zones service with a
534 \fBsvcadm\fR command, such as:
538 # \fBsvcadm enable svc:/system/zones:default\fR
543 Replace \fBenable\fR with \fBdisable\fR to disable the zones service. See
550 \fBglobal: \fBbootargs\fR\fR
554 Arguments (options) to be passed to the zone bootup, unless options are
555 supplied to the "\fBzoneadm boot\fR" command, in which case those take
556 precedence. The valid arguments are described in \fBzoneadm\fR(8).
562 \fBglobal: \fBpool\fR\fR
566 Name of the resource pool that this zone must be bound to when booted. This
567 property is incompatible with the \fBdedicated-cpu\fR resource.
573 \fBglobal: \fBlimitpriv\fR\fR
577 The maximum set of privileges any process in this zone can obtain. The property
578 should consist of a comma-separated privilege set specification as described in
579 \fBpriv_str_to_set\fR(3C). Privileges can be excluded from the resulting set by
580 preceding their names with a dash (-) or an exclamation point (!). The special
581 privilege string "zone" is not supported in this context. If the special string
582 "default" occurs as the first token in the property, it expands into a safe set
583 of privileges that preserve the resource and security isolation described in
584 \fBzones\fR(5). A missing or empty property is equivalent to this same set of
587 The system administrator must take extreme care when configuring privileges for
588 a zone. Some privileges cannot be excluded through this mechanism as they are
589 required in order to boot a zone. In addition, there are certain privileges
590 which cannot be given to a zone as doing so would allow processes inside a zone
591 to unduly affect processes in other zones. \fBzoneadm\fR(8) indicates when an
592 invalid privilege has been added or removed from a zone's privilege set when an
593 attempt is made to either "boot" or "ready" the zone.
595 See \fBprivileges\fR(5) for a description of privileges. The command "\fBppriv
596 -l\fR" (see \fBppriv\fR(1)) produces a list of all Solaris privileges. You can
597 specify privileges as they are displayed by \fBppriv\fR. In
598 \fBprivileges\fR(5), privileges are listed in the form
599 PRIV_\fIprivilege_name\fR. For example, the privilege \fIsys_time\fR, as you
600 would specify it in this property, is listed in \fBprivileges\fR(5) as
607 \fBglobal: \fBbrand\fR\fR
611 The zone's brand type.
617 \fBglobal: \fBip-type\fR\fR
621 A zone can either share the IP instance with the global zone, which is the
622 default, or have its own exclusive instance of IP.
624 This property takes the values \fBshared\fR and \fBexclusive\fR.
630 \fBglobal: \fBhostid\fR\fR
634 A zone can emulate a 32-bit host identifier to ease system consolidation. A
635 zone's \fBhostid\fR property is empty by default, meaning that the zone does
636 not emulate a host identifier. Zone host identifiers must be hexadecimal values
637 between 0 and FFFFFFFE. A \fB0x\fR or \fB0X\fR prefix is optional. Both
638 uppercase and lowercase hexadecimal digits are acceptable.
644 \fB\fBfs\fR: dir, special, raw, type, options\fR
648 Values needed to determine how, where, and so forth to mount file systems. See
649 \fBmount\fR(8), \fBmount\fR(2), \fBfsck\fR(8), and \fBvfstab\fR(4).
655 \fB\fBnet\fR: address, allowed-address, physical, defrouter\fR
659 The network address and physical interface name of the network interface. The
660 network address is one of:
665 a valid IPv4 address, optionally followed by "\fB/\fR" and a prefix length;
671 a valid IPv6 address, which must be followed by "\fB/\fR" and a prefix length;
677 a host name which resolves to an IPv4 address.
679 Note that host names that resolve to IPv6 addresses are not supported.
681 The physical interface name is the network interface name.
683 The default router is specified similarly to the network address except that it
684 must not be followed by a \fB/\fR (slash) and a network prefix length.
686 A zone can be configured to be either exclusive-IP or shared-IP. For a
687 shared-IP zone, you must set both the physical and address properties; setting
688 the default router is optional. The interface specified in the physical
689 property must be plumbed in the global zone prior to booting the non-global
690 zone. However, if the interface is not used by the global zone, it should be
691 configured \fBdown\fR in the global zone, and the default router for the
692 interface should be specified here.
694 For an exclusive-IP zone, the physical property must be set and the address and
695 default router properties cannot be set.
697 An exclusive-IP zone is responsible for managing its own network configuration.
698 If the allowed-address property is set, the zone administrator will only be
699 permitted to configure the interface with the specified address. To allow
700 multiple addresses (for example, an IPv4 and IPv6 address), use add net
707 \fB\fBdevice\fR: match\fR
711 Device name to match.
717 \fB\fBrctl\fR: name, value\fR
721 The name and \fIpriv\fR/\fIlimit\fR/\fIaction\fR triple of a resource control.
722 See \fBprctl\fR(1) and \fBrctladm\fR(8). The preferred way to set rctl values
723 is to use the global property name associated with a specific rctl.
729 \fB\fBattr\fR: name, type, value\fR
733 The name, type and value of a generic attribute. The \fBtype\fR must be one of
734 \fBint\fR, \fBuint\fR, \fBboolean\fR or \fBstring\fR, and the value must be of
735 that type. \fBuint\fR means unsigned, that is, a non-negative integer.
741 \fB\fBdataset\fR: name\fR
745 The name of a \fBZFS\fR dataset to be accessed from within the zone. See
752 \fBglobal: \fBcpu-shares\fR\fR
756 The number of Fair Share Scheduler (FSS) shares to allocate to this zone. This
757 property is incompatible with the \fBdedicated-cpu\fR resource. This property
758 is the preferred way to set the \fBzone.cpu-shares\fR rctl.
764 \fBglobal: \fBmax-lwps\fR\fR
768 The maximum number of LWPs simultaneously available to this zone. This property
769 is the preferred way to set the \fBzone.max-lwps\fR rctl.
775 \fBglobal: \fBmax-msg-ids\fR\fR
779 The maximum number of message queue IDs allowed for this zone. This property is
780 the preferred way to set the \fBzone.max-msg-ids\fR rctl.
786 \fBglobal: \fBmax-sem-ids\fR\fR
790 The maximum number of semaphore IDs allowed for this zone. This property is the
791 preferred way to set the \fBzone.max-sem-ids\fR rctl.
797 \fBglobal: \fBmax-shm-ids\fR\fR
801 The maximum number of shared memory IDs allowed for this zone. This property is
802 the preferred way to set the \fBzone.max-shm-ids\fR rctl.
808 \fBglobal: \fBmax-shm-memory\fR\fR
812 The maximum amount of shared memory allowed for this zone. This property is the
813 preferred way to set the \fBzone.max-shm-memory\fR rctl. A scale (K, M, G, T)
814 can be applied to the value for this number (for example, 8 is one megabyte).
820 \fBglobal: \fBscheduling-class\fR\fR
824 Specifies the scheduling class used for processes running in a zone. When this
825 property is not specified, the scheduling class is established as follows:
830 If the \fBcpu-shares\fR property or equivalent rctl is set, the scheduling
837 If neither \fBcpu-shares\fR nor the equivalent rctl is set and the zone's pool
838 property references a pool that has a default scheduling class, that class is
845 Under any other conditions, the system default scheduling class is used.
854 \fB\fBdedicated-cpu\fR: ncpus, importance\fR
858 The number of CPUs that should be assigned for this zone's exclusive use. The
859 zone will create a pool and processor set when it boots. See \fBpooladm\fR(8)
860 and \fBpoolcfg\fR(8) for more information on resource pools. The \fBncpu\fR
861 property can specify a single value or a range (for example, 1-4) of
862 processors. The \fBimportance\fR property is optional; if set, it will specify
863 the \fBpset.importance\fR value for use by \fBpoold\fR(8). If this resource is
864 used, there must be enough free processors to allocate to this zone when it
865 boots or the zone will not boot. The processors assigned to this zone will not
866 be available for the use of the global zone or other zones. This resource is
867 incompatible with both the \fBpool\fR and \fBcpu-shares\fR properties. Only a
868 single instance of this resource can be added to the zone.
874 \fB\fBcapped-memory\fR: physical, swap, locked\fR
878 The caps on the memory that can be used by this zone. A scale (K, M, G, T) can
879 be applied to the value for each of these numbers (for example, 8 is one
880 megabyte). Each of these properties is optional but at least one property must
881 be set when adding this resource. Only a single instance of this resource can
882 be added to the zone. The \fBphysical\fR property sets the \fBmax-rss\fR for
883 this zone. This will be enforced by \fBrcapd\fR(8) running in the global zone.
884 The \fBswap\fR property is the preferred way to set the \fBzone.max-swap\fR
885 rctl. The \fBlocked\fR property is the preferred way to set the
886 \fBzone.max-locked-memory\fR rctl.
892 \fB\fBcapped-cpu\fR: ncpus\fR
896 Sets a limit on the amount of CPU time that can be used by a zone. The unit
897 used translates to the percentage of a single CPU that can be used by all user
898 threads in a zone, expressed as a fraction (for example, \fB\&.75\fR) or a
899 mixed number (whole number and fraction, for example, \fB1.25\fR). An
900 \fBncpu\fR value of \fB1\fR means 100% of a CPU, a value of \fB1.25\fR means
901 125%, \fB\&.75\fR mean 75%, and so forth. When projects within a capped zone
902 have their own caps, the minimum value takes precedence.
904 The \fBcapped-cpu\fR property is an alias for \fBzone.cpu-cap\fR resource
905 control and is related to the \fBzone.cpu-cap\fR resource control. See
906 \fBresource_controls\fR(5).
912 \fB\fBsecurity-flags\fR: lower, default, upper\fR
916 Set the process security flags associated with the zone. The \fBlower\fR and
917 \fBupper\fR fields set the limits, the \fBdefault\fR field is set of flags all
918 zone processes inherit.
924 \fB\fBadmin\fR: user, auths\fR
928 Delegate zone administration to the named user. Valid values for \fBauths\fR
929 are \fBlogin\fR, \fBmanage\fR, and \fBclonefrom\fR. The \fBlogin\fR
930 authorization enables the user to use \fBzlogin\fR(1) to log in to the zone,
931 being prompted for authentication (but not to access the zone console). The
932 \fBmanage\fR authorization enables the user to install, update, boot or halt
933 the zone, to log in using \fBzlogin\fR(1) without authentication, and to access
934 the zone console. The \fBclonefrom\fR authorization allows the user to install
935 a new zone using this zone as a clone source.
941 \fBglobal: \fBfs-allowed\fR\fR
945 A comma-separated list of additional filesystems that may be mounted within
946 the zone; for example "ufs,pcfs". By default, only hsfs(7fs) and network
947 filesystems can be mounted. If the first entry in the list is "-" then
948 that disables all of the default filesystems. If any filesystems are listed
949 after "-" then only those filesystems can be mounted.
951 This property does not apply to filesystems mounted into the zone via "add fs"
954 WARNING: allowing filesystem mounts other than the default may allow the zone
955 administrator to compromise the system with a malicious filesystem image, and
961 The following table summarizes resources, property-names, and types:
965 resource property-name type
966 (global) zonename simple
967 (global) zonepath simple
968 (global) autoboot simple
969 (global) bootargs simple
971 (global) limitpriv simple
972 (global) brand simple
973 (global) ip-type simple
974 (global) hostid simple
975 (global) cpu-shares simple
976 (global) max-lwps simple
977 (global) max-msg-ids simple
978 (global) max-sem-ids simple
979 (global) max-shm-ids simple
980 (global) max-shm-memory simple
981 (global) scheduling-class simple
986 options list of simple
991 value list of complex
996 dedicated-cpu ncpus simple or range
999 capped-memory physical simple with scale
1000 swap simple with scale
1001 locked simple with scale
1003 capped-cpu ncpus simple
1004 security-flags lower simple
1015 To further specify things, the breakdown of the complex property "value" of the
1016 "rctl" resource type, it consists of three name/value pairs, the names being
1017 "priv", "limit" and "action", each of which takes a simple value. The "name"
1018 property of an "attr" resource is syntactically restricted in a fashion similar
1019 but not identical to zone names: it must begin with an alphanumeric, and can
1020 contain alphanumerics plus the hyphen (\fB-\fR), underscore (\fB_\fR), and dot
1021 (\fB\&.\fR) characters. Attribute names beginning with "zone" are reserved for
1022 use by the system. Finally, the "autoboot" global property must have a value of
1024 .SS "Using Kernel Statistics to Monitor CPU Caps"
1026 Using the kernel statistics (\fBkstat\fR(3KSTAT)) module \fBcaps\fR, the system
1027 maintains information for all capped projects and zones. You can access this
1028 information by reading kernel statistics (\fBkstat\fR(3KSTAT)), specifying
1029 \fBcaps\fR as the \fBkstat\fR module name. The following command displays
1030 kernel statistics for all active CPU caps:
1034 # \fBkstat caps::'/cpucaps/'\fR
1041 A \fBkstat\fR(8) command running in a zone displays only CPU caps relevant for
1042 that zone and for projects in that zone. See \fBEXAMPLES\fR.
1045 The following are cap-related arguments for use with \fBkstat\fR(8):
1053 The \fBkstat\fR module.
1059 \fB\fBproject_caps\fR or \fBzone_caps\fR\fR
1063 \fBkstat\fR class, for use with the \fBkstat\fR \fB-c\fR option.
1069 \fB\fBcpucaps_project_\fR\fIid\fR or \fBcpucaps_zone_\fR\fIid\fR\fR
1073 \fBkstat\fR name, for use with the \fBkstat\fR \fB-n\fR option. \fIid\fR is the
1074 project or zone identifier.
1079 The following fields are displayed in response to a \fBkstat\fR(8) command
1080 requesting statistics for all CPU caps.
1088 In this usage of \fBkstat\fR, this field will have the value \fBcaps\fR.
1098 As described above, \fBcpucaps_project_\fR\fIid\fR or
1099 \fBcpucaps_zone_\fR\fIid\fR
1105 \fB\fBabove_sec\fR\fR
1109 Total time, in seconds, spent above the cap.
1115 \fB\fBbelow_sec\fR\fR
1119 Total time, in seconds, spent below the cap.
1125 \fB\fBmaxusage\fR\fR
1129 Maximum observed CPU usage.
1139 Number of threads on cap wait queue.
1149 Current aggregated CPU usage for all threads belonging to a capped project or
1150 zone, in terms of a percentage of a single CPU.
1160 The cap value, in terms of a percentage of a single CPU.
1166 \fB\fBzonename\fR\fR
1170 Name of the zone for which statistics are displayed.
1175 See \fBEXAMPLES\fR for sample output from a \fBkstat\fR command.
1178 The following options are supported:
1182 \fB\fB-f\fR \fIcommand_file\fR\fR
1186 Specify the name of \fBzonecfg\fR command file. \fIcommand_file\fR is a text
1187 file of \fBzonecfg\fR subcommands, one per line.
1193 \fB\fB-z\fR \fIzonename\fR\fR
1197 Specify the name of a zone. Zone names are case sensitive. Zone names must
1198 begin with an alphanumeric character and can contain alphanumeric characters,
1199 the underscore (\fB_\fR) the hyphen (\fB-\fR), and the dot (\fB\&.\fR). The
1200 name \fBglobal\fR and all names beginning with \fBSUNW\fR are reserved and
1206 You can use the \fBadd\fR and \fBselect\fR subcommands to select a specific
1207 resource, at which point the scope changes to that resource. The \fBend\fR and
1208 \fBcancel\fR subcommands are used to complete the resource specification, at
1209 which time the scope is reverted back to global. Certain subcommands, such as
1210 \fBadd\fR, \fBremove\fR and \fBset\fR, have different semantics in each scope.
1213 \fBzonecfg\fR supports a semicolon-separated list of subcommands. For example:
1217 # \fBzonecfg -z myzone "add net; set physical=myvnic; end"\fR
1224 Subcommands which can result in destructive actions or loss of work have an
1225 \fB-F\fR option to force the action. If input is from a terminal device, the
1226 user is prompted when appropriate if such a command is given without the
1227 \fB-F\fR option otherwise, if such a command is given without the \fB-F\fR
1228 option, the action is disallowed, with a diagnostic message written to standard
1232 The following subcommands are supported:
1236 \fB\fBadd\fR \fIresource-type\fR (global scope)\fR
1240 \fB\fBadd\fR \fIproperty-name property-value\fR (resource scope)\fR
1244 In the global scope, begin the specification for a given resource type. The
1245 scope is changed to that resource type.
1247 In the resource scope, add a property of the given name with the given value.
1248 The syntax for property values varies with different property types. In
1249 general, it is a simple value or a list of simple values enclosed in square
1250 brackets, separated by commas (\fB[foo,bar,baz]\fR). See \fBPROPERTIES\fR.
1260 End the resource specification and reset scope to global. Abandons any
1261 partially specified resources. \fBcancel\fR is only applicable in the resource
1268 \fB\fBclear\fR \fIproperty-name\fR\fR
1272 Clear the value for the property.
1282 Commit the current configuration from memory to stable storage. The
1283 configuration must be committed to be used by \fBzoneadm\fR. Until the
1284 in-memory configuration is committed, you can remove changes with the
1285 \fBrevert\fR subcommand. The \fBcommit\fR operation is attempted automatically
1286 upon completion of a \fBzonecfg\fR session. Since a configuration must be
1287 correct to be committed, this operation automatically does a verify.
1293 \fB\fBcreate [\fR\fB-F\fR\fB] [\fR \fB-a\fR \fIpath\fR |\fB-b\fR \fB|\fR
1294 \fB-t\fR \fItemplate\fR\fB]\fR\fR
1298 Create an in-memory configuration for the specified zone. Use \fBcreate\fR to
1299 begin to configure a new zone. See \fBcommit\fR for saving this to stable
1302 If you are overwriting an existing configuration, specify the \fB-F\fR option
1303 to force the action. Specify the \fB-t\fR \fItemplate\fR option to create a
1304 configuration identical to \fItemplate\fR, where \fItemplate\fR is the name of
1307 Use the \fB-a\fR \fIpath\fR option to facilitate configuring a detached zone on
1308 a new host. The \fIpath\fR parameter is the zonepath location of a detached
1309 zone that has been moved on to this new host. Once the detached zone is
1310 configured, it should be installed using the "\fBzoneadm attach\fR" command
1311 (see \fBzoneadm\fR(8)). All validation of the new zone happens during the
1312 \fBattach\fR process, not during zone configuration.
1314 Use the \fB-b\fR option to create a blank configuration. Without arguments,
1315 \fBcreate\fR applies the Sun default settings.
1321 \fB\fBdelete [\fR\fB-F\fR\fB]\fR\fR
1325 Delete the specified configuration from memory and stable storage. This action
1326 is instantaneous, no commit is necessary. A deleted configuration cannot be
1329 Specify the \fB-F\fR option to force the action.
1339 End the resource specification. This subcommand is only applicable in the
1340 resource scope. \fBzonecfg\fR checks to make sure the current resource is
1341 completely specified. If so, it is added to the in-memory configuration (see
1342 \fBcommit\fR for saving this to stable storage) and the scope reverts to
1343 global. If the specification is incomplete, it issues an appropriate error
1350 \fB\fBexport [\fR\fB-f\fR \fIoutput-file\fR\fB]\fR\fR
1354 Print configuration to standard output. Use the \fB-f\fR option to print the
1355 configuration to \fIoutput-file\fR. This option produces output in a form
1356 suitable for use in a command file.
1362 \fB\fBhelp [usage] [\fIsubcommand\fR] [syntax] [\fR\fIcommand-name\fR\fB]\fR\fR
1366 Print general help or help about given topic.
1372 \fB\fBinfo zonename | zonepath | autoboot | brand | pool | limitpriv\fR\fR
1376 \fB\fBinfo [\fR\fIresource-type\fR
1377 \fB[\fR\fIproperty-name\fR\fB=\fR\fIproperty-value\fR\fB]*]\fR\fR
1381 Display information about the current configuration. If \fIresource-type\fR is
1382 specified, displays only information about resources of the relevant type. If
1383 any \fIproperty-name\fR value pairs are specified, displays only information
1384 about resources meeting the given criteria. In the resource scope, any
1385 arguments are ignored, and \fBinfo\fR displays information about the resource
1386 which is currently being added or modified.
1392 \fB\fBremove\fR \fIresource-type\fR\fB{\fR\fIproperty-name\fR\fB=\fR\fIproperty
1393 -value\fR\fB}\fR(global scope)\fR
1397 In the global scope, removes the specified resource. The \fB[]\fR syntax means
1398 0 or more of whatever is inside the square braces. If you want only to remove a
1399 single instance of the resource, you must specify enough property name-value
1400 pairs for the resource to be uniquely identified. If no property name-value
1401 pairs are specified, all instances will be removed. If there is more than one
1402 pair is specified, a confirmation is required, unless you use the \fB-F\fR
1409 \fB\fBselect\fR \fIresource-type\fR
1410 \fB{\fR\fIproperty-name\fR\fB=\fR\fIproperty-value\fR\fB}\fR\fR
1414 Select the resource of the given type which matches the given
1415 \fIproperty-name\fR \fIproperty-value\fR pair criteria, for modification. This
1416 subcommand is applicable only in the global scope. The scope is changed to that
1417 resource type. The \fB{}\fR syntax means 1 or more of whatever is inside the
1418 curly braces. You must specify enough \fIproperty -name property-value\fR pairs
1419 for the resource to be uniquely identified.
1425 \fB\fBset\fR \fIproperty-name\fR\fB=\fR\fIproperty\fR\fB-\fR\fIvalue\fR\fR
1429 Set a given property name to the given value. Some properties (for example,
1430 \fBzonename\fR and \fBzonepath\fR) are global while others are
1431 resource-specific. This subcommand is applicable in both the global and
1442 Verify the current configuration for correctness:
1447 All resources have all of their required properties specified.
1453 A \fBzonepath\fR is specified.
1460 \fB\fBrevert\fR \fB[\fR\fB-F\fR\fB]\fR\fR
1464 Revert the configuration back to the last committed state. The \fB-F\fR option
1465 can be used to force the action.
1471 \fB\fBexit [\fR\fB-F\fR\fB]\fR\fR
1475 Exit the \fBzonecfg\fR session. A commit is automatically attempted if needed.
1476 You can also use an \fBEOF\fR character to exit \fBzonecfg\fR. The \fB-F\fR
1477 option can be used to force the action.
1482 \fBExample 1 \fRCreating the Environment for a New Zone
1485 In the following example, \fBzonecfg\fR creates the environment for a new zone.
1486 \fB/usr/local\fR is loopback mounted from the global zone into
1487 \fB/opt/local\fR. \fB/opt/sfw\fR is loopback mounted from the global zone,
1488 three logical network interfaces are added, and a limit on the number of
1489 fair-share scheduler (FSS) CPU shares for a zone is set using the \fBrctl\fR
1490 resource type. The example also shows how to select a given resource for
1496 example# \fBzonecfg -z myzone3\fR
1497 my-zone3: No such zone configured
1498 Use 'create' to begin configuring a new zone.
1499 zonecfg:myzone3> \fBcreate\fR
1500 zonecfg:myzone3> \fBset zonepath=/export/home/my-zone3\fR
1501 zonecfg:myzone3> \fBset autoboot=true\fR
1502 zonecfg:myzone3> \fBadd fs\fR
1503 zonecfg:myzone3:fs> \fBset dir=/usr/local\fR
1504 zonecfg:myzone3:fs> \fBset special=/opt/local\fR
1505 zonecfg:myzone3:fs> \fBset type=lofs\fR
1506 zonecfg:myzone3:fs> \fBadd options [ro,nodevices]\fR
1507 zonecfg:myzone3:fs> \fBend\fR
1508 zonecfg:myzone3> \fBadd fs\fR
1509 zonecfg:myzone3:fs> \fBset dir=/mnt\fR
1510 zonecfg:myzone3:fs> \fBset special=/dev/dsk/c0t0d0s7\fR
1511 zonecfg:myzone3:fs> \fBset raw=/dev/rdsk/c0t0d0s7\fR
1512 zonecfg:myzone3:fs> \fBset type=ufs\fR
1513 zonecfg:myzone3:fs> \fBend\fR
1514 zonecfg:myzone3> \fBadd net\fR
1515 zonecfg:myzone3:net> \fBset address=192.168.0.1/24\fR
1516 zonecfg:myzone3:net> \fBset physical=eri0\fR
1517 zonecfg:myzone3:net> \fBend\fR
1518 zonecfg:myzone3> \fBadd net\fR
1519 zonecfg:myzone3:net> \fBset address=192.168.1.2/24\fR
1520 zonecfg:myzone3:net> \fBset physical=eri0\fR
1521 zonecfg:myzone3:net> \fBend\fR
1522 zonecfg:myzone3> \fBadd net\fR
1523 zonecfg:myzone3:net> \fBset address=192.168.2.3/24\fR
1524 zonecfg:myzone3:net> \fBset physical=eri0\fR
1525 zonecfg:myzone3:net> \fBend\fR
1526 zonecfg:my-zone3> \fBset cpu-shares=5\fR
1527 zonecfg:my-zone3> \fBadd capped-memory\fR
1528 zonecfg:my-zone3:capped-memory> \fBset physical=50m\fR
1529 zonecfg:my-zone3:capped-memory> \fBset swap=100m\fR
1530 zonecfg:my-zone3:capped-memory> \fBend\fR
1531 zonecfg:myzone3> \fBexit\fR
1537 \fBExample 2 \fRCreating a Non-Native Zone
1540 The following example creates a new Linux zone:
1545 example# \fBzonecfg -z lxzone\fR
1546 lxzone: No such zone configured
1547 Use 'create' to begin configuring a new zone
1548 zonecfg:lxzone> \fBcreate -t SUNWlx\fR
1549 zonecfg:lxzone> \fBset zonepath=/export/zones/lxzone\fR
1550 zonecfg:lxzone> \fBset autoboot=true\fR
1551 zonecfg:lxzone> \fBexit\fR
1557 \fBExample 3 \fRCreating an Exclusive-IP Zone
1560 The following example creates a zone that is granted exclusive access to
1561 \fBbge1\fR and \fBbge33000\fR and that is isolated at the IP layer from the
1562 other zones configured on the system.
1566 The IP addresses and routing should be configured inside the new zone using
1567 the normal networking administration tools such as \fBipadm\fR(8).
1572 example# \fBzonecfg -z excl\fR
1573 excl: No such zone configured
1574 Use 'create' to begin configuring a new zone
1575 zonecfg:excl> \fBcreate\fR
1576 zonecfg:excl> \fBset zonepath=/export/zones/excl\fR
1577 zonecfg:excl> \fBset ip-type=exclusive\fR
1578 zonecfg:excl> \fBadd net\fR
1579 zonecfg:excl:net> \fBset physical=bge1\fR
1580 zonecfg:excl:net> \fBend\fR
1581 zonecfg:excl> \fBadd net\fR
1582 zonecfg:excl:net> \fBset physical=bge33000\fR
1583 zonecfg:excl:net> \fBend\fR
1584 zonecfg:excl> \fBexit\fR
1590 \fBExample 4 \fRAssociating a Zone with a Resource Pool
1593 The following example shows how to associate an existing zone with an existing
1599 example# \fBzonecfg -z myzone\fR
1600 zonecfg:myzone> \fBset pool=mypool\fR
1601 zonecfg:myzone> \fBexit\fR
1608 For more information about resource pools, see \fBpooladm\fR(8) and
1612 \fBExample 5 \fRChanging the Name of a Zone
1615 The following example shows how to change the name of an existing zone:
1620 example# \fBzonecfg -z myzone\fR
1621 zonecfg:myzone> \fBset zonename=myzone2\fR
1622 zonecfg:myzone2> \fBexit\fR
1628 \fBExample 6 \fRChanging the Privilege Set of a Zone
1631 The following example shows how to change the set of privileges an existing
1632 zone's processes will be limited to the next time the zone is booted. In this
1633 particular case, the privilege set will be the standard safe set of privileges
1634 a zone normally has along with the privilege to change the system date and
1640 example# \fBzonecfg -z myzone\fR
1641 zonecfg:myzone> \fBset limitpriv="default,sys_time"\fR
1642 zonecfg:myzone2> \fBexit\fR
1648 \fBExample 7 \fRSetting the \fBzone.cpu-shares\fR Property for the Global Zone
1651 The following command sets the \fBzone.cpu-shares\fR property for the global
1657 example# \fBzonecfg -z global\fR
1658 zonecfg:global> \fBset cpu-shares=5\fR
1659 zonecfg:global> \fBexit\fR
1665 \fBExample 8 \fRUsing Pattern Matching
1668 The following commands illustrate \fBzonecfg\fR support for pattern matching.
1669 In the zone \fBflexlm\fR, enter:
1674 zonecfg:flexlm> \fBadd device\fR
1675 zonecfg:flexlm:device> \fBset match="/dev/cua/a00[2-5]"\fR
1676 zonecfg:flexlm:device> \fBend\fR
1683 In the global zone, enter:
1688 global# \fBls /dev/cua\fR
1689 a a000 a001 a002 a003 a004 a005 a006 a007 b
1696 In the zone \fBflexlm\fR, enter:
1701 flexlm# \fBls /dev/cua\fR
1708 \fBExample 9 \fRSetting a Cap for a Zone to Three CPUs
1711 The following sequence uses the \fBzonecfg\fR command to set the CPU cap for a
1717 zonecfg:myzone> \fBadd capped-cpu\fR
1718 zonecfg:myzone>capped-cpu> \fBset ncpus=3\fR
1719 zonecfg:myzone>capped-cpu>capped-cpu> \fBend\fR
1726 The preceding sequence, which uses the capped-cpu property, is equivalent to
1727 the following sequence, which makes use of the \fBzone.cpu-cap\fR resource
1733 zonecfg:myzone> \fBadd rctl\fR
1734 zonecfg:myzone:rctl> \fBset name=zone.cpu-cap\fR
1735 zonecfg:myzone:rctl> \fBadd value (priv=privileged,limit=300,action=none)\fR
1736 zonecfg:myzone:rctl> \fBend\fR
1742 \fBExample 10 \fRUsing \fBkstat\fR to Monitor CPU Caps
1745 The following command displays information about all CPU caps.
1750 # \fBkstat -n /cpucaps/\fR
1751 module: caps instance: 0
1752 name: cpucaps_project_0 class: project_caps
1755 crtime 821.048183159
1758 snaptime 235885.637253027
1760 value 18446743151372347932
1763 module: caps instance: 0
1764 name: cpucaps_project_1 class: project_caps
1767 crtime 225339.192787265
1770 snaptime 235885.637591677
1772 value 18446743151372347932
1775 module: caps instance: 0
1776 name: cpucaps_project_201 class: project_caps
1782 snaptime 235885.637789687
1787 module: caps instance: 0
1788 name: cpucaps_project_202 class: project_caps
1794 snaptime 235885.637967512
1799 module: caps instance: 0
1800 name: cpucaps_project_203 class: project_caps
1803 crtime 852.104401481
1806 snaptime 235885.638144304
1811 module: caps instance: 0
1812 name: cpucaps_project_86710 class: project_caps
1815 crtime 698.441717859
1818 snaptime 235885.638319871
1823 module: caps instance: 0
1824 name: cpucaps_zone_0 class: zone_caps
1827 crtime 821.048177123
1830 snaptime 235885.638497731
1835 module: caps instance: 1
1836 name: cpucaps_project_0 class: project_caps
1839 crtime 225360.256448422
1842 snaptime 235885.638714404
1844 value 18446743151372347932
1847 module: caps instance: 1
1848 name: cpucaps_zone_1 class: zone_caps
1851 crtime 225360.256440278
1854 snaptime 235885.638896443
1863 \fBExample 11 \fRDisplaying CPU Caps for a Specific Zone or Project
1866 Using the \fBkstat\fR \fB-c\fR and \fB-i\fR options, you can display CPU caps
1867 for a specific zone or project, as below. The first command produces a display
1868 for a specific project, the second for the same project within zone 1.
1873 # \fBkstat -c project_caps\fR
1875 # \fBkstat -c project_caps -i 1\fR
1882 The following exit values are returned:
1890 Successful completion.
1915 See \fBattributes\fR(5) for descriptions of the following attributes:
1923 ATTRIBUTE TYPE ATTRIBUTE VALUE
1925 Interface Stability Volatile
1930 \fBppriv\fR(1), \fBprctl\fR(1), \fBzlogin\fR(1), \fBkstat\fR(8),
1931 \fBmount\fR(8), \fBpooladm\fR(8), \fBpoolcfg\fR(8), \fBpoold\fR(8),
1932 \fBrcapd\fR(8), \fBrctladm\fR(8), \fBsvcadm\fR(8), \fBipadm\fR(8),
1933 \fBzfs\fR(8), \fBzoneadm\fR(8), \fBpriv_str_to_set\fR(3C),
1934 \fBkstat\fR(3KSTAT), \fBvfstab\fR(4), \fBattributes\fR(5), \fBbrands\fR(5),
1935 \fBfnmatch\fR(5), \fBlx\fR(5), \fBprivileges\fR(5), \fBresource_controls\fR(5),
1936 \fBsecurity-flags\fR(5), \fBzones\fR(5)
1939 \fISystem Administration Guide: Solaris Containers-Resource Management, and
1943 All character data used by \fBzonecfg\fR must be in US-ASCII encoding.