IVMVirtualMachine::RemoveHardDiskConnection method

The RemoveHardDiskConnection method removes the specified hard disk connection from the virtual machine.

Syntax

HRESULT RemoveHardDiskConnection(
  [in] IVMHardDiskConnection *hardDiskConnection
);

Parameters

hardDiskConnection [in]

Hard disk connection to remove from this virtual machine.

Return value

This method can return one of these values.

Return code Description
S_OK
The operation was successful.
E_POINTER
The hardDiskConnection parameter is NULL.
VM_E_VM_UNKNOWN
The configuration is unknown.
VM_E_VM_RUNNING
Virtual machine is running or saved.
VM_E_DRIVE_INVALID
Invalid drive specified (e.g. no hard disk is connected to this bus location).
DISP_E_EXCEPTION
An unexpected error has occurred.

Remarks

You can only remove an existing hard disk connection from a stopped virtual machine. A list of connections currently attached to the virtual machine is obtained by enumerating the HardDiskConnections property.

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

IVMVirtualMachine