Update Virtual Machine Processors operation

The Update Virtual Machine Processors operation sets the processor resources allocated to a virtual machine (VM) created on the Microsoft Hyper-V server. This topic illustrates the actor adapter request and response and describes the elements used in the request.

Warning

The Update Virtual Machine Processors operation works only when the state of the VM is "Stopped".

The following table describes the elements for the adapter request:

Adapter request elements for the Update Virtual Machine Processors operation

Element

Description

Required

<operation-name>

Specifies the name of the operation: update-vm-processors

Yes

<arguments>

Contains the elements that specify the details of the processors that need to be updated

Yes

<target>

Contains a dynamic target configuration or uses a predefined target configuration of the Hyper-V server on which the request is executed

Note

If you do not specify a dynamic target in the adapter request, the default adapter configuration is used.

The <target> element contains the following elements:

  • <host>
  • <user-name>
  • <password>
  • <timeout-secs>

Conditional; required if a target is referenced or specified in the request

<host>

Specifies the host name or the IP address of the Hyper-V server

The <host> element applies to a dynamic target.

Conditional; required when specifying a dynamic target

<user-name>

Specifies the user name to be used to connect to the Hyper-V server

The <user-name> element applies to a dynamic target.

Conditional; required when specifying a dynamic target

<password>

Specifies the password that corresponds to the <user-name> provided

The <password> element applies to a dynamic target.

The <password> element can contain an encryption-type attribute that indicates whether the password specified is encrypted.

Valid values for encryption-type: base64, plain (default)

Conditional; required if <user-name> is provided

<timeout-secs>

Specifies the time, in seconds, after which the attempt to connect to the Hyper-V server fails

Default value: 60

No

<vm>

Specifies the name of the VM on which the processors need to be updated

Yes

<vm-guid>

Specifies the globally unique identifier (GUID) of a VM to restrict the operation to that VM if multiple VMs have the same name

No

<cpu-count>

Specifies the total number of processors on the VM

No

<weight>

Defines the relative weight for each VM processor

After the reserves are allocated, the remaining physical processor capacity of the host platform is allocated to VMs based on their relative weights.

Valid values: 1 through 10000

No

<limit>

Specifies the maximum percentage of CPU resources that may be consumed by a VM

Valid values: 0 through 100

No

<reservation>

Specifies the percentage of CPU resources that are reserved for use by a VM

Valid values: 0 through 100

No

The following figure shows a sample <items> XML element for the Update Virtual Machine Processors operation.

 Sample



<items>
   <item>
      <target>
  	<host>10.111.8.222</host>
	<user-name>administrator</user-name>
       	<password   encryption-type="Base64">pwd</password>   
	<timeout-secs>120</timeout-secs>
      </target>
      <vm>VM1</vm>
      <vm-guid>1CCBFE38-FF48-424F-9FE2-713293C7105F<vm-guid>
      <cpu-count>2</cpu-count>
      <weight>200</weight>
      <limit>50</limit>
      <reservation>70</reservation>
   </item>
   <item>
      <target>
  	<host>pw-mmm-abc-dv00</host>
	<user-name>administrator</user-name>
       	<password>bmcAdm1n</password>   
      </target>
      <vm>VM5</vm>
      <cpu-count>3</cpu-count>
      <weight>100</weight>
      <limit>20</limit>
      <reservation>30</reservation>
   </item>
   <item>
      <vm>VM45</vm>
      <cpu-count></cpu-count>
      <weight></weight>
      <limit>40</limit>
      <reservation>80</reservation>
   </item>
   <item>
      <target>Config1</target>
      <vm>VM6</vm>
      <cpu-count>4</cpu-count>
      <weight></weight>
      <limit></limit>
      <reservation>60</reservation>
   </item>
</items> 

The following figure shows a sample adapter request for the Update Virtual Machine Processors operation:

 Sample adapter request for the Update Virtual Machine Processors operation



<ms-hyperv-request>
    <operation-name>update-vm-processors</operation-name>
    <arguments>
      <target>
        <host>10.111.8.222</host>
        <user-name>administrator</user-name>
        <password encryption-type="Base64">pwd</password>
        <timeout-secs>120</timeout-secs>
      </target>
      <vm>VM1</vm>
      <vm-guid>1CCBFE38-FF48-424F-9FE2-713293C7105F</vm-guid>
      <cpu-count>2</cpu-count>
      <weight>200</weight>
      <limit>50</limit>
      <reservation>70</reservation>
    </arguments>
    <arguments>
      <target>
        <host>pw-mmm-abc-dv00</host>
        <user-name>administrator</user-name>
        <password>bmcAdm1n</password>
      </target>
      <vm>VM5</vm>
      <cpu-count>3</cpu-count>
      <weight>100</weight>
      <limit>20</limit>
      <reservation>30</reservation>
    </arguments>
    <arguments>
      <vm>VM45</vm>
      <cpu-count />
      <weight />
      <limit>40</limit>
      <reservation>80</reservation>
    </arguments>
    <arguments>
      <target>Config1</target>
      <vm>VM6</vm>
      <cpu-count>4</cpu-count>
      <weight />
      <limit />
      <reservation>60</reservation>
    </arguments>
  </ms-hyperv-request> 

The following figure shows a sample adapter response for the Update Virtual Machine Processors operation:

 Sample adapter response for the Update Virtual Machine Processors operation



<ms-hyperv-response>
  <metadata>
    <status>success</status>
    <response-count>4</response-count>
  </metadata>
  <responses>
    <UpdateVirtualMachineMemoryResponse>
      <metadata>
        <target>10.111.8.222</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-element-name>RHEL5</vm-element-name>
          <genus>2</genus>
          <class>Msvm_MemorySettingData</class>
          <superclass>CIM_ResourceAllocationSettingData</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_MemorySettingData.InstanceID="Microsoft:9C4BE436-1</relpath>
          <property-count>25</property-count>
          <derivation>{CIM_ResourceAllocationSettingData, CIM_SettingData, CI</derivation>
          <server>pw-mmm-abc-dv00</server>
          <namespace>root\virtualization</namespace>
          <path>\\pw-mmm-abc-dv00\root\virtualization:Msvm_MemorySettin</path>
          <address></address>
          <allocation-units>MB</allocation-units>
          <automatic-allocation>True</automatic-allocation>
          <automatic-deallocation>True</automatic-deallocation>
          <caption>Memory</caption>
          <connection></connection>
          <consumer-visibility></consumer-visibility>
          <description>Settings for Microsoft Virtual Machine Memory.</description>
          <device-i-d></device-i-d>
          <device-i-d-format></device-i-d-format>
          <dynamic-memory-enabled></dynamic-memory-enabled>
          <element-name>Memory</element-name>
          <host-resource></host-resource>
          <instance-i-d>Microsoft:9C4BE436-1EAE-4210-AD25-EB94E14E1377\4764334d</instance-i-d>
          <is-virtualized>True</is-virtualized>
          <limit>1024</limit>
          <mapping-behavior></mapping-behavior>
          <other-resource-type></other-resource-type>
          <parent></parent>
          <pool-i-d>15129609-B465-4916-AA13-0CF4B109ADB0</pool-i-d>
          <reservation>1024</reservation>
          <resource-sub-type>Microsoft Virtual Machine Memory</resource-sub-type>
          <resource-type>4</resource-type>
          <virtual-quantity>1024</virtual-quantity>
          <weight>0</weight>
        </item>
      </items>
    </UpdateVirtualMachineMemoryResponse>
    <UpdateVirtualMachineMemoryResponse>
      <metadata>
        <target>pw-mmm-abc-dv00</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-element-name>VM6</vm-element-name>
          <genus>2</genus>
          <class>Msvm_MemorySettingData</class>
          <superclass>CIM_ResourceAllocationSettingData</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_MemorySettingData.InstanceID="Microsoft:37D53DC3-F</relpath>
          <property-count>25</property-count>
          <derivation>{CIM_ResourceAllocationSettingData, CIM_SettingData, CI</derivation>
          <server>pw-mmm-abc-dv00</server>
          <namespace>root\virtualization</namespace>
          <path>\\pw-mmm-abc-dv00\root\virtualization:Msvm_MemorySettin</path>
          <address></address>
          <allocation-units>MB</allocation-units>
          <automatic-allocation>True</automatic-allocation>
          <automatic-deallocation>True</automatic-deallocation>
          <caption>Memory</caption>
          <connection></connection>
          <consumer-visibility></consumer-visibility>
          <description>Settings for Microsoft Virtual Machine Memory.</description>
          <device-i-d></device-i-d>
          <device-i-d-format></device-i-d-format>
          <dynamic-memory-enabled></dynamic-memory-enabled>
          <element-name>Memory</element-name>
          <host-resource></host-resource>
          <instance-i-d>Microsoft:37D53DC3-FF03-49DA-A973-B5EDE7A90F44\4764334d</instance-i-d>
          <is-virtualized>True</is-virtualized>
          <limit>512</limit>
          <mapping-behavior></mapping-behavior>
          <other-resource-type></other-resource-type>
          <parent></parent>
          <pool-i-d>15129609-B465-4916-AA13-0CF4B109ADB0</pool-i-d>
          <reservation>512</reservation>
          <resource-sub-type>Microsoft Virtual Machine Memory</resource-sub-type>
          <resource-type>4</resource-type>
          <virtual-quantity>512</virtual-quantity>
          <weight>0</weight>
        </item>
      </items>
    </UpdateVirtualMachineMemoryResponse>
    <UpdateVirtualMachineMemoryResponse>
      <metadata>
        <target>10.111.8.222</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-element-name>VM5</vm-element-name>
          <genus>2</genus>
          <class>Msvm_MemorySettingData</class>
          <superclass>CIM_ResourceAllocationSettingData</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_MemorySettingData.InstanceID="Microsoft:26D3A022-D</relpath>
          <property-count>25</property-count>
          <derivation>{CIM_ResourceAllocationSettingData, CIM_SettingData, CI</derivation>
          <server>pw-mmm-abc-dv00</server>
          <namespace>root\virtualization</namespace>
          <path>\\pw-mmm-abc-dv00\root\virtualization:Msvm_MemorySettin</path>
          <address></address>
          <allocation-units>MB</allocation-units>
          <automatic-allocation>True</automatic-allocation>
          <automatic-deallocation>True</automatic-deallocation>
          <caption>Memory</caption>
          <connection></connection>
          <consumer-visibility></consumer-visibility>
          <description>Settings for Microsoft Virtual Machine Memory.</description>
          <device-i-d></device-i-d>
          <device-i-d-format></device-i-d-format>
          <dynamic-memory-enabled></dynamic-memory-enabled>
          <element-name>Memory</element-name>
          <host-resource></host-resource>
          <instance-i-d>Microsoft:26D3A022-D84E-4F2B-842B-8C173EFFD865\4764334d</instance-i-d>
          <is-virtualized>True</is-virtualized>
          <limit>1024</limit>
          <mapping-behavior></mapping-behavior>
          <other-resource-type></other-resource-type>
          <parent></parent>
          <pool-i-d>15129609-B465-4916-AA13-0CF4B109ADB0</pool-i-d>
          <reservation>1024</reservation>
          <resource-sub-type>Microsoft Virtual Machine Memory</resource-sub-type>
          <resource-type>4</resource-type>
          <virtual-quantity>1024</virtual-quantity>
          <weight>0</weight>
        </item>
      </items>
    </UpdateVirtualMachineMemoryResponse>
    <UpdateVirtualMachineMemoryResponse>
      <metadata>
        <target>pw-mmm-abc-dv00</target>
        <status>success</status>
        <count>1</count>
      </metadata>
      <items>
        <item>
          <vm-element-name>VM45</vm-element-name>
          <genus>2</genus>
          <class>Msvm_MemorySettingData</class>
          <superclass>CIM_ResourceAllocationSettingData</superclass>
          <dynasty>CIM_ManagedElement</dynasty>
          <relpath>Msvm_MemorySettingData.InstanceID="Microsoft:8F7A9D52-F</relpath>
          <property-count>25</property-count>
          <derivation>{CIM_ResourceAllocationSettingData, CIM_SettingData, CI</derivation>
          <server>pw-mmm-abc-dv00</server>
          <namespace>root\virtualization</namespace>
          <path>\\pw-mmm-abc-dv00\root\virtualization:Msvm_MemorySettin</path>
          <address></address>
          <allocation-units>MB</allocation-units>
          <automatic-allocation>True</automatic-allocation>
          <automatic-deallocation>True</automatic-deallocation>
          <caption>Memory</caption>
          <connection></connection>
          <consumer-visibility></consumer-visibility>
          <description>Settings for Microsoft Virtual Machine Memory.</description>
          <device-i-d></device-i-d>
          <device-i-d-format></device-i-d-format>
          <dynamic-memory-enabled></dynamic-memory-enabled>
          <element-name>Memory</element-name>
          <host-resource></host-resource>
          <instance-i-d>Microsoft:8F7A9D52-F292-4599-95C7-1D559595D9CB\4764334d</instance-i-d>
          <is-virtualized>True</is-virtualized>
          <limit>512</limit>
          <mapping-behavior></mapping-behavior>
          <other-resource-type></other-resource-type>
          <parent></parent>
          <pool-i-d>15129609-B465-4916-AA13-0CF4B109ADB0</pool-i-d>
          <reservation>512</reservation>
          <resource-sub-type>Microsoft Virtual Machine Memory</resource-sub-type>
          <resource-type>4</resource-type>
          <virtual-quantity>512</virtual-quantity>
          <weight>0</weight>
        </item>
      </items>
    </UpdateVirtualMachineMemoryResponse>
  </responses>
</ms-hyperv-response> 

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

Comments