Share via


IVMHardDisk::Compact method

The Compact method compacts a dynamically expanding hard disk image.

Syntax

HRESULT Compact(
  [out] IVMTask **compactTask
);

Parameters

compactTask [out]

The task which is used to track the completion the compaction process.

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
S_OK
The operation was successful.
E_POINTER
The parameter compactTask is NULL.
VM_E_INVALID_HD_FILE
The virtual hard disk image referenced by this IVMHardDisk object does not seem to be a valid image.
E_SHARING_VIOLATION
The virtual hard disk image referenced by this IVMHardDisk object is in use.
VM_E_WRONG_HD_IMAGE_TYPE
The virtual hard disk image referenced by this IVMHardDisk object must be a vmDiskTypeDynamic image type.
E_DISK_FULL
The host volume does not have enough space to create a temporary file needed for the compaction of this virtual hard disk image.
VM_E_APP_SHUTTING_DOWN
The virtual hard disk image cannot be compacted because the application is shutting down.
DISP_E_EXCEPTION
An unexpected error occurred.

Remarks

To compact a dynamically expanding hard disk image, free space on the disk image should first be zeroed.

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

See also

IVMHardDisk