The Set-SCVirtualDVDDrive cmdlet changes one or more properties of a virtual DVD drive object associated with a virtual machine, virtual machine template, or hardware profile used in a Virtual Machine Manager (VMM) environment.
You can use this cmdlet to connect a virtual DVD drive to a physical DVD drive on a virtual machine host server, to a different location on the IDE bus, or to an ISO image, or you can use it to disconnect the virtual DVD drive.
Most settings that you can configure for a virtual DVD drive on a virtual machine are the same regardless of whether the virtualization platform of the host is Hyper-V, VMware, or Citrix XenServer.
All of these virtualization platforms support the following:
Connecting a virtual DVD drive to a primary or secondary channel on a host.
Capturing information from a physical CD or DVD drive on the host without specifying a drive letter.
Capturing information from an image (ISO) file stored in the VMM library.
Capturing "no media" (used to disconnect a virtual DVD drive from the host drive or from an ISO file).
The only setting that varies for this cmdlet by virtualization platform is whether an ISO file can be used directly from the VMM library:
Hyper-V host.
If you configure a connection to an ISO file in the VMM library, you can choose to use the ISO directly from the library instead of copying it to the host.
VMware ESX host.
If you configure a connection to an ISO file in the VMM library, you cannot use the ISO directly from the library but must instead accept the default, which copies the ISO file to the host.
Citrix XenServer host.
If you configure a connection to an ISO file in the VMM library, you cannot use the ISO directly from the library but must instead accept the default, which copies the ISO file to the host.
The host must have at least one ISO repository available with write access and enough storage space to contain the ISO file.
Note: If the virtual DVD drive is configured on a virtual machine that was created by using the Virtual Machine wizard in the Hyper-V Manager Console rather than in the VMM console, you must specify a drive letter.
That drive letter will appear in the Properties for that virtual machine in the VMM console.
Examples
Example 1: Connect a virtual DVD drive to a physical DVD drive
The first command gets the virtual machine object named VM01 and stores the object in the $VM variable.
The second command gets the virtual DVD drive object that is located on Secondary Channel 0 (specified by -Bus 1 and -LUN 0) on the IDE bus on VM01 and stores the object in the $DVDDrive variable.
The last command connects the virtual DVD drive object stored in $DVDDrive to a physical drive on the host (the D: drive).
It also deletes any ISO file that the virtual DVD drive used earlier if no other virtual machine currently uses that ISO file.
Example 2: Connect a virtual DVD drive to a different location on the IDE bus
The command gets the virtual machine object named VM02 and stores the object in the $VM variable.
The second command gets the virtual DVD drive object that is located on Secondary Channel 0 (specified by -Bus 1 and -LUN 0) on the IDE bus on VM02 and then stores the virtual DVD drive object in $DVDDrive.
The last command connects the virtual DVD drive object stored in $DVDDrive to a different position on the IDE bus by setting the logical unit number (LUN) to 1.
The first command gets the virtual machine object named VM03 and stores the object in the $VM variable.
The second command gets the virtual DVD drive object that is located on Secondary Channel 0 (specified by -Bus 1 and -LUN 0) on the IDE bus on VM03 and then stores the virtual DVD drive object in $DVDDrive.
The last command uses the NoMedia parameter to disconnect the virtual DVD drive object stored in $DVDDrive from any host drive or ISO to which it is connected.
It also deletes any ISO file that the virtual DVD drive used earlier if no other virtual machine currently uses that ISO file.
Example 4: Connect a virtual DVD drive on an existing virtual machine to any available physical DVD drive
The first command gets the virtual machine object named VM04 and stores the object in the $VM variable.
The last command gets the virtual DVD drive object that is located on the first slot of the Secondary Channel (specified by -Bus 1 and -LUN 0) on the IDE bus on VM04.
The command uses the Set-SCVirtualDVDDrive cmdlet with the AnyVMHostDrive parameter to connect the virtual DVD drive to any available physical DVD drive on the host.
Parameters
-AnyVMHostDrive
Indicates that a virtual DVD or floppy drive on a virtual machine will be connected to any corresponding physical drive on a host.
This mapping occurs when you deploy a stored virtual machine on a host, or when you use a template or hardware profile to create and deploy a virtual machine on a host.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
AnyHostDrive
Parameter sets
AnyHostDriveWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
AnyHostDriveWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Bus
Specifies the IDE bus to which to attach a virtual disk drive or virtual DVD drive, or the SCSI bus to which to attach a virtual disk drive.
Parameter properties
Type:
Byte
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ISO
Specifies an ISO object.
Parameter properties
Type:
ISO
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ISOWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
ISOWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-JobGroup
Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.
Parameter properties
Type:
Guid
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
BusChangesWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
HostDriveWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NoMediaWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
AnyHostDriveWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ISOWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Link
Indicates that a resource should be linked to instead of copied.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ISOWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ISOWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-LUN
Specifies the logical unit number (LUN) for a virtual disk drive object or for a virtual DVD drive object on an IDE bus, or for a virtual disk drive object on a SCSI bus.
Example format: -IDE -Bus 1 -LUN 0
Example format: -SCSI -Bus 0 -LUN 1
Parameter properties
Type:
Byte
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-NoMedia
Disconnects a virtual DVD drive from the host drive or ISO to which it was connected, or disconnects a virtual floppy drive from the host drive or virtual floppy disk to which it was connected.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NoMediaWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NoMediaWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OnBehalfOfUser
Specifies a user name.
This cmdlet operates on behalf of the user that this parameter specifies.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OnBehalfOfUserRole
Specifies a user role.
To obtain a user role, use the Get-SCUserRole cmdlet.
This cmdlet operates on behalf of the user role that this parameter specifies.
Parameter properties
Type:
UserRole
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PROTipID
Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action.
This parameter lets you audit PRO tips.
Parameter properties
Type:
Guid
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-SourceBus
Specifies the source IDE bus for the drive.
Parameter properties
Type:
Byte
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NoMediaWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ISOWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
HostDriveWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
AnyHostDriveWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
BusChangesWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-SourceLUN
Specifies the source logical unit number (LUN) for a virtual DVD drive object on an IDE bus.
Parameter properties
Type:
Byte
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NoMediaWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ISOWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
HostDriveWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
AnyHostDriveWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
BusChangesWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VirtualDVDDrive
Specifies a virtual DVD drive object.
Parameter properties
Type:
VirtualDVDDrive
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
BusChangesWithVirtualDVDDriveSpecified
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
HostDriveWithVirtualDVDDriveSpecified
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
NoMediaWithVirtualDVDDriveSpecified
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
AnyHostDriveWithVirtualDVDDriveSpecified
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
ISOWithVirtualDVDDriveSpecified
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VMHostDrive
Specifies a drive on a virtual machine host.
Example formats:
Hyper-V host hard drive: "C:"
Hyper-V host floppy drive: "A:"
VMware ESX host hard drive: "/dev/tools"
VMware ESX host floppy drive: "/dev/sda"
Citrix XenServer host hard drive: "Local storage\[99b6212f-b63d-c676-25f9-d6c460992de7\]"
Citrix XenServer host floppy drive: Not supported
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
HostDrive
Parameter sets
HostDriveWithVirtualDVDDriveSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
HostDriveWithSourceBusAndLunSpecified
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
Outputs
VirtualDVDDrive
This cmdlet returns a VirtualDVDDrive object.
Notes
Requires a VMM virtual DVD drive object, which can be retrieved by using the Get-SCVirtualDVDDrive cmdlet.