IVMVirtualMachine::AddDVDROMDrive method
The AddDVDROMDrive method adds a new CD or DVD drive to the virtual machine.
Syntax
HRESULT AddDVDROMDrive(
[in] VMDriveBusType busType,
[in] long busNumber,
[in] long deviceNumber,
[out] IVMDVDDrive **dvdDrive
);
Parameters
-
busType [in]
-
Bus to attach the CD or DVD drive to.
-
busNumber [in]
-
Bus number to attach the CD or DVD drive to. For IDE, this number can be 0-1. DVDROM drives cannot be attached to the SCSI bus.
-
deviceNumber [in]
-
Device number to attach the CD or DVD drive to. For IDE, this number can be 0-1. DVDROM drives cannot be attached to the SCSI bus.
-
dvdDrive [out]
-
A new IVMDVDDrive object.
Return value
This method can return one of these values.
Return code | Description |
---|---|
|
The operation was successful. |
|
dvdDrive is NULL. |
|
busType, busNumber, or deviceNumber is invalid. |
|
The configuration is unknown. |
|
Virtual machine is running or saved. |
|
The specified bus location is in use. |
|
Invalid drive specified. |
|
An unexpected error has occurred. |
Remarks
You can only add a new CD or DVD drive to a stopped virtual machine.
Examples
The following example adds a DVD drive to the secondary IDE controller as the primary device.
Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("Windows Server 2003")
Set objDVD = objVM.AddDVDROMDrive(0,1,0)
Requirements
Product |
Microsoft Virtual Server 2005 onWindows Server 2003 |
Download |
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003 |
Header |
|