IVMVirtualMachine::Memory property
The Memory property contains the quantity, in megabytes, of physical RAM in the virtual machine.
This property is read/write.
Syntax
HRESULT put_Memory(
[in] long megabytesOfMemory
);
HRESULT get_Memory(
[out] long *megabytesOfMemory
);
VB |
---|
|
Property value
The quantity, in megabytes, of physical RAM in the virtual machine.
This property value is read/write.
Error codes
Name | Meaning |
---|---|
|
The operation was successful. |
|
The megabytesOfMemory parameter is NULL. |
|
The megabytesOfMemory parameter is not valid or is out of range. |
|
The configuration is unknown. |
|
The preference was not found. |
|
An unexpected error has occurred. |
Remarks
The amount of physical RAM in a virtual machine must be at least 4 MB. The upper limit on memory depends on the host configuration, but can be at most 3,712 MB.
You cannot set this property if the virtual machine is running or saved.
Examples
The following example displays the Memory property value of a VMVirtualMachine object.
Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("Windows Server 2003")
Wscript.Echo "VM Name: " & objVM.Name
WScript.Echo "Memory: " & objVM.Memory
Requirements
Product |
Microsoft Virtual Server 2005 onWindows Server 2003 |
Download |
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003 |
Header |
|