New-SCVirtualDiskDrive

Applies To: System Center 2012 - Virtual Machine Manager

New-SCVirtualDiskDrive

Creates a virtual disk drive object on a virtual machine deployed on a host managed by VMM, or on a template in the VMM library.

Syntax

Parameter Set: AnyHostDiskToJobGroupParamSetIDE
New-SCVirtualDiskDrive -AnyStorageDisk -Bus <Byte> -IDE -JobGroup <Guid> -LUN <Byte> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: AnyHostDiskToJobGroupParamSetSCSI
New-SCVirtualDiskDrive -AnyStorageDisk -Bus <Byte> -JobGroup <Guid> -LUN <Byte> -SCSI [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: AnyHostDiskToTemplateParamSetIDE
New-SCVirtualDiskDrive -AnyStorageDisk -Bus <Byte> -IDE -LUN <Byte> -VMTemplate <Template> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: AnyHostDiskToTemplateParamSetSCSI
New-SCVirtualDiskDrive -AnyStorageDisk -Bus <Byte> -LUN <Byte> -SCSI -VMTemplate <Template> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingHostVHDToVMParamSetIDE
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -IDE -LUN <Byte> -Path <String> -UseLocalVirtualHardDisk -VM <VM> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingHostVHDToVMParamSetIDEJobGroup
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -IDE -JobGroup <Guid> -LUN <Byte> -Path <String> -UseLocalVirtualHardDisk [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingHostVHDToVMParamSetSCSI
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -LUN <Byte> -Path <String> -SCSI -UseLocalVirtualHardDisk -VM <VM> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingHostVHDToVMParamSetSCSIJobGroup
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -JobGroup <Guid> -LUN <Byte> -Path <String> -SCSI -UseLocalVirtualHardDisk [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingVHDToJobGroupParamSetIDE
New-SCVirtualDiskDrive -Bus <Byte> -IDE -JobGroup <Guid> -LUN <Byte> -VirtualHardDisk <StandaloneVirtualHardDisk> [-BootVolume] [-FileName <String> ] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingVHDToJobGroupParamSetSCSI
New-SCVirtualDiskDrive -Bus <Byte> -JobGroup <Guid> -LUN <Byte> -SCSI -VirtualHardDisk <StandaloneVirtualHardDisk> [-BootVolume] [-FileName <String> ] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingVHDToTemplateParamSetIDE
New-SCVirtualDiskDrive -Bus <Byte> -IDE -LUN <Byte> -VirtualHardDisk <StandaloneVirtualHardDisk> -VMTemplate <Template> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingVHDToTemplateParamSetSCSI
New-SCVirtualDiskDrive -Bus <Byte> -LUN <Byte> -SCSI -VirtualHardDisk <StandaloneVirtualHardDisk> -VMTemplate <Template> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingVHDToVMParamSetIDE
New-SCVirtualDiskDrive -Bus <Byte> -IDE -LUN <Byte> -VirtualHardDisk <StandaloneVirtualHardDisk> -VM <VM> [-BootVolume] [-FileName <String> ] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: existingVHDToVMParamSetSCSI
New-SCVirtualDiskDrive -Bus <Byte> -LUN <Byte> -SCSI -VirtualHardDisk <StandaloneVirtualHardDisk> -VM <VM> [-BootVolume] [-FileName <String> ] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: HostDiskToJobGroupParamSetIDE
New-SCVirtualDiskDrive -Bus <Byte> -IDE -JobGroup <Guid> -LUN <Byte> -StorageDisk <StorageDisk> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: HostDiskToJobGroupParamSetSCSI
New-SCVirtualDiskDrive -Bus <Byte> -JobGroup <Guid> -LUN <Byte> -SCSI -StorageDisk <StorageDisk> [-BootVolume] [-FileName <String> ] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: HostDiskToVMParamSetIDE
New-SCVirtualDiskDrive -Bus <Byte> -IDE -LUN <Byte> -StorageDisk <StorageDisk> -VM <VM> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: HostDiskToVMParamSetSCSI
New-SCVirtualDiskDrive -Bus <Byte> -LUN <Byte> -SCSI -StorageDisk <StorageDisk> -VM <VM> [-BootVolume] [-FileName <String> ] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToJobGroupParamSetIDEDynamic
New-SCVirtualDiskDrive -Bus <Byte> -Dynamic -FileName <String> -IDE -JobGroup <Guid> -LUN <Byte> -VirtualHardDiskSizeMB <Int64> [-BootVolume] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToJobGroupParamSetIDEFixed
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -Fixed -IDE -JobGroup <Guid> -LUN <Byte> -VirtualHardDiskSizeMB <Int64> [-BootVolume] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToJobGroupParamSetSCSIDynamic
New-SCVirtualDiskDrive -Bus <Byte> -Dynamic -FileName <String> -JobGroup <Guid> -LUN <Byte> -SCSI -VirtualHardDiskSizeMB <Int64> [-BootVolume] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToJobGroupParamSetSCSIFixed
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -Fixed -JobGroup <Guid> -LUN <Byte> -SCSI -VirtualHardDiskSizeMB <Int64> [-BootVolume] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToTemplateParamSetIDEDynamic
New-SCVirtualDiskDrive -Bus <Byte> -Dynamic -FileName <String> -IDE -LUN <Byte> -VirtualHardDiskSizeMB <Int64> -VMTemplate <Template> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToTemplateParamSetIDEFixed
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -Fixed -IDE -LUN <Byte> -VirtualHardDiskSizeMB <Int64> -VMTemplate <Template> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToTemplateParamSetSCSIDynamic
New-SCVirtualDiskDrive -Bus <Byte> -Dynamic -FileName <String> -LUN <Byte> -SCSI -VirtualHardDiskSizeMB <Int64> -VMTemplate <Template> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToTemplateParamSetSCSIFixed
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -Fixed -LUN <Byte> -SCSI -VirtualHardDiskSizeMB <Int64> -VMTemplate <Template> [-BootVolume] [-JobVariable <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToVMParamSetIDEDynamic
New-SCVirtualDiskDrive -Bus <Byte> -Dynamic -FileName <String> -IDE -LUN <Byte> -VirtualHardDiskSizeMB <Int64> -VM <VM> [-BootVolume] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToVMParamSetIDEFixed
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -Fixed -IDE -LUN <Byte> -VirtualHardDiskSizeMB <Int64> -VM <VM> [-BootVolume] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToVMParamSetSCSIDynamic
New-SCVirtualDiskDrive -Bus <Byte> -Dynamic -FileName <String> -LUN <Byte> -SCSI -VirtualHardDiskSizeMB <Int64> -VM <VM> [-BootVolume] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Parameter Set: newToVMParamSetSCSIFixed
New-SCVirtualDiskDrive -Bus <Byte> -FileName <String> -Fixed -LUN <Byte> -SCSI -VirtualHardDiskSizeMB <Int64> -VM <VM> [-BootVolume] [-JobVariable <String> ] [-Path <String> ] [-PROTipID <Guid> ] [-ReturnImmediately] [-RunAsynchronously] [-StorageClassification <StorageClassification> ] [-SystemVolume] [-VMMServer <ServerConnection> ] [-VolumeType <VolumeType> ] [ <CommonParameters>]

Detailed Description

The New-SCVirtualDiskDrive cmdlet creates a virtual disk drive object on a virtual machine deployed on a host managed by System Center Virtual Machine Manager (VMM), or creates a virtual disk drive object on a template in the VMM library.

A virtual hard disk file (a Windows-based .vhd file or a VMware-based.vmdk file) that is stored on a VMM library share, but is not attached to a virtual disk drive, exists as a standalone object in the library.

A pass-through disk is a disk on a Hyper-V or VMware ESX host that a virtual machine on that host can use as an alternative to using a virtual hard disk. The corresponding term used by VMware for a pass-through disk is Raw Device Mapping, or RDM. The host disk can be either a hard disk on the host or a logical unit on a Storage Area Network (SAN). VMM lets the virtual machine bypass the host's file system and access the pass-through disk directly.

TYPE OF HOST PASS-THROUGH DISK SUPPORT

------------ -------------------------

Hyper-V Supports pass-through disks

Hyper-V Supports converting a pass-through disk to a VHD

VMware ESX Supports pass-through disks (RDP), but not disk conversion

Citrix XenServer Does not support pass-through disks

NOTE: You cannot create a checkpoint of a pass-through disk because checkpoint creation is designed to work with virtual hard disks.

For more information about New-SCVirtualDiskDrive, type: "Get-Help New-SCVirtualDiskDrive -online".

Parameters

-AnyStorageDisk

Identifies a placeholder parameter that is used to indicate the creation of pass-through disks within a new virtual machine job group.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-BootVolume

Indicates that the volume attached to the VirtualDiskDrive is a boot volume.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Bus<Byte>

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.

Example format: -IDE -Bus 1 -LUN 0

Example format: -SCSI -Bus 0 -LUN 1

NOTE: See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Dynamic

Specifies that a virtual hard disk can expand dynamically.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-FileName<String>

Specifies the file name to use when you rename a virtual hard disk file as you add it to a virtual machine.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Fixed

Specifies that a virtual hard disk is fixed in size.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IDE

Specifies IDE as the bus type to which to attach a virtual disk drive object or a virtual DVD drive object configured on a virtual machine or on a template.

Example format: -IDE "Bus 0 "LUN 1

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobGroup<Guid>

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.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LUN<Byte>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Path<String>

Specifies the destination path for the operation.

Example formats:

Local path -Path "F:\"

UNC path -Path "\\Library\Templates"

Volume GUID path -Path "\\?\Volume{4703c1ea-8ae7-11db-b473-00123f7603e3}\"

VMware ESX path "Path "[storage1]\MyVMwareFolderForVMs\MyVM.vmx"

Citrix XenServer path - Path "Local storage[99b6212f-b63d-c676-25f9-d6c460992de7]"

Wildcards are supported for "Get" cmdlets and when you specify the UNC path:

Example format:

UNC path -Path "\\VMHostServer\MyVMs\*VM*"

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-PROTipID<Guid>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ReturnImmediately

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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.

Example format: -SCSI -Bus 0 -LUN 0

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-StorageClassification<StorageClassification>

Specifies a storage classification object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StorageDisk<StorageDisk>

Specifies a disk on a Hyper-V or VMware ESX host that a virtual machine on that host can use instead of using a virtual hard disk. This disk is referrred to as a pass-through disk (the corresponding VMware term is Raw Device Mapping, or RDM). The host disk is either a local hard disk or a logical unit on a Storage Area Network (SAN). VMM lets the virtual machine bypass the host's file system and access the pass-through disk directly.

TYPE OF HOST PASS-THROUGH DISK SUPPORT

------------ -------------------------

Hyper-V Supports pass-through disks

Supports converting a pass-through disk to a VHD

VMware ESX Supports pass-through disks (RDP), but not disk conversion

Citrix XenServer Does not support pass-through disks

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-SystemVolume

Indicates that the volume attached to the VirtualDiskDrive is a system volume.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UseLocalVirtualHardDisk

Verifies that the VHD file (or files) to be used to create the virtual machine exist and are stored on the destination host.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-VirtualHardDisk<StandaloneVirtualHardDisk>

Specifies a virtual hard disk object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-VirtualHardDiskSizeMB<Int64>

Specifies, in megabytes (MB), the size of a fixed virtual hard disk file or the maximum possible size of a dynamically expanding virtual hard disk file.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VM<VM>

Specifies a virtual machine object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-VMTemplate<Template>

Specifies a VMM template object used to create virtual machines.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-VolumeType<VolumeType>

Specifies the volume type for a virtual hard disk. Valid values: Boot, System, BootAndSystem, None.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • VirtualDiskDrive

Notes

  • Requires a VMM virtual hard disk object, which can be retrieved by using the Get-SCVirtualHardDisk cmdlet.

Examples

1: Create a virtual disk drive on a template and attach an existing virtual hard disk to the virtual disk drive.

The first command gets the virtual hard disk object named "Blank Disk - Small" from the VMM library stores the object in the $VHD variable.

The second command gets the virtual machine template object named VMTemplate01 from the library stores the in the $Template variable.

The last command creates a new virtual disk drive on VMTemplate01 and attaches the virtual hard disk stored in $VHD to the second channel in the second slot of the IDE bus on the virtual disk drive.

PS C:\> $VHD = Get-SCVirtualHardDisk -Name "Blank Disk - Small"
PS C:\> $VMTemplate = Get-SCVMTemplate | where {$_.Name -eq "VMTemplate01"}
PS C:\> New-SCVirtualDiskDrive -VMTemplate $VMTemplate -IDE -Bus 1 -Lun 1 -VirtualHardDisk $VHD

2: Create a new virtual disk drive and add it to an existing virtual machine.

The first command gets the virtual machine object named VM01 and stores the object in the $VM variable.

The second command creates a new dynamic virtual disk drive on the first IDE channel in the second slot of the virtual machine and specifies its size as 19.5 GB.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> New-SCVirtualDiskDrive -VM $VM -Dynamic -Filename "Test" -IDE -Size 20000 -Bus 0 -LUN 1

3: Create a new virtual disk drive from an existing VHD and attach it to a new virtual machine.

The first command generates a new globally unique identifier (GUID) and stores the GUID string in variable $JobGroupID. The job group ID functions as an identifier that groups subsequent commands that include $JobGroupID into a single job group.

The second command gets the virtual hard disk object from the VMM library location \\LibraryServer01.Contoso.com\MSSCVMMLibrary\VHDs\Blank Disk - Large.vhd and stores the object in the $VHD variable.

The third command creates a new virtual hard disk drive object and assignes the new object to IDE Bus 0 and LUN 1. This command also attaches the virtual hard disk stored in $VHD to the new object. By using the JobGroup parameter, this command will run just before the last command that invokes the JobGroup and associate the new virtual hard drive object with the new virtual machine created in the last command.

The fourth command gets the hardware profile object that contains the string "NewHWProfile01" in its name and stores the object in the $HwProfile variable.

The fifth command gets the host object named VMHost03, stores the host object in the $VMHost variable.

The last command creates a new virtual machine named VM10 using the hardware settings stored in $HWProfile, deploys the virtual machine on VMHost03, and specifies that the virtual machine is not automatically started when the host starts and is put into a saved state when the virtualization service stops. This command uses the JobGroup parameter to indicate that that any previous cmdlets that use the same JobGroup ID is run prior to creating the new virtual machine. In this case, the New-SCVirtualDiskDrive cmdlet from the third command creates a virtual disk drive and associates it with the new virtual machine.

PS C:\> $JobGroupID = [Guid]::NewGuid().ToString()
PS C:\> $VHD = Get-SCVirtualHardDisk -VMMServer "VMMServer01.Contoso.com" | where {$_.Location -eq "\\LibServer01.Contoso.com\MSSCVMMLibrary\VHDs\Blank Disk - Large.vhd"}
PS C:\> New-SCVirtualDiskDrive -IDE -Bus 0 -LUN 1 -JobGroup $JobGroupID -VirtualHardDisk $VHD
PS C:\> $HWProfile = Get-SCHardwareProfile | where {$_.Name -match "NewHWProfile01"}
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost03"
PS C:\> New-SCVirtualMachine -Name "VM10" -Description "New Virtual Machine VM10" -VMMServer "VMMServer01.Contoso.com" -Owner "Contoso\Katarina" -VMHost $VMHost -Path "D:\VirtualMachinePath" -HardwareProfile $HWProfile -JobGroup $JobGroupID -RunAsynchronously -StartAction NeverAutoTurnOnVM -StopAction SaveVM

4. Create a new virtual disk drive using a host disk and attach it to an existing virtual machine.

The first command gets the virtual machine object named VM04 and stores the object in the $VM variable.

The second command gets the host object named VMHost04 and stores the object in the $VMHost variable.

The third command gets all storage disk objects on VMHost04 that are pass-through capable and stores the objects in the $HostDisk variable. Using the "@" symbol and parentheses ensures that the command stores the results in an array, in case the command returns a single object or a null value.

The last command creates a new virtual disk drive object that is connected to a physical host disk on VMHost04. The virtual disk drive is attached to the second slot of the first SCSI bus on VM04. This example assumes the virtual machine already has a SCSI controller.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM04"
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost04.Contoso.com"
PS C:\> $HostDisk = @(Get-SCStorageDisk -VMHost $VMHost | where {$_.IsPassThroughCapable -eq $True})
PS C:\> New-SCVirtualDiskDrive -VM $VM -HostDisk $HostDisk[0] -SCSI -Bus 0 -LUN 1

Compress-SCVirtualDiskDrive

Convert-SCVirtualDiskDrive

Expand-SCVirtualDiskDrive

Get-SCVirtualDiskDrive

Get-SCVirtualHardDisk

Move-SCVirtualHardDisk

Remove-SCVirtualDiskDrive

Remove-SCVirtualHardDisk

Set-SCVirtualDiskDrive

Set-SCVirtualHardDisk