Update Zone Configuration operation

The Update Zone Configuration operation enables you to modify configuration parameters for a Zone. You can use this operation to add, update, or remove a hard disk, a CD-ROM, or an ethernet adapter from a Zone.

The following figure shows the <items> XML template for the Update Zone Configuration operation:



<items> XML template for the Update Zone Configuration operation

<items>
 <item>
  <parameters>
   <remove-resources>
     <autoboot/>
     <cpu-shares></cpu-shares>
     <pool/>
     <boot-arguments/>
     <dedicated-cpu>
      <no-of-cpu></no-of-cpu>
     </dedicated-cpu>
     <privileges/>
     <scheduling-class/>
     <capped-memory>
      <physical></physical>
     </capped-memory>
      <file-systems> 
       <file-system>
          <dir></dir>
       </file-system>
      </file-systems>
      <datasets>
       <dataset>
          <name></name>
       </dataset>
      </datasets>
      <inherit-packages>
       <inherit-pkg>
          <dir></dir>
       </inherit-pkg>
      </inherit-packages>
      <ip-type/>
      <network-interfaces>
       <network-interface>
          <address></address>
       </network-interface>
      </network-interfaces>
      <devices>
       <device>
          <match></match>
       </device>
      </devices>
      <ma-sem-ids/>
      <attributes>
       <attribute>
          <name></name>
       </attribute>
      </attributes>
     </remove-resources>
     <add-resources>
       <autoboot></autoboot>
       <cpu-shares></cpu-shares>
       <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>
      <devices>
       <device>
          <match></match>
       </device>
      </devices>
      <ma-sem-ids></ma-sem-ids>
       <attributes>
        <attribute>
          <name></name>
          <type></type>
          <value></value>
        </attribute>
       </attributes>
     </add-resources>
     <update-resources>
       <zone-path></zone-path>
       <autoboot></autoboot>
       <cpu-shares></cpu-shares>       
       <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></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>
        <devices>
          <device match>
            <match></match>
          </device>
        </devices>
        <max-sem-ids></max-sem-ids>
        <attributes>
          <attribute name>
            <name></name>
            <type></type>
            <value></value>
          </attribute>
        </attributes>
      </update-resources>
    </parameters>
  <item>
</items>


The following table describes the elements for the adapter request:



Adapter request elements for the Update Zone Configuration operation

Element

Definition

Required

<operation-type>

Specifies the type of operation: Configure_Zone

Yes

<operation-name>

Specifies the operation: Update_Zone_Configuration

Yes

<zone-name>

Specifies the name of the Zone whose configuration parameters you want to update

Yes

<host>

Specifies the 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 finish 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 you specify no user name, 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 <user-name>

<add-resources>

Contains resources to add to the Zone configuration

Note

Global parameters cannot have multiple entries with a zone. Therefore, when you use the <add-resource> element, if a resource is already present within a zone, the value of the resource is updated; otherwise, its value is added to the configuration.


For information about the child elements, see Child elements for the <add-resources>, <remove-resources>, and <update-resources> elements.

No

<autoboot>

Specifies whether the Zone is booted when the associated Global Zone is booted
Valid values:

  • true = Zone booted
  • false = Zone not booted (default)

No

<cpu-shares>

Specifies the number of Fair Share Scheduler (FSS) shares to update in the specified Zone

This property is incompatible with the <dedicated-cpu> element.

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
Required if you specify the <dedicated-cpu> element

<cpu-importance>

Sets the importance for the CPU

No

<privileges>

Specifies the privileges to revise the default set of privileges

For example, to add the ability to set the system clock to the default set of privileges, you can use this element.

No

<scheduling-class>

Provides different CPU access characteristics to threads, based on algorithmic logic
Valid values:

  • Real-time scheduling class (RT)
  • Interactive scheduling class (IA)
  • Fixed-priority scheduling class (FX)
  • Timesharing scheduling class (TS)
  • Fair-share scheduling class (FSS)

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

For example, to set the
memory capacity for the Zone to 500 MB, set this element to 500m.

No

<physical>

Sets the physical memory capacity for the Zone; enables you to restrict the amount of physical memory that the Zone can use

For example, to set the physical
memory of the Zone to 500 MB, set this element to 500m.

Conditional
If you specify <capped-memory>, you must also specify <physical>, <swap>, or <locked>.

<swap>

Sets the swap memory capacity for the Zone; enables you to restrict the amount of virtual memory that the Zone can use

For example, to set the virtual memory of the Zone to 1 GB, set this element to 1g.

Conditional
If you specify <capped-memory>, you must also specify <physical>, <swap>, or <locked>.

<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

For example, to set the locked memory capacity of the Zone to 50 MB, set this element to 50m.

Conditional
If you specify the <capped-memory> element, you must also specify <physical>, <swap>, or <locked>.

<file-systems>

Contains file systems to add to the Zone

No

<file-system>

Specifies a file system to add to the Zone

Conditional
Required if you specify <file-systems>

<dir>

Sets the mount point for the file system

Conditional
Required if you specify <file-system>

<special>

Sets the special file system for the Zone

Conditional
Required if you specify the <file-system> element

<type>

Specifies the type of file system for <file-system>

Conditional
Required if you specify <file-system>

<datasets>

Contains Zettabyte File System (ZFS) datasets in the storage pool

No

<dataset>

Specifies a ZFS dataset to add to the Zone

Conditional
Required if you specify <datasets>

<name>

Specifies path for the ZFS dataset

Conditional
Required if you specify <datasets>

<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
Required if you specify <inherit-packages>

<dir>

Specifies the directory on the Global Zone to mount in the read-only mode

Conditional
Required if you specify <inherit-pkg>

<ip-type>

Sets the Internet protocol type for the Zone to Exclusive-IP
Default value: Shared-IP

No

<network-interfaces>

Contains network interfaces

No

<network-interface>

Specifies a network interface to add to the Zone

Conditional
Required if you specify <network-interfaces>

<address>

Sets the IP address for the network interface

Conditional
Required if you specify <network-interfaces>

<physical>

Sets the physical device type for the network interface

Conditional
Required if you specify <network-interfaces>

<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
Required if you specify <devices>

<match>

Sets the device match

Conditional
Required if you specify <device>

<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
Required if you specify <attributes>

<name>

Specifies the name for the attribute

Conditional
Required if you specify <attribute>

<type>

Specifies the type of the attribute

Conditional
Required if you specify <attribute>

<value>

Contains the value for the attribute

Conditional
Required if you specify <attributes>

<remove-resources>

Contains resources to remove from the Zone configuration
For information about the child elements, see Child elements for the <add-resources>, <remove-resources>, and <update-resources> elements.

No

<update-resources>

Contains one or more resources to update in the Zone configuration
For information about the child elements, see Child elements for the <add-resources>, <remove-resources>, and <update-resources> elements.

No


The following table describes the child elements of the <add-resources>, <remove-resources>, and <update-resources> elements:



Child elements for the <add-resources>, <remove-resources>, and <update-resources> elements

Element

Definition

Required

<resource>

Specifies the resource to add, remove, or update from the Zone configuration

Conditional
Required if you specify <add-resources>

<name>

Specifies the name of the resource to add, remove, or update

Conditional
Required if you specify <add-resources>

<value>

Specifies the value for the resource

Conditional
Required if you specify <add-resources>


The following figure shows a sample adapter request for the Update Zone Configuration operation for adding, updating, and deleting virtual devices:



Sample adapter request for the Update Zone Configuration operation for adding, updating, and deleting virtual devices

<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>Update_Zone_Configuration</operation-name>
    <zone-name>testzone</zone-name>
    <parameters>
      <add-resources>
        <autoboot>false</autoboot>
        <cpu-shares>80</cpu-shares>
      </add-resources>
      <update-resources>
        <cpu-shares>60</cpu-shares>
      </update-resources>
      <remove-resources>
        <cpu-shares>60</cpu-shares>
      </remove-resources>
    </parameters>
</solaris-zones-request>

Note

You must 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 Update Zone Configuration operation for adding, updating, and deleting virtual devices

<solaris-zones-response>
  <metadata>
    <status>success</status>
  </metadata>
  <target-output host="10.118.14.6">
    <metadata>
      <os-id>SunOS</os-id>
      <os-version>5.10</os-version>
      <status>success</status>
    </metadata>
    <operation-output>
      <metadata>
        <command>zonecfg -z "zone1" "set autoboot=false;
 add dedicated-cpu;set ncpus=1; set importance=8; end; add
 capped-memory;set physical=1M; set swap=51M; set locked=9; end;
set bootargs=\"-m verbose1\"; select net address=10.118.218.3;
set address=10.118.218.2; set physical=vnet0; end; "</command>
        <line-count>1</line-count>
        <execution-milliseconds>797</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
      </metadata>
      <output>
        <line index="1">Operation Update_Zone_Configuration
 executed successfully!!</line>
      </output>
    </operation-output>
  </target-output>
</solaris-zones-response>


The following figure shows a sample adapter request for adding a virtual device:



Sample adapter request for adding a virtual device

<solaris-zones-request>
    <operation-type>Configure_Zone</operation-type>
    <operation-name>Update_Zone_Configuration</operation-name>
    <operation-timeout-secs>300</operation-timeout-secs>
    <zone-name>testingzoneOneTwo</zone-name>
    <parameters>
      <add-resources>
        <autoboot>false</autoboot>
        <cpu-shares>80</cpu-shares>
      </add-resources>
      <update-resources />
      <remove-resources />
    </parameters>
  </solaris-zones-request>


The following figure shows the response for the sample adapter request for adding a virtual device:



Sample adapter response for the Update Zone Configuration operation for adding a virtual device

<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 "testingzoneOneTwo"
 "set autoboot=false; set cpu-shares=80; "</command>
        <line-count>1</line-count>
        <execution-milliseconds>1031</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
      </metadata>
      <output>
        <line index="1">Operation Update_Zone_Configuration
 executed successfully!!</line>
      </output>
    </operation-output>
  </target-output>
</solaris-zones-response>


The following figure shows a sample adapter request for updating a virtual device:



Sample adapter request for updating a virtual device

      <solaris-zones-request>
    <operation-type>Configure_Zone</operation-type>
    <operation-name>Update_Zone_Configuration</operation-name>
    <operation-timeout-secs>300</operation-timeout-secs>
    <zone-name>testingzoneOneTwo</zone-name>
    <parameters>
      <add-resources>
        <autoboot>false</autoboot>
      </add-resources>
      <update-resources>
        <cpu-shares>60</cpu-shares>
      </update-resources>
      <remove-resources />
    </parameters>
  </solaris-zones-request>


The following figure shows the response for the sample adapter request for updating a virtual device:



Sample adapter response for the Update Zone Configuration operation for updating a virtual device

<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 "testingzoneOneTwo"
 "set autoboot=false; set cpu-shares=60; "</command>
        <line-count>1</line-count>
        <execution-milliseconds>703</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
      </metadata>
      <output>
        <line index="1">Operation Update_Zone_Configuration
 executed successfully!!</line>
      </output>
    </operation-output>
  </target-output>
</solaris-zones-response>


The following figure shows a sample adapter request for deleting a virtual device:



Sample adapter request for deleting a virtual device

      <solaris-zones-request>
    <solaris-zones-request>
    <operation-type>Configure_Zone</operation-type>
    <operation-name>Update_Zone_Configuration</operation-name>
    <operation-timeout-secs>300</operation-timeout-secs>
    <zone-name>testingzoneOneTwo</zone-name>
    <parameters>
      <add-resources>
        <autoboot>false</autoboot>
      </add-resources>
      <update-resources />
      <remove-resources>
        <cpu-shares>60</cpu-shares>
      </remove-resources>
    </parameters>
  </solaris-zones-request>


The following figure shows the response for the sample adapter request for deleting a virtual device:



Sample adapter response for the Update Zone Configuration operation for deleting a virtual device

<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 "testingzoneOneTwo" "clear
  cpu-shares; set autoboot=false; "</command>
        <line-count>1</line-count>
        <execution-milliseconds>844</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
      </metadata>
      <output>
        <line index="1">Operation Update_Zone_Configuration
 executed successfully!!</line>
      </output>
    </operation-output>
  </target-output>
</solaris-zones-response>

Was this page helpful? Yes No Submitting... Thank you

Comments