IVMVirtualServer::CreateVirtualMachine method
The CreateVirtualMachine method creates a new virtual machine configuration and returns the virtual machine object.
Syntax
HRESULT CreateVirtualMachine(
[in] BSTR configurationName,
[in] BSTR configurationPath,
[out] IVMVirtualMachine **virtualMachine
);
Parameters
-
configurationName [in]
-
The name of the virtual machine to create. The length of the name cannot exceed 256 characters and the combined length of the name and path cannot exceed 260 characters. The file name extension ".vmc" will be appended to the end of the virtual machine name when the configuration file is created. If this parameter is NULL or an empty string, the configurationPath parameter must specify the full path to the configuration file.
-
configurationPath [in]
-
The path to the folder that will contain the configuration file. This folder will be created if it does not exist. If configurationName is NULL or an empty string, this must specify the full path of the new configuration file.
-
virtualMachine [out]
-
A pointer to a new IVMVirtualMachine object which represents this virtual machine.
Return value
This method supports standard return values, as well as the following. For information on Virtual Server specific return values not listed below, see HRESULT Codes Specific to the Virtual Server.
Return code | Description |
---|---|
|
The operation was successful. |
|
configurationName or configurationPath is invalid, or virtualMachine is NULL. |
|
The system cannot find the path specified by the configurationPath parameter. |
|
configurationPath contains an invalid character (one of "*?:<>/|""). |
|
The configurationPath parameter specifies an empty or relative path. An absolute path is required. |
|
The path specified by the configurationName and configurationPath parameters results is a path that is too long. The total length of the path must be less than 260 characters. |
|
A configuration file with this name already exists at this location. |
|
configurationName contains an invalid character (one of "*?:<>/|\""). |
|
There is already a virtual machine with this name. |
|
An unexpected error occurred. |
Remarks
Virtual machine names are case-insensitive, for example, "MyVM" and "myvm" refer to the same virtual machine.
Requirements
Product |
Microsoft Virtual Server 2005 onWindows Server 2003 |
Download |
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003 |
Header |
|