Share via


IVMVirtualMachine interface

The IVMVirtualMachine interface defines the interface for a virtual machine. IVMVirtualMachine can notify clients about events using the IVMVirtualMachineEvents outgoing interface. IVMVirtualMachine objects are returned from IVMVirtualServer methods such as IVMVirtualServer::CreateVirtualMachine, IVMVirtualServer::RegisterVirtualMachine, and IVMVirtualServer::FindVirtualMachine. You can also retrieve an IVMVirtualMachine object from the IVMVirtualMachineCollection object returned from the IVMVirtualServer::VirtualMachines property.

Members

The IVMVirtualMachine interface inherits from the IDispatch interface. IVMVirtualMachine also has these types of members:

Methods

The IVMVirtualMachine interface has these methods.

Method Description
AddDVDROMDrive Adds a new CD or DVD drive to the virtual machine.
AddHardDiskConnection Adds a new hard disk connection to the virtual machine.
AddNetworkAdapter Adds a network interface to the virtual machine.
AddSCSIController Adds a new SCSI controller to the virtual machine.
AttachScriptToEvent Specifies a script to run when an event occurs.
DiscardSavedState Discards any saved state information for a saved virtual machine.
DiscardUndoDisks Discards the virtual undo disks.
FetchScriptByEvent Retrieve the script command line associated with the specified event type.
GetActivationValue Retrieves the value of the specified activation setting for this virtual machine.
GetConfigurationValue Retrieves the value of the specified configuration setting for this virtual machine.
MergeUndoDisks Merges the virtual undo disks.
Pause Pauses the virtual machine.
RemoveActivationValue Removes the value of the specified activation setting for this virtual machine.
RemoveConfigurationValue Removes the value of the specified configuration setting for this virtual machine.
RemoveDVDROMDrive Removes the specified CD or DVD drive from the virtual machine.
RemoveHardDiskConnection Removes the specified hard disk connection from the virtual machine.
RemoveNetworkAdapter Removes a network interface from the virtual machine.
RemoveScriptFromEvent Detaches a script from an event.
RemoveSCSIController Removes the specified SCSI controller from the virtual machine.
Reset Resets the virtual machine (like hitting the reset button on a real machine).
Resume Resumes the virtual machine.
Save Saves the virtual machine state.
SetAccountNameAndPassword Sets the account name and password for the context in which this virtual machine will run.
SetActivationValue Sets the value of the specified activation setting for this virtual machine.
SetConfigurationValue Sets the value of the specified configuration setting for this virtual machine.
Startup Starts up the virtual machine.
TurnOff Turns off the virtual machine.

Properties

The IVMVirtualMachine interface has these properties.

Property Access type Description
Accountant
Read-only
An IVMAccountant object for this virtual machine.
AccountName
Read-only
The account name for the context in which this virtual machine will run.
AttachedDriveTypes
Read-only
An array indicating the type of drive attached to each location in the virtual machine.
AutoStartAtLaunch
Read/write
Indicates whether this virtual machine will start up automatically when Virtual Server is launched.
AutoStartAtLaunchDelay
Read/write
The delay in seconds to use when this virtual machine is started up automatically when Virtual Server is launched.
BaseBoardSerialNumber
Read/write
The base board serial number.
BIOSGUID
Read/write
The BIOS GUID.
BIOSSerialNumber
Read/write
The BIOS serial number.
ChassisAssetTag
Read/write
The chassis asset tag.
ChassisSerialNumber
Read/write
The chassis serial number.
ConfigID
Read-only
The unique ID that identifies the virtual machine.
Display
Read-only
The video display for the virtual machine.
DVDROMDrives
Read-only
An enumerable collection of CD/DVD-ROM drives attached to the virtual machine.
File
Read-only
The fully qualified name of the XML file that describes this virtual machine configuration.
FloppyDrives
Read-only
An enumerable collection of floppy drives attached to the virtual machine.
GuestOS
Read-only
The guest operating system for this virtual machine.
HardDiskConnections
Read-only
An enumerable collection of hard disk connections.
has3DNow
Read-only
Indicates whether the processor supports the 3DNow instruction set.
hasMMX
Read-only
Indicates whether the processor supports the MMX instruction set.
hasSSE
Read-only
Indicates whether the processor supports the SSE instruction set.
hasSSE2
Read-only
Indicates whether the processor supports the SSE2 instruction set.
Keyboard
Read-only
The keyboard device for the virtual machine.
Memory
Read/write
The quantity, in megabytes, of physical RAM in the virtual machine.
Mouse
Read-only
The mouse device for the virtual machine.
Name
Read/write
The name of the virtual machine configuration.
NetworkAdapters
Read-only
An enumerable collection of NICs attached to the virtual machine.
Notes
Read/write
The notes about the virtual machine.
ParallelPorts
Read-only
An enumerable collection of parallel ports.
ProcessorSpeed
Read-only
The speed, in megahertz, of the processor.
RunAsDefinedAccount
Read/write
Indicates whether this virtual machine should always be run in the same account.
SavedStateFilePath
Read-only
The full path to the saved state file.
SCSIControllers
Read-only
An enumerable collection of SCSI controllers.
Security
Read-only
The IVMSecurity object associated with this virtual machine.
SerialPorts
Read-only
An enumerable collection of serial ports.
ShutdownActionOnQuit
Read/write
Specifies how to shut down this virtual machine if it is running when Virtual Server is quit.
State
Read-only
The current state of the virtual machine.
Undoable
Read/write
Indicates whether undo drives are enabled for hard disks connected to the virtual machine.
UndoAction
Read/write
The default action to be performed on all undo drives when the virtual machine is shut down from within the guest operating system.

Examples

The following example displays the current property values of the IVMVirtualMachine object.

Set objVS = CreateObject("VirtualServer.Application")

Wscript.Echo "Name: " & objVS.Name

Set colVMs = objVS.VirtualMachines
For Each objVM in colVMS
  Wscript.Echo "Account name: " & objVM.AccountName
  Wscript.Echo "Autostart at launch: " & objVM.AutoStartAtLaunch
  Wscript.Echo "Autostart at launch delay: " & objVM.AutoStartAtLaunchDelay

  If objVM.BaseBoardSerialNumber = "" Then
    Wscript.Echo "Baseboard serial number: [null]"
  Else
    Wscript.Echo "Baseboard serial number: " & objVM.BaseBoardSerialNumber
  End If

  If objVM.BIOSGUID = "" Then
    Wscript.Echo "BIOS GUID: [null]"
  Else
    Wscript.Echo "BIOS GUID: " & objVM.BIOSGUID
  End If

  If objVM.BIOSSerialNumber = "" Then
    Wscript.Echo "BIOS serial number: [null]"
  Else
    Wscript.Echo "BIOS serial number: " & objVM.BIOSSerialNumber
  End If

  If objVM.ChassisAssetTag = "" Then
    Wscript.Echo "Chassis asset tag: [null]"
  Else
    Wscript.Echo "Chassis asset tag: " & objVM.ChassisAssetTag
  End If

  If objVM.ChassisSerialNumber = "" Then
    Wscript.Echo "Chassis serial number: [null]"
  Else
    Wscript.Echo "Chassis serial number: " & objVM.ChassisSerialNumber
  End If

  Wscript.Echo "Config ID: " & objVM.ConfigID

  Set objDisplay = objVM.Display
  WScript.Echo "Display Dimensions: " & objDisplay.Width & "x" & objDisplay.Height

  Set colDVDs = objVM.DVDROMDrives
  Wscript.Echo "DVD/CDROM drives installed: " & colDVDs.Count

  Wscript.Echo "File: " & objVM.File

  Set colFDs = objVM.FloppyDrives
  Wscript.Echo "Floppy drives installed: " & colFDs.Count

  Set objGOS = objVM.GuestOS
  Wscript.Echo "Guest OS: " & objGOS.OSName

  Set colHDCons = objVM.HardDiskConnections
  Wscript.Echo "Hard disk connections: " & colHDCons.Count

  Wscript.Echo "Has MMX: " & objVM.HasMMX
  Wscript.Echo "Has SSE: " & objVM.HasSSE
  Wscript.Echo "Has SSE2: " & objVM.HasSSE2
  Wscript.Echo "Has 3DNow: " & objVM.Has3DNow
  Wscript.Echo "Memory: " & objVM.Memory
  Wscript.Echo "Name: " & objVM.Name

  Set colNICs = objVM.NetworkAdapters
  Wscript.Echo "Network adapters: " & colNICs.Count

  Wscript.Echo "Notes: " & objVM.Notes

  Set colPPs = objVM.ParallelPorts
  Wscript.Echo "Parallel Ports: " & colPPs.Count

  Wscript.Echo "Processor speed: " & objVM.ProcessorSpeed
  Wscript.Echo "Run as defined account: " & objVM.RunAsDefinedAccount
  Wscript.Echo "Saved state file path: " & objVM.SavedStateFilePath

  Set colSCSICons = objVM.SCSIControllers
  Wscript.Echo "SCSI controllers: " & colSCSICons.Count

  Set colSPs = objVM.SerialPorts
  Wscript.Echo "Serial Ports: " & colSPs.Count

  Wscript.Echo "Shutdown action on quit: " & objVM.ShutdownActionOnQuit
  Wscript.Echo "State: " & objVM.State
  Wscript.Echo "Undoable: " & objVM.Undoable
  Wscript.Echo "Undo action: " & objVM.UndoAction
  Wscript.Echo
Next

Requirements

Product
Microsoft Virtual Server 2005 onWindows Server 2003
Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VsComInterfaces.h