IVMHardDisk::Convert method
[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]
Converts a fixed-size virtual hard disk to a dynamically expanding virtual hard disk or converts a dynamically expanding virtual hard disk to a fixed-size virtual hard disk.
Syntax
HRESULT Convert(
[in] BSTR convertedDiskImagePath,
[in] VMHardDiskType convertedDiskImageType,
[out, retval] IVMTask **convertTask
);
Parameters
-
convertedDiskImagePath [in]
-
The path to the target disk image file.
-
convertedDiskImageType [in]
-
The type of the target disk image. For a list of values, see VMHardDiskType.
-
convertTask [out, retval]
-
An IVMTask object that is used to track the completion of the conversion process.
Return value
This method can return one of these values.
Return code/value | Description |
---|---|
|
The operation was successful. |
|
The convertedDiskImagePath parameter is empty or missing the .vhd extension on the file name. |
|
A parameter is NULL. |
|
The system cannot find the path specified by the convertedDiskImagePath parameter. |
|
The convertedDiskImagePath parameter contains an invalid character (one of "*?<>/|":"). |
|
The convertedDiskImagePath parameter specifies an empty or relative path. An absolute path is required. |
|
The path specified by the convertedDiskImagePath parameter is too long. The path must be less than MAX_PATH (260) characters. |
|
Either the virtual hard disk referenced by this object is in use or the parent of this virtual hard disk is in use. |
|
The host volume does not have enough space to convert this virtual hard disk. |
|
The file referenced by the convertedDiskImagePath parameter already exists. |
|
The convertedDiskImagePath parameter must be either vmDiskType_Dynamic or vmDiskType_FixedSize. |
|
The virtual hard disk image referenced by this IVMHardDisk object does not seem to be a valid image. |
|
The parent of the virtual hard disk referenced by this object does not exist. |
|
The virtual hard disk image cannot be converted because the application is shutting down. |
|
An unexpected error has occurred. |
Remarks
The source file is left intact after the conversion process.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 7 [desktop apps only] |
Minimum supported server |
None supported |
End of client support |
Windows 7 |
Product |
Windows Virtual PC |
Header |
|
IID |
IID_IVMHardDisk is defined as ffa14ae6-48f5-42a4-8a22-186f2e5c7db0 |