Clone Zone operation
The Clone Zone operation is used to clone a Zone with the same configuration as the specified Zone. This operation creates a new Zone on the Solaris computer by copying the Zone information from the source Zone path to the target Zone path.
The following figure shows an <items> XML template for the Clone Zone operation:
<items> XML template for the Clone Zone operation
<item>
<parameters>
<new-zone-name></new-zone-name>
<new-zone-path></new-zone-path>
</parameters>
</item>
</items>
The following table describes the elements for the adapter request:
Adapter request elements for the Clone Zone operation
Element | Definition | Required |
---|---|---|
<operation-type> | Defines the type of operation: Configure_Zone | Yes |
<operation-name> | Defines the name of operation: Clone_Zone | Yes |
<zone-name> | Specifies the name of the source Zone that you want to clone from | Yes |
<new-zone-name> | Specifies the name for the newly cloned Zone | Yes |
<new-zone-path> | Specifies the zone path for the newly cloned Zone | Yes |
<host> | Specifies the host name of the Solaris 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 complete on the target server | No |
<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 the sample adapter request for the Clone Zone operation:
Sample adapter request for the Clone Zone operation
<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>Clone_Zone</operation-name>
<zone-name>newzone</zone-name>
<parameters>
<new-zone-name>Clonedzone1</new-zone-name>
<new-zone-path>/export/zones/clonedzone</new-zone-path>
</parameters>
</solaris-zones-request>
The following figure shows the response for the sample adapter request:
Sample adapter response for the Clone Zone operation
<metadata>
<status>success</status>
</metadata>
<target-output host="vm-sol-abc">
<metadata>
<os-id>SunOS</os-id>
<os-version>5.10</os-version>
<status>success</status>
</metadata>
<operation-output>
<metadata>
<command>zoneadm -z "newzone" halt; zonecfg -z "newzone"
export -f master1273057592734; zonecfg -z "clonedzone1" -f
master1273057592734; zonecfg -z "clonedzone1" "set
zonepath="/export/zones/clonedzone""; zoneadm -z "clonedzone1"
clone newzone; rm -f master1273057592734</command>
<line-count>6</line-count>
<execution-milliseconds>1047</execution-milliseconds>
<exit-code>0</exit-code>
<status>success</status>
</metadata>
<output>
<line index="1">Operation Clone_Zone executed
successfully!!</line>
</output>
</operation-output>
</target-output>
</solaris-zones-response>