Update VM Configuration operation
The Update VM Configuration operation modifies one or more configuration parameters on a virtual machine. This operation can be used to add or remove a hard disk, CD-ROM drive, or an ethernet adapter from the specified virtual machine.
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_VM_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_VM_Configuration | Yes |
<soap-url> | Specifies the URL for the remote SOAP service running on the VMware VirtualCenter | No |
<transport> | Specifies the transport protocol for the message | No |
<user-name> | Specifies the user name that is used for HTTP basic authentication on the VMware Virtual Center | 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 whose configuration details are to be updated | Yes |
<name> | Specifies the display name of the virtual machine | No |
<version> | Specifies the version string for the virtual machine | No |
guest-id> | Specifies the short guest operating system identifier | No |
<annotation> | Specifies the user-specified description of the virtual machine | No |
<tools> | Specifies the configuration of VMware tools running on the guest operating system | No |
<flags> | Encapsulates the flag settings for a virtual machine | No |
<console-preferences> | Specifies the preferences for the legacy console application that affect the way it behaves during power operations on the virtual machine | No |
<power-op-info> | Specifies the configuration for default power operations | No |
<num-cpus> | Specifies the number of virtual processors in a virtual machine | No |
<memory-mb> | Specifies the amount of memory, in MB, for a virtual machine | No |
<memory-hot-add-enabled> | Indicates whether memory can be added to the virtual machine while it is running | No |
<cpu-hot-add-enabled> | Indicates whether virtual processors can be added to the virtual machine while it is running | No |
<cpu-hot-remove-enabled> | Indicates whether virtual processors can be removed from the virtual machine while it is running | No |
<device-change-list> | Specifies the set of virtual devices being added, removed, or edited by the configuration operation | No |
<cpu-allocation> | Specifies the resource limits for CPU | No |
<memory-allocation> | Specifies the resource limits for memory | No |
<cpu-affinity> | Specifies the list of nodes (processors for CPU) that can be used by the virtual machine | No |
<memory-affinity> | Specifies the list of nodes (NUMA nodes for memory) that can be used by the virtual machine | |
<network-shaper> | Specifies the network traffic shaping specification | No |
<cpu-feature-mask-list> | Specifies the CPU feature compatibility masks | No |
The following code sample shows a sample adapter request for the Update VM Configuration operation to add a hard disk, a CD ROM, and an ethernet adapter.
Sample adapter request for the Update VM Configuration operation
<operation-type>Configure_Vm</operation-type>
<operation-name>Update_VM_Configuration</operation-name>
<soap-url></soap-url>
<transport></transport>
<user-name></user-name>
<password></password>
<parameters>
<virtual-machine>winSix</virtual-machine>
<spec>
<name>winSix</name>
<version>vmx-04</version>
<guest-id>rhel4Guest</guest-id>
<annotation>Test Linux machine</annotation>
<tools>
<tools-version></tools-version>
<after-power-on>true</after-power-on>
<after-resume>false</after-resume>
<before-guest-standby>true</before-guest-standby>
<before-guest-shutdown>true</before-guest-shutdown>
<before-guest-reboot>false</before-guest-reboot>
</tools>
<flags>
<disable-acceleration>true</disable-acceleration>
<enable-logging>false</enable-logging>
<use-toe>false</use-toe>
<run-with-debug-info>true</run-with-debug-info>
<ht-sharing>any</ht-sharing>
</flags>
<console-preferences>
<power-on-when-opened>true</power-on-when-opened>
<enter-full-screen-on-power-on>false</enter-full-screen-
on-power-on>
<close-on-power-off-or-suspend>true</close-on-power-off-
or-suspend>
</console-preferences>
<power-op-info>
<power-off-type>soft</power-off-type>
<suspend-type>soft</suspend-type>
<reset-type>soft</reset-type>
<default-power-off-type>soft</default-power-off-type>
<default-suspend-type>soft</default-suspend-type>
<default-reset-type>soft</default-reset-type>
<standby-action>checkpoint</standby-action>
</power-op-info>
<num-cpus>1</num-cpus>
<memory-mb>32</memory-mb>
<memory-hot-add-enabled>true</memory-hot-add-enabled>
<cpu-hot-add-enabled>true</cpu-hot-add-enabled>
<cpu-hot-remove-enabled>true</cpu-hot-remove-enabled>
<device-change-list>
<device-change>
<operation>add</operation>
<device type="VirtualBusLogicController">
<key>0</key>
<bus-number>0</bus-number>
<device>0</device>
<shared-bus>noSharing</shared-bus>
</device>
</device-change>
<device-change>
<operation>add</operation>
<file-operation>create</file-operation>
<device type="VirtualDisk">
<key>0</key>
<backing type="VirtualDiskFlatVer2BackingInfo">
<file-name>[dev15 disk2]</file-name>
<disk-mode>persistent</disk-mode>
<split>true</split>
<write-through>true</write-through>
<thin-provisioned>false</thin-provisioned>
</backing>
<controller-key>0</controller-key>
<unit-number>-1</unit-number>
<capacity-inKB>1024</capacity-inKB>
<shares>
<shares>1024</shares>
<level>low</level>
</shares>
</device>
</device-change>
<device-change>
<operation>add</operation>
<device>
<key></key>
<device-info>
<label>Disk3</label>
<summary></summary>
</device-info>
<controller-key></controller-key>
<unit-number></unit-number>
</device>
</device-change>
</device-change-list>
<cpu-allocation>
<reservation>0</reservation>
<limit>-1</limit>
<shares>
<shares>1862</shares>
<level>custom</level>
</shares>
</cpu-allocation>
<memory-allocation>
<reservation>0</reservation>
<limit>2048</limit>
<shares>
<shares>2048</shares>
<level>custom</level>
</shares>
</memory-allocation>
<cpu-affinity>
<affinity-set-list>
<affinity-set>1</affinity-set>
<affinity-set>2</affinity-set>
</affinity-set-list>
</cpu-affinity>
<memory-affinity>
<affinity-set-list>
<affinity-set>1</affinity-set>
<affinity-set>2</affinity-set>
</affinity-set-list>
</memory-affinity>
<network-shaper>
<enabled>true</enabled>
<peak-bps>10</peak-bps>
<average-bps>5</average-bps>
<burst-size>8</burst-size>
</network-shaper>
<cpu-feature-mask-list>
<cpu-feature-mask>
<operation>add</operation>
<info>
<level>-2147483648</level>
<vendor>amd</vendor>
<eax></eax>
<ebx></ebx>
<ecx></ecx>
<edx></edx>
</info>
</cpu-feature-mask>
</cpu-feature-mask-list>
</spec>
</parameters>
</vmware-infrastructure-request>
The following code sample shows the response for the sample Update VM Configuration operation.
Sample adapter response for the Update VM Configuration operation
<metadata>
<status>success</status>
</metadata>
<ReconfigVM_TaskResponse>
<Task>task-727</Task>
</ReconfigVM_TaskResponse>
</vmware-infrastructure-response>
The following table describes the response element.
Adapter response element for the Update VM Configuration operation
Element | Definition |
|---|---|
<Task> | Specifies the task ID of the submitted task |
The following code sample shows a sample adapter request for the Update VM Configuration operation to remove a hard disk, a CD ROM, and an ethernet adapter.
Sample adapter request for the Update VM Configuration operation
<operation-type>Configure_Vm</operation-type>
<operation-name>Update_VM_Configuration</operation-name>
<soap-url></soap-url>
<transport></transport>
<user-name></user-name>
<password></password>
<parameters>
<virtual-machine>winSix</virtual-machine>
<spec>
<name>winSix</name>
<version>vmx-04</version>
<guest-id>rhel4Guest</guest-id>
<annotation>Test Linux machine</annotation>
<tools>
<tools-version></tools-version>
<after-power-on>true</after-power-on>
<after-resume>false</after-resume>
<before-guest-standby>true</before-guest-standby>
<before-guest-shutdown>true</before-guest-shutdown>
<before-guest-reboot>false</before-guest-reboot>
</tools>
<flags>
<disable-acceleration>true</disable-acceleration>
<enable-logging>false</enable-logging>
<use-toe>false</use-toe>
<run-with-debug-info>true</run-with-debug-info>
<ht-sharing>any</ht-sharing>
</flags>
<console-preferences>
<power-on-when-opened>true</power-on-when-opened>
<enter-full-screen-on-power-on>false</enter-full-screen-
on-power-on>
<close-on-power-off-or-suspend>true</close-on-power-off-
or-suspend>
</console-preferences>
<power-op-info>
<power-off-type>soft</power-off-type>
<suspend-type>soft</suspend-type>
<reset-type>soft</reset-type>
<default-power-off-type>soft</default-power-off-type>
<default-suspend-type>soft</default-suspend-type>
<default-reset-type>soft</default-reset-type>
<standby-action>checkpoint</standby-action>
</power-op-info>
<num-cpus>1</num-cpus>
<memory-mb>32</memory-mb>
<device-change-list>
<device-change>
<operation>remove</operation>
<file-operation>destroy</file-operation>
<device type="VirtualDisk">
<disk-name>Hard Disk 1</disk-name>
</device>
</device-change>
<device-change>
<operation>remove</operation>
<device>
<cdrom>CD/DVD drive 3</cdrom>
</device>
</device-change>
<device-change>
<operation>remove</operation>
<device>
<ethernet-adapter>Network Adapter 1</ethernet-adapter>
</device>
</device-change>
</device-change-list>
<cpu-allocation>
<reservation>0</reservation>
<limit>-1</limit>
<shares>
<shares>1862</shares>
<level>custom</level>
</shares>
</cpu-allocation>
<memory-allocation>
<reservation>0</reservation>
<limit>2048</limit>
<shares>
<shares>2048</shares>
<level>custom</level>
</shares>
</memory-allocation>
<cpu-affinity>
<affinity-set-list>
<affinity-set>1</affinity-set>
<affinity-set>2</affinity-set>
</affinity-set-list>
</cpu-affinity>
<memory-affinity>
<affinity-set-list>
<affinity-set>1</affinity-set>
<affinity-set>2</affinity-set>
</affinity-set-list>
The following code sample shows a sample adapter request for the Update VM Configuration operation to update a SCSI controller configuration.
Sample adapter request for the Update VM Configuration operation
<operation-type>Configure_Vm</operation-type>
<operation-name>Update_VM_Configuration</operation-name>
<soap-url></soap-url>
<transport></transport>
<user-name></user-name>
<password></password>
<parameters>
<virtual-machine>winSix</virtual-machine>
<spec>
<device-change-list>
<device-change>
<operation>edit</operation>
<device type="VirtualLsiLogicController">
<scsi-controller>SCSI Controller 0</scsi-controller>
<bus-number>0</bus-number>
<shared-bus>physicalSharing</shared-bus>
</device>
</device-change>
</device-change-list>
</spec>
</parameters>
</vmware-infrastructure-request>
The following code sample shows a sample adapter request for the Update VM Configuration operation to update an ethernet adapter configuration.
Sample adapter request for the Update VM Configuration operation
<operation-type>Configure_Vm</operation-type>
<operation-name>Update_VM_Configuration</operation-name>
<soap-url></soap-url>
<transport></transport>
<user-name></user-name>
<password></password>
<parameters>
<virtual-machine>winSix</virtual-machine>
<spec>
<device-change-list>
<device-change>
<operation>edit</operation>
<device type="VirtualPCNet32">
<ethernet-adapter>Network Adapter 1</ethernet-adapter>
<backing type="VirtualEthernetCardNetworkBackingInfo">
<device-name>DummyNetwork</device-name>
</backing>
<connectable>
<start-connected>true</start-connected>
<allow-guest-control>true</allow-guest-control>
<connected>true</connected>
</connectable>
<address-type>assigned</address-type>
<mac-address></mac-address>
<wake-on-lan-enabled>false</wake-on-lan-enabled>
</device>
</device-change>
</device-change-list>
</spec>
</parameters>
</vmware-infrastructure-request>