共用方式為


IVMVirtualServer interface

The IVMVirtualServer interface defines the top-level Virtual Server application object.

When to use

All other Virtual Server interface objects are retrieved through this object. IVMVirtualServer can notify clients about events by using the IVMVirtualServerEvents outgoing interface.

Members

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

Methods

The IVMVirtualServer interface has these methods.

Method Description
AttachScriptToEvent Specifies a script to run when an event occurs.
CreateDifferencingVirtualHardDisk Creates a differencing virtual hard disk.
CreateDynamicVirtualHardDisk Creates a dynamically resizing virtual hard disk.
CreateFixedVirtualHardDisk Creates a fixed-size virtual hard disk.
CreateFloppyDiskImage Creates a floppy disk image file.
CreateHostDriveVirtualHardDisk Creates a virtual hard disk that is linked to a host drive.
CreateVirtualMachine Creates a new virtual machine configuration and returns the virtual machine object.
CreateVirtualNetwork Creates a new virtual network.
DeleteVirtualMachine Deletes a virtual machine configuration.
DeleteVirtualNetwork Deletes a virtual network.
FetchScriptByEvent Retrieves the script command line associated with the specified event type.
FindVirtualMachine Retrieves a virtual machine object that matches the requested configuration.
FindVirtualNetwork Retrieves a virtual network object that matches the requested name.
GetConfigurationValue Retrieves the value of the specified configuration setting for this virtual server.
GetDVDFiles Retrieves an array of known virtual DVD files.
GetFloppyDiskFiles Retrieves an array of known virtual floppy disk files.
GetFloppyDiskImageType Retrieves the type of an existing floppy disk image file.
GetHardDisk Retrieves an IVMHardDisk object that corresponds to an existing disk image file.
GetHardDiskFiles Retrieves an array of known virtual hard disk files.
GetVirtualMachineFiles Retrieves an array of known virtual machine configuration files.
GetVirtualNetworkFiles Retrieves an array of known virtual network configuration files.
QueryLocale Retrieves the preferred Virtual Server service locale selected from the set of languages specified by an RFC-2616 compliant language string.
RegisterVirtualMachine Registers an existing virtual machine configuration and returns the virtual machine object.
RegisterVirtualNetwork Registers an existing virtual network configuration and returns the virtual network object.
RemoveConfigurationValue Removes the value of the specified configuration setting for this virtual server.
RemoveScriptFromEvent Disassociates a script from an event.
SetConfigurationValue Sets the value of the specified configuration setting for this virtual server.
UnregisterVirtualMachine Unregisters a virtual machine configuration without deleting the configuration file.
UnregisterVirtualNetwork Unregisters a virtual network configuration without deleting the configuration file.
VMRCCreateEncryptionCertificateRequest Creates a new security certificate request.

Properties

The IVMVirtualServer interface has these properties.

Property Access type Description
AvailableSystemCapacity
Read-only
The percentage of currently available system capacity, based on the number of virtual machines currently running and their scheduling parameters.
DefaultLocale
Read-only
The default user interface locale of the Virtual Server service.
DefaultVMConfigurationPath
Read/write
The default directory searched by the web application to create lists of available virtual machine configuration files.
DefaultVNConfigurationPath
Read-only
The default directory searched by the web application to create lists of available virtual network configuration files.
HostInfo
Read-only
Information about the physical computer.
Locale
Write-only
The locale for this session with the Virtual Server service.
MaximumFloppyDrivesPerVM
Read-only
The maximum number of floppy drives per virtual machine.
MaximumMemoryPerVM
Read-only
The maximum allowable quantity, in megabytes, of physical RAM per virtual machine.
MaximumNetworkAdaptersPerVM
Read-only
The maximum number of network interfaces per virtual machine.
MaximumNumberOfIDEBuses
Read-only
The maximum number of buses allowed for IDE.
MaximumNumberOfSCSIControllers
Read-only
The maximum number of adapters allowed for SCSI.
MaximumParallelPortsPerVM
Read-only
The maximum number of parallel ports per virtual machine.
MaximumSerialPortsPerVM
Read-only
The maximum number of serial ports per virtual machine.
MinimumMemoryPerVM
Read-only
The minimum allowable quantity, in megabytes, of physical RAM per virtual machine.
Name
Read-only
The name of the Virtual Server application.
ProductID
Read-only
The ProductID of this instance of Virtual Server.
SearchPaths
Read/write
An array of file system paths used to find files associated with Virtual Server.
Security
Read/write
The IVMSecurity object associated with Virtual Server.
SuggestedMaximumMemoryPerVM
Read-only
The suggested maximum allowable quantity, in megabytes, of physical RAM per virtual machine to avoid low memory conditions on the host.
SupportDrivers
Read-only
A collection of support drivers.
Tasks
Read-only
A collection of tasks.
UnconnectedNetworkAdapters
Read-only
A collection of unconnected IVMNetworkAdapter objects.
UpTime
Read-only
The number of seconds the Virtual Server application has been running.
Version
Read-only
The version of this instance of Virtual Server.
VirtualMachines
Read-only
A collection of IVMVirtualMachine objects.
VirtualNetworks
Read-only
A collection of IVMVirtualNetwork objects.
VMRCAdminAddress
Read/write
The TCP/IP address of the host network adapter over which VMRC connections are accepted.
VMRCAdminPortNumber
Read/write
The VMRC administration port number.
VMRCAuthenticator
Read/write
The authentication method to use for new VMRC connections.
VMRCAuthenticators
Read-only
The VMRC authentication methods supported by Virtual Server.
VMRCEnabled
Read/write
Indicates whether server administration using Virtual Machine Remote Control (VMRC) is enabled.
VMRCEncryptionCertificate
Read/write
The security certificate used by SSL/TLS encryption to protect VMRC session data.
VMRCEncryptionCertificateRequest
Read-only
The current security certificate request.
VMRCEncryptionEnabled
Read/write
Indicates whether server administration VMRC session data is encrypted using SSL/TLS encryption.
VMRCIdleConnectionTimeout
Read/write
The time in seconds after which idle VMRC connections are disconnected.
VMRCIdleConnectionTimeoutEnabled
Read/write
Indicates whether idle VMRC connections are automatically disconnected.
VMRCXResolution
Read/write
The horizontal resolution used for server administration.
VMRCYResolution
Read/write
The vertical resolution used for server administration.
VMScriptsEnabled
Read/write
Indicates whether scripts attached to any virtual machine are allowed to run.
VSScriptsEnabled
Read/write
Indicates whether scripts attached to Virtual Server events are allowed to run.

Examples

The following example shows how to create an IVMVirtualServer object from VBScript.

Dim vsApp;
Set vsApp = WScript.CreateObject("VirtualServer.Application");

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

Set objVS = CreateObject("VirtualServer.Application")

Wscript.Echo "Available system capacity: " & objVS.AvailableSystemCapacity

Wscript.Echo "Default Locale: " & CInt(objVS.DefaultLocale)

Wscript.Echo "Default VM configuration path: " & objVS.DefaultVMConfigurationPath

Wscript.Echo "Default VN configuration path: " & objVS.DefaultVNConfigurationPath

Set objHI = objVS.HostInfo
Wscript.Echo "Host info:"
Wscript.Echo "    Host operating system: " & objHI.OperatingSystem
Wscript.Echo "    Host operating system version: " & objHI.OSMajorVersion & "." & objHI.OSMinorVersion
Wscript.Echo "    Number of processors on host: " & objHI.PhysicalProcessorCount

Wscript.Echo "Maximum floppy drives per VM: " & objVS.MaximumFloppyDrivesPerVM

Wscript.Echo "Maximum memory per VM: " & objVS.MaximumMemoryPerVM

Wscript.Echo "Maximum network adapters per VM: " & objVS.MaximumNetworkAdaptersPerVM

Wscript.Echo "Maximum number of IDE buses: " & objVS.MaximumNumberOfIDEBuses

Wscript.Echo "Maximum number of SCSI controllers: " & objVS.MaximumNumberOfSCSIControllers

Wscript.Echo "Maximum parallel ports per VM: " & objVS.MaximumParallelPortsPerVM

Wscript.Echo "Maximum serial ports per VM: " & objVS.MaximumSerialPortsPerVM

Wscript.Echo "Minimum memory per VM: " & objVS.MinimumMemoryPerVM

Wscript.Echo "Name: " & objVS.Name

Wscript.Echo "Product ID: " & objVS.ProductID

Dim allPaths
allPaths = objVS.SearchPaths
If UBound (allPaths) = -1 Then
  Wscript.Echo "File search paths: [empty]"
Else
  Wscript.Echo "File search paths: "
  For i = LBound(allPaths) to UBound(allPaths)
    wscript.echo "    " & allPaths(i)
  Next
End If

Set objSec = objVS.Security
Wscript.Echo "Security principle: "
Wscript.Echo "    Owner Name: " & objSec.OwnerName
Wscript.Echo "    Owner SID: " & objSec.OwnerSID
Wscript.Echo "    Group Name: " & objSec.GroupName
Wscript.Echo "    Group SID: " & objSec.GroupSID
Wscript.Echo "Suggested maximum memory per VM: " & objVS.SuggestedMaximumMemoryPerVM

Set objSDColl = objVS.SupportDrivers
If objSDColl.Count > 0 Then
  Wscript.Echo "Support drivers: "
  For Each objSD in objSDColl
    Wscript.Echo "    Type: " & objSD.Type & " (" & objSD.Description & ")"
  Next
End If

Set objTColl = objVS.Tasks
If objTColl.Count = 0 Then
  Wscript.Echo "Current tasks: [none]"
Else
  Wscript.Echo "Current tasks: "
  For Each objT in objTColl
    Wscript.Echo "    Task: " & objT.ID & ":" & objT.Description
  Next
End If

Set objUNA = objVS.UnconnectedNetworkAdapters
Wscript.Echo "Unconnected network adapters: " & objUNA.Count
Wscript.Echo "Uptime: " & objVS.Uptime
Wscript.Echo "Version: " & objVS.Version

Set objVMColl = objVS.VirtualMachines
If objVMColl.Count = 0 Then
  Wscript.Echo "    Virtual machines: [none]"
Else
  Wscript.Echo "Virtual machines: " & objVMColl.Count
  For Each objVM in objVMColl
    Wscript.Echo "    Name: " & objVM.Name
  Next
End If

Set objVNColl = objVS.VirtualNetworks
If objVNColl.Count = 0 Then
  Wscript.Echo "Virtual networks: [none]"
Else
  Wscript.Echo "Virtual networks: " & objVNColl.Count
  For Each objVN in objVNColl
    Wscript.Echo "    Name: " & objVN.Name
  Next
End If

If objVS.VMRCAdminAddress = "" Then
  Wscript.Echo "VMRC admin address: [all]"
Else
  Wscript.Echo "VMRC admin address: " & objVS.VMRCAdminAddress
End If

Wscript.Echo "VMRC admin port number: " & objVS.VMRCAdminPortNumber

Set objVMA = objVS.VMRCAuthenticator
Wscript.Echo "Current VMRC authenticator: " & objVMA.Name & " (" & objVMA.Description & ")"

Set objVMAColl = objVS.VMRCAuthenticators
Dim objAuth
If isNUll(objVMAColl) Then
  Wscript.Echo "VMRC authenticators: [none]"
Else
  Wscript.Echo "VMRC authenticators: "
  For Each objAuth in objVMAColl
    Wscript.Echo "    Name: " & objAuth.Name & " (" & objAuth.Description & ")"
  Next
End If

Wscript.Echo "VMRC enabled: " & objVS.VMRCEnabled

If objVS.VMRCEncryptionCertificate = "" Then
  Wscript.Echo "VMRC encryption certificate: [none]"
Else
  Wscript.Echo "VMRC encryption certificate: " & objVS.VMRCEncryptionCertificate
End If

If objVS.VMRCEncryptionCertificateRequest = "" Then
  Wscript.Echo "VMRC encryption certificate request: [none]"
Else
  Wscript.Echo "VMRC encryption certificate request: " & objVS.VMRCEncryptionCertificateRequest
End If

Wscript.Echo "VMRC encryption enabled: " & objVS.VMRCEncryptionEnabled

Wscript.Echo "VMRC idle connection timeout: " & objVS.VMRCIdleConnectionTimeout

Wscript.Echo "VMRC idle connection timeout enabled: " & objVS.VMRCIdleConnectionTimeoutEnabled

Wscript.Echo "VMRC X-Resolution: " & objVS.VMRCXResolution

Wscript.Echo "VMRC Y-Resolution: " & objVS.VMRCYResolution

Wscript.Echo "Virtual machine scripts enabled: " & objVS.VMScriptsEnabled

Wscript.Echo "Virtual server event scripts enabled: " & objVS.VSScriptsEnabled

The following example shows how to create an IVMVirtualServerobject from JScript.

var vsApp = WScript.CreateObject("VirtualServer.Application");

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
Library
VsComInterfaces.lib
IID
IID_IVMVirtualServer is defined as D1E64C50-A25D-450f-BE0B-9CA5A354CFF4