You are on page 1of 2

Firstly, list the available physical disks along with their status and their ability to participate

in storage pools (CanPool value). Get-PhysicalDisk:

In this example you will associate four physical disks in auto mode and one in hot spare
mode. To accomplish that you have to create a variable containing the four disks you want
to allocate, in auto mode, in a new storage pool.

In this example you want to include the physical disks 1-4 and not 5.

$PhysicalDisks=Get-PhysicalDisk -canpool $true | where-object{$_.FriendlyName -ne "PhysicalDisk5"}

Inject that variable into the new-StoragePool cmdlet by using the physicaldisks switch:

Add physical disk 5 as a hot spare: create a variable containing the physical disk 5 and then
feed that variable into the add-physicaldisk cmdlet

$PhysicalDiskAdd=get-physicaldisk -friendlyname PhysicalDisk5


add-PhysicalDisk -PhysicalDisks $PhysicalDiskAdd -StoragePoolFriendlyName "Storage Pool 1" Usage
HotSpare

Finally, to create the virtual disk, use the new-VirtualDisk cmdlet as shown below
You can check out the storage pool and the virtualdisk settings by using the get-
StoragePool|FL and the get-virtualDisk|FL cmdlets respectively.

As a final step you may use either diskpart or powershell commands to create the
appropriate volumes on these virtual drives.

You might also like