Update Virtual Machine Memory operation

The Update Virtual Machine Memory operation updates the memory resources of 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 Memory 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 Memory operation

Element

Description

Required

<operation-name>

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

Yes

<arguments>

Contains the elements that specify the details for the VM 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> specified

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 specified

<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 memory is to be updated

Yes

<memory>

Specifies the amount of memory, in MB, to allocate to the VM

Valid values: Any value greater than or equal to 8 MB

Note

The valid value for <memory> depends on the amount of memory that is available on the Hyper-V server.

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

The following figure shows a sample <items> XML element for the Update Virtual Machine Memory 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>RHEL5</vm>
    <memory>1024</memory>
  </item>
  <item>
    <target>
 	<host>pw-mmm-abc-dv00</host>
 	<user-name>administrator</user-name>
        <password>pwd</password>   
    </target>
    <vm>VM6</vm>
    <memory>512</memory>
  </item>
  <item>
    <vm>VM5</vm>
    <memory>1024</memory>
  </item>
  <item>
    <target>Config1</target>
    <vm>VM45</vm>
    <memory>512</memory>
  </item>
</items>

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

 Sample adapter request for the Update Virtual Machine Memory operation



<ms-hyperv-request>
    <operation-name>update-vm-memory</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>RHEL5</vm>
      <memory>1024</memory>
    </arguments>
    <arguments>
      <target>
        <host>pw-mmm-abc-dv00</host>
        <user-name>administrator</user-name>
        <password>pwd</password>
      </target>
      <vm>VM6</vm>
      <memory>512</memory>
    </arguments>
    <arguments>
      <vm>VM5</vm>
      <memory>1024</memory>
    </arguments>
    <arguments>
      <target>Config1</target>
      <vm>VM45</vm>
      <memory>512</memory>
    </arguments>
  </ms-hyperv-request> 

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

 Sample adapter response for the Update Virtual Machine Memory 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-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\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-pun-rds-dv01</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-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\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-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\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-pun-rds-dv01</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-PUN-RDS-DV01</server>
          <namespace>root\virtualization</namespace>
          <path>\\PW-PUN-RDS-DV01\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