IVMHardDiskConnection::SetBusLocation method

The SetBusLocation method sets the bus location to which this hard disk is attached.

Syntax

HRESULT SetBusLocation(
  [in] VMDriveBusType busType,
  [in] long           busNumber,
  [in] long           deviceNumber
);

Parameters

busType [in]

The type of bus to use.

busNumber [in]

Which bus number to use. If the busType is vmDriveBusTypeIDE, the busNumber must be in the range of 0 through 1. If the busType is vmDriveBusTypeSCSI, the busNumber must be in the range of 0 through 3.

deviceNumber [in]

Which device number to use on the selected bus. If the busType is vmDriveBusTypeIDE, the deviceNumber must be in the range of 0 through 1. If the busType is vmDriveBusTypeSCSI, the deviceNumber must be in the range of 0 through 6. If the busType is vmDriveBusTypeSCSI and the bus is being used for a shared SCSI bus, the deviceNumber must be 0.

Return value

This method can return one of these values.

Return code Description
S_OK
The operation was successful.
E_INVALIDARG
The bus location specified is invalid.
VM_E_VM_RUNNING
The bus location could not be set because the virtual machine is currently running.
VM_E_DRIVE_BUS_LOC_IN_USE
The bus location could not be set because another device is currently attached to this location.
VM_E_DRIVE_INVALID
The current drive is invalid.
VM_E_VM_UNKNOWN
The current virtual machine is invalid.
DISP_E_EXCEPTION
An unexpected error occurred.

Remarks

Only one disk device is allowed on a shared SCSI controller.

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

IVMHardDiskConnection

VMDriveBusType