The Set-SCVirtualDiskDrive cmdlet modifies settings of a virtual disk drive object on a virtual machine or on a virtual machine template in a Virtual Machine Manager (VMM) environment.
You can use this cmdlet to change the Bus type (IDE or SCSI), or to change the Bus and LUN settings to connect a virtual disk drive to a different location on the bus.
Examples
Example 1: Change the IDE bus and LUN settings for a virtual disk drive
The first command gets the virtual machine object VM01 by using the Get-SCVirtualMachine cmdlet.
The command stores that object in the $VM variable.
The second command gets the virtual disk drive object on VM01, and then stores the object in $VirtDiskDrive.
Using the @ symbol and parentheses make sure that the command stores the results in an array even if the command returns a single object or a $Null value.
The last command sets the Bus value to 0 and sets the LUN value to 0 for the virtual disk drive on VM01, if the virtual machine has only one virtual disk drive and is located on the second slot of the first IDE channel.
Example 2: Change the bus type for a virtual disk drive from SCSI to IDE
The first command gets the virtual machine object named VM02, and then stores that object in the $VM variable.
The second command gets all virtual disk drive objects configured for the virtual machine stored in $VM, and stores those virtual disk drive objects in the $VirtDiskDrive object array.
This example assumes that the virtual disk drive is on a SCSI bus.
The last command sets the Bus type to IDE.
The command connects the second virtual disk drive, specified by $VirtDiskDrive[1], to Primary Channel (1) and slot 2, specified by -Bus 0 and LUN 1.
Parameters
-Bus
Specifies the IDE bus to which to attach a virtual disk 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
-CreateDiffDisk
Indicates whether the cmdlet creates a differencing disk.
Parameter properties
Type:
Boolean
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
-DisableStorageQoS
Indicates this cmdlet disables storage Quality of Service (QoS) standards.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
DisableStorageQoS
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-IDE
Indicates that IDE is the bus type to which to attach a virtual disk drive object configured on a virtual machine or on a template.
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
-IOPSMaximum
Specifies the maximum IOPS.
Parameter properties
Type:
UInt64
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
IOPSMaximum
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-JobGroup
Specifies an identifier for a series of commands that 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
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-JobVariable
Specifies a variable in which job progress is tracked and stored.
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
-LUN
Specifies the logical unit number (LUN) for a virtual disk drive object or for a virtual disk drive object on a SCSI bus.
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
-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
-SCSI
Specifies SCSI as the bus type to which to attach a virtual disk drive object configured on a virtual machine or on a template.
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
-SharedStorage
Indicates whether the virtual disk drive uses shared storage.
Parameter properties
Type:
Boolean
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
-StorageClassification
Specifies a storage classification object.
Parameter properties
Type:
StorageClassification
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
-StorageQoSPolicy
Specifies a storage QoS policy.
Parameter properties
Type:
StorageQoSPolicy
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
StorageQoSPolicy
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VirtualDiskDrive
Specifies a virtual disk drive object.
You can attach either a virtual hard disk or a pass-through disk to a virtual disk drive object.
Parameter properties
Type:
VirtualDiskDrive
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VolumeType
Specifies the volume type for a virtual hard disk.
The acceptable values for this parameter are:
Boot
System
BootAndSystem
None
Parameter properties
Type:
VolumeType
Default value:
None
Accepted values:
None, Boot, System, BootAndSystem
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
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
VirtualDiskDrive
This cmdlet returns a VirtualDiskDrive object.
Notes
This cmdlet requires a VMM virtual disk drive object, which can be retrieved by using the Get-SCVirtualDiskDrive cmdlet.