Before you can install a non-global zone and use it on your system, the zone must be configured. The zonecfg command is used to create and verify the configuration.
The check performed by zonecfg for a given configuration verifies the following:
Any required properties for a resource are specified.
The configuration is free from conflicts.
For example, if a zpool resource type with a given storage property already exists, there will be a conflict on the name of the zpool. An invalid-syntax error will be displayed. If you have an anet resource, the zone is an exclusive-IP type and cannot be a shared-IP zone. Additionally, the zonecfg command displays a warning if an aliased dataset has a potential conflict with devices.
No invalid parameter is specified.
If an invalid parameter is specified in the zonecfg command for a zone, the zone is not configured.
The zonecfg command can be used in interactive mode, in command-line mode, or in command-file mode. The following operations can be performed using this command:
Create or delete (destroy) a zone configuration
Add resources to a particular configuration
Set properties for resources added to a configuration
Remove resources from a particular configuration
Query or verify a configuration
Commit to a configuration
Revert to a previous configuration
Rename a zone
Exit from a zonecfg session
The zonecfg prompt is of the following form:
zonecfg:zonename>
When you are configuring a specific resource type, such as a file system, that resource type name is also included in the prompt:
zonecfg:zonename:fs>
For more information about the zonecfg command, see the zonecfg(8) man page.
The zonecfg command can also be used to persistently specify resources for the global zone. For example, you can use the command to configure the global zone to use a dedicated CPU by setting a value for the dedicated-cpu resource type.
For more information, including procedures that show how to use the zonecfg command, see Chapter 2, Setting Up a Non-Global Zone in Creating and Using Oracle Solaris Zones.
You can use different zonecfg templates to get a specific brand, to get an empty configuration, or to create a zone configuration similar to another zone that is already configured.
Use the zonecfg template property to define whether, and how, properties are changed in the following cases:
When new resource instances are added to a configuration.
During configuration cloning, when some properties must have unique values. Tokens in the template property can provide these unique values.
You can configure a solaris-kz branded zone by using the following templates:
SYSsolaris-kz template – The default zone template configures a zone with 4 virtual CPUs and 4GB of memory.
SYSsolaris-kz-minimal template – Configures a minimal kernel zone with 1 virtual CPU and 2GB of memory.
The zone remote administration daemon (RAD) module provides a systemic way to express, enforce, or implement changes by using the property templates. For more information, see the zonemgr-1(3rad) man page.
|
This example demonstrates how the %{zonename} token enables the zonepath to be automatically updated when the zone name is changed.
zonecfg:ngz> info zonepath zonepath.template: /system/zones/%{zonename} zonepath: /system/zones/ngz zonecfg:ngz> set zonename=new-zone zonecfg:new-zone> info zonepath zonepath.template: /system/zones/%{zonename} zonepath: /system/zones/new-zoneExample 2 Token Used for the storage Property of the device Resource Type for a Kernel Zone
device 0: storage.template: dev:/dev/zvol/dsk/%{global-rootzpool}/VARSHARE/zones/%{zonename}/disk%{id} storage: dev:/dev/zvol/dsk/rpool/VARSHARE/zones/kernel-zone1/disk0 id: 0 bootpri: 0
The Tecla command-line editing library is available to the zonecfg command. The library provides a mechanism for command-line history and editing support.
For more information, see the tecla(7) man page.