How to Create a Storage Pool with PowerShell

The three things that are required are:
The storage pool name
Which disks to use to create the pool?
The storage subsystem (Storage Spaces)

The cmdlet we use to create the storage pool is New-StoragePool. While the only
The name of the storage pool will be passed through the “FriendlyName” parameter.

The disks to create the storage pool on will be passed into the New-StoragePool in the “PhysicalDisks” parameter. Which are either pooled, or can be made even easier using the “-IsPooled” parameter (which will either provide all of the disks that are already pooled, or if set to false will all return
The Get-PhysicalDisk cmdlet can be run as part of the -PhysicalDisk parameter, or can be run previously and the results stored in a variable. If creating a script that will be reused, it’s advisable to use a variable, so that it is easier to read and understand.

Code below:


$disk=Get-PhysicalDisk -FriendlyName PhysicalDisk16

New-StoragePool -FriendlyName Pool1 -StorageSubSystemUniqueId $s.UniqueId -PhysicalDisks $disk

That is all that is needed to create a basic storage pool. However, these optional parameters for New-StoragePool may provide some benefit.

You may also like

Deixe um comentário

O seu endereço de e-mail não será publicado.