How to create a Storage Pool using PowerShell
In this post, I want to show you how to create a Storage Pool with Powershell; the cmdlet that I will use is: New-StoragePool To create a Storage Pool with PowerShell, use the New-StoregePool cmdlet with the following syntax:
New-StoragePool `
-FriendlyName <String> `
-StorageSubSystemFriendlyName <String[]> `
-PhysicalDisks <CimInstance[]>
To obtain the correct designations for the storage subsystem and the physical disk, use these cmdlets: Get-StorageSubsystem and Get-PhysicalDisk
Get-StorageSubSystem
Get-PhysicalDisk `
| Sort-Object Friendlyname
The following command generates a list of all the physical disks in the system available for pooling and assigns it to the variable $disks and then creates a new storage pool, specifying the $disk variable to the -PhysicalDisk parameter. Run the PowerShell console as administrator, and then type:
$disks = Get-PhysicalDisk `
-CanPool $true
New-StoragePool `
-FriendlyName "StoragePool-01" `
-StorageSubSystemFriendlyName "Storage Spaces on vDC01-N" `
-PhysicalDisks $disks
The New-Storage Pool cmdlet also accepts the following options, which are not available in the Server Manager wizard.
- -EnclosureAwareDefault
- This enables the pool to use additional information provided by the enclosure.
- Type: Boolean.
- -ProvisioningTypeDefault
- Specifies the type of provisioning to be used to create virtual disks from this pool.
- Type: ProvisioningType Parameter.
- Sets: Unknown, Thin, Fixed.
- -ResiliencySettingNameDefault
- Specifies the resiliency setting that the system should use by default when creating virtual disks from the pool.
- Type: String Parameter .
- Sets: Simple, Mirror, Parity.
If you want to know more about the New-StoragePool cmdlet, check out this link.