Create Zone operation for the Solaris Zones adapter


The Create Zone operation enables you to create a Zone by specifying only the required parameters for the Zone.

The following figure shows an <items> XML template for the Create Zone operation:

<items> XML template for the Create Zone operation

<items>
<item>
 <parameters>
   <zone-path</zone-path>
 </parameters>
</item>
</items>

The following table describes the elements for the adapter request:

Adapter request elements for the Create Zone operation

Element

Definition

Required

<operation-type>

Defines the type of operation: Configure_Zone

Yes

<operation-name>

Defines the name of operation: Create_Zone

Yes

<zone-name>

Specifies the name of the Zone that you want to create

Yes

<zone-path>

Specifies the absolute path in which the zone files are installed
You must have access permission for the specified Zone path.

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
Default value: 22

No

<operation-timeout-secs>

Specifies the time, in seconds, to wait for the operation to complete on the target server
If the operation is not successful within this interval, the adapter returns an error message.
Default value: 300 seconds

No

<user-name>

Specifies the user name for the Solaris computer
If no user name is specified, the request is executed with the user name specified in the adapter configuration.

No

<password>

Specifies the password corresponding to the user name

Conditional
Required if you specify the <user-name> element


Note

If the specified zone path exists before you create the Zone, the access modifiers must be only for the superuser.

The following figure shows the sample adapter request for the Create Zone operation:

Sample adapter request for the Create Zone operation

<solaris-zones-request>
   <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</operation-name>
   <operation-timeout-secs>400</operation-timeout-secs>
   <zone-name>testzone1</zone-name>
   <parameters>
          <zone-path>/export/test/zones</zone-path>
   </parameters>
</solaris-zones-request>


Note

You need to specify the elements in the <target> block of the adapter request only if you want to override the elements specified in the adapter configuration.

The following figure shows the response for the sample adapter request:

Sample adapter response for the Create Zone operation

<solaris-zones-response>
 <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>zonecfg -z testzone1 "create;set zonepath=/export/test/zones/"</command>
      <line-count>1</line-count>
      <execution-milliseconds>62</execution-milliseconds>
      <exit-code>0</exit-code>
      <status>success</status>
     </metadata>
     <output>
       <line index="1">Operation Create_Zone executed successfully!!</line>
     </output>
   </operation-output>
 </target-output>
</solaris-zones-response>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*