Create Zone With Custom Settings operation
The Create Zone With Custom Settings operation creates a new Zone with advanced configuration options. This operation enables you to add virtual devices, such as a hard disk or an ethernet card, to a newly created Zone.
The following figure shows the <items> XML template for the Create Zone With Custom Settings operation:
<items> XML template for the Create Zone With Custom Settings operation
<item>
<parameters>
<zone-path></zone-path>
<autoboot></autoboot>
<pool></pool>
<boot-arguments></boot-arguments>
<dedicated-cpu>
<no-of-cpu></no-of-cpu>
<cpu-importance></cpu-importance>
</dedicated-cpu>
<privileges></privileges>
<scheduling-class></scheduling-class>
<capped-memory>
<physical></physical>
<swap></swap>
<locked></locked>
</capped-memory>
<file-systems>
<file-system>
<dir></dir>
<special></special>
<type></type>
</file-system>
</file-systems>
<datasets>
<dataset>
<name></name>
</dataset>
</datasets>
<inherit-packages>
<inherit-pkg>
<dir></dir>
</inherit-pkg>
</inherit-packages>
<ip-type></ip-type>
<network-interfaces>
<network-interface>
<address></address>
<physical></physical>
<default-router></default-router>
</network-interface>
</network-interfaces>
<cpu-shares></cpu-shares>
<devices>
<device>
<match></match>
</device>
</devices>
<max-sem-ids></max-sem-ids>
<attributes>
<attribute>
<name></name>
<type></type>
<value></value>
</attribute>
</attributes>
</parameters>
</item>
</items>
The following table describes the elements for the adapter request.
Adapter request elements for the Create Zone With Custom Settings operation
Element | Definition | Required |
|---|---|---|
<operation-type> | Specifies the type of operation: Configure_Zone | Yes |
<operation-name> | Specifies the operation: Create_Zone_With_Custom_Settings | Yes |
<zone-name> | Specifies the name for the Zone that you want to create | Yes |
<host> | Specifies the name of the computer hosting Solaris Zones | No |
<port> | Specifies the port on which the SSH service is running on the host computer | No |
<operation-timeout-secs> | Specifies the time, in seconds, to wait for the operation to finish on the target server | No |
<zone-path> | Specifies the path in which the Zone files are installed | Yes |
<autoboot> | Specifies whether the Zone is booted when the associated Global Zone is booted
| No |
<pool> | Specifies the configured pool name for the new Zone to bind | No |
<boot-arguments> | Specifies persistent boot arguments for the Zone | No |
<dedicated-cpu> | Specifies the number of dedicated CPUs for the Zone | No |
<no-of-cpu> | Sets the number of CPUs for the Zone | Conditional |
<cpu-importance> | Sets the importance for the CPU | No |
<cpu-shares> | Specifies the number of Fair Share Scheduler (FSS) shares to allocate to this Zone | No |
<privileges> | Specifies the privileges to revise the default set of privileges | No |
<scheduling-class> | Provides different CPU access characteristics to threads, based on algorithmic logic
| No |
<capped-memory> | Sets the memory capacity for the Zone; enables you to place a soft restriction on the amount of memory that the Zone can use | No |
<physical> | Sets the physical memory capacity for the Zone; enables you to restrict the amount of physical memory that the Zone can use | Conditional |
<swap> | Sets the swap memory capacity for the Zone; enables you to restrict the amount of virtual memory that the Zone can use | Conditional |
<locked> | Sets the locked memory capacity for the Zone; enables you to place a locked memory cap on the amount of physical memory that the Zone can use | Conditional |
<file-systems> | Contains file systems to add to the Zone | No |
<file-system> | Specifies a file system to add to the Zone | Conditional |
<dir> | Sets the mount point for the file system | Conditional |
<special> | Sets the special file system for the Zone | Conditional |
<type> | Specifies the type of file system for <file-system> | Conditional |
<datasets> | Contains Zettabyte File System (ZFS) datasets in the storage pool | No |
<dataset> | Specifies a ZFS dataset to add to the Zone | Conditional |
<name> | Specifies path for the ZFS dataset | Conditional |
<inherit-packages> | Contains file systems that are loopback mounted from the Global Zone | No |
<inherit-pkg> | Adds a shared file system that is loopback mounted from the Global Zone | Conditional |
<dir> | Specifies the directory on the Global Zone to mount in the read-only mode | Conditional |
<ip-type> | Sets the Internet protocol type for the Zone to Exclusive-IP | No |
<network-interfaces> | Contains network interfaces | No |
<network-interface> | Specifies a network interface to add to the Zone | Conditional |
<address> | Sets the IP address for the network interface | Conditional |
<physical> | Sets the physical device type for the network interface | Conditional |
<default-router> | Sets the default router for the network interface | No |
<devices> | Contains network devices | No |
<device> | Specifies a device to add to the Zone | Conditional |
<match> | Sets the device match | Conditional |
<max-sem-ids> | Sets the maximum number of semaphore IDs for the Zone | No |
<attributes> | Contains properties for the Zone | No |
<attribute> | Specifies an attribute to add for the Zone | Conditional |
<name> | Specifies the name for the attribute | Conditional |
<type> | Specifies the type of the attribute | Conditional |
<value> | Contains the value for the attribute | Conditional |
<user-name> | Specifies the user name for the Solaris computer | No |
<password> | Specifies the password corresponding to the user name | Conditional |
The following figure shows a sample adapter request for the Create Zone With Custom Settings operation, using only the required elements:
<operation-type>Configure_Zone</operation-type>
<operation-name>Create_Zone_With_Custom_Settings</operation-name>
<zone-name>Testzone</zone-name>
<parameters>
<zone-path>/export/home/zones</zone-path>
</parameters>
</solaris-zones-request>
The following figure shows a sample adapter request for the Create Zone With Custom Settings operation with the optional elements:
Sample adapter request for the Create Zone With Custom Settings operation with the optional elements
<target>
<host>vm-sol-abc<host>
<user-name>admin<user-name>
<password>adminpass</password>
<port>8888</port>
</target>
<operation-type>Configure_Zone</operation-type>
<operation-name>Create_Zone_With_Custom_Settings</operation-name>
<zone-name>testzone</zone-name>
<parameters>
<zone-path>/zone/Demozone3</zone-path>
<autoboot>true</autoboot>
<pool></pool>
<network-interfaces>
<network-interface>
<address>10.118.243.40</address>
<physical>eri0</physical>
</network-interface>
</network-interfaces>
<dedicated-cpu>
<no-of-cpu>2</no-of-cpu>
<cpu-importance>89</cpu-importance>
</dedicated-cpu>
<capped-memory>
<physical>1M</physical>
<swap>50M</swap>
<locked>10</locked>
</capped-memory>
<scheduling-class>FSS</scheduling-class>
<privileges></privileges>
<file-systems>
<file-system>
<dir>/usr/local</dir>
<special>/export/home/zones</special>
<type>lofs</type>
</file-system>
</file-systems>
<datasets>
<dataset>
<name>/zones</name>
</dataset>
</datasets>
<inherit-packages>
<inherit-pkg>
<dir>/export/home/zones</dir>
</inherit-pkg>
</inherit-packages>
<ip-type>exclusive</ip-type>
<devices>
<device>
<match></match>
</device>
</devices>
<max-sem-ids>10485200</max-sem-ids>
<attributes>
<attribute>
<name>comment</name>
<type>string</type>
<value>"This is my work zone."</value>
</attribute>
</attributes>
<operation-timeout-secs>700</operation-timeout-secs>
</parameters>
</solaris-zones-request>
The following figure shows the response for the sample Create Zone With Custom Settings operation:
Sample adapter response for the Create Zone With Custom Settings operation
<metadata>
<status>success</status>
</metadata>
<target-output host="10.128.30.62">
<metadata>
<os-id>SunOS</os-id>
<os-version>5.10</os-version>
<status>success</status>
</metadata>
<operation-output>
<metadata>
<command>echo . | zonecfg -z "Testzone" "create ; set
zonepath="/export/home/zones"; exit;"</command>
<line-count>1</line-count>
<execution-milliseconds>170</execution-milliseconds>
<exit-code>0</exit-code>
<status>success</status>
</metadata>
<output>
<line index="1">Operation Create_Zone_With_Custom_Settings
executed successfully!!</line>
</output>
</operation-output>
</target-output>
</solaris-zones-response>