Update CPU Configuration operation


The Update CPU Configuration operation modifies the CPU configuration of the specified virtual machine. This operation can modify the CPU configuration of a virtual machine, even when the virtual machine is in the Power On or Suspended state.

If the <status> response element contains success, the <Task> response element contains the ID of the queued task, which you can use to obtain the task status.

The following table describes the elements for this request.

Adapter request elements for the Update CPU Configuration operation

Element

Definition

Required

<operation-type>

Defines the type of the operation: Configure_Vm

Yes

<operation-name>

Defines the name of the operation: Update_CPU_Configuration

Yes

<soap-url>

Specifies the URL for the remote SOAP service running on the VMware VirtualCenter

If the <soap-url> element is not specified, the request uses the VirtualCenter Server details specified in the adapter configuration.

Default format for HTTPS: https://<hostName>:<port>/sdk/vim

Default format for HTTP: http://<hostName>:<port>/sdk/vim

Note

If you want to use an HTTP value, you might need to change the configuration of the VMware Infrastructure application.

No

<transport>

Specifies the transport protocol for the message

If the <transport> element is not provided, the request uses the VirtualCenter Server details specified in the adapter configuration.

Valid values: https-rpc (default), http-rpc

Note

If the value of the <transport> element is https-rpc, you must install the security certificate for the VMware Virtual Center to the keystore of the peer on which the adapter is enabled.

No

<user-name>

Specifies the user name that is used for HTTP basic authentication on the VMware Virtual Center

If no user name is specified, the request is executed with the user name that is specified in the configuration.

No

<password>

Specifies the password corresponding to <user-name>

Conditional; required if <user-name> is specified

<parameters>

Contains the elements required to execute the operation

Yes

<virtual-machine>

Contains the name of the virtual machine for which you to update the CPU configuration

Yes

<num-cpus>

The number of virtual processors in a virtual machine

The number of virtual CPUs must be a multiple of the number of Cores per Socket whether specified in the request or set previously

No

<num-cores-per-socket>

Specifies the number of cores among which you distribute virtual CPUs in the virtual machine

Note

This element is applicable only if you are using VMware vSphere 5.0 or later.


Valid value: Any integer > 0
 The number of cores per socket cannot be greater than the number of virtual CPUs in the VM.

No

<cpu-hot-add-enabled>

Indicates whether virtual processors can be added to the virtual machine while it is running

You can set this attribute only when the virtual machine is powered off.

If you do not specify a value, there is no default, and the status of <cpu-hot-add-enabled> remains unaltered. In other words, if <cpu-hot-add-enabled> was enabled before the update, it would continue to be enabled. If <cpu-hot-add-enabled> was disabled before the update, it would continue to be disabled.

Valid values: true, false

No

<cpu-hot-remove-enabled>

Indicates whether virtual processors can be removed from the virtual machine while it is running

You can set this attribute only when the virtual machine is powered off.

If you do not specify a value, there is no default, and the status of <cpu-hot-remove-enabled> remains unaltered. In other words, if <cpu-hot-remove-enabled> was enabled before the update, it would continue to be enabled. If <cpu-hot-remove-enabled> was disabled before the update, it would continue to be disabled.

Valid values: true, false

No

<cpu-allocation>

Specifies the resource limits for the CPU

For more information about the child elements, see cpu-allocation.

No

The following code sample shows a sample adapter request for the Update CPU Configuration operation.

Sample adapter request for the Update CPU Configuration operation

<vmware-infrastructure-request>
    <operation-type>Configure_Vm</operation-type>
    <operation-name>Update_CPU_Configuration</operation-name>
   <soap-url></soap-url>
   <transport></transport>
    <user-name></user-name>
    <password></password>
    <parameters>
        <virtual-machine>winSix</virtual-machine>
            <spec>
                <num-cpus>4</num-cpus>
               <num-cores-per-socket>2</num-cores-per-socket>
               <cpu-hot-add-enabled>true</cpu-hot-add-enabled>
               <cpu-hot-remove-enabled>true</cpu-hot-remove-enabled>
                <cpu-allocation>
                    <reservation>256</reservation>
                    <limit>256</limit>
                    <shares>
                        <shares>512</shares>
                        <level>custom</level>
                        </shares>
                </cpu-allocation>
            </spec>
    </parameters>
</vmware-infrastructure-request>

The following code sample shows the response for the sample Update CPU Configuration operation.

Sample adapter response for the Update CPU Configuration operation

<vmware-infrastructure-response>
    <metadata>
       <status>success</status>
   </metadata>
   <UpdateCPUConfigurationResponse>
      <Task>task-727</Task>
   </UpdateCPUConfigurationResponse>
</vmware-infrastructure-response>

The following table describes the response elements.

Adapter response element for the Update CPU Configuration operation

Element

Definition

<Task>

Specifies the task ID of the submitted task

Use the task ID to obtain the status of the specified task.

For information about using the task ID to check the task status, see Request and response for the Retrieve_Task_Status operation.

 

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