New-StoragePool

New-StoragePool

Creates a new storage pool using a group of physical disks, and a specific storage subsystem exposed by a storage provider.

语法

Parameter Set: ByFriendlyName
New-StoragePool [-StorageSubSystemFriendlyName] <String[]> -FriendlyName <String> -PhysicalDisks <CimInstance[]> [-AsJob] [-AutoWriteCacheSize <Boolean> ] [-CimSession <CimSession[]> ] [-EnclosureAwareDefault <Boolean> ] [-LogicalSectorSizeDefault <UInt64> ] [-OtherUsageDescription <String> ] [-ProvisioningTypeDefault <ProvisioningType> ] [-ResiliencySettingNameDefault <String> ] [-ThrottleLimit <Int32> ] [-Usage <Usage> ] [-WriteCacheSizeDefault <UInt64> ] [ <CommonParameters>]

Parameter Set: ByName
New-StoragePool -FriendlyName <String> -PhysicalDisks <CimInstance[]> -StorageSubSystemName <String[]> [-AsJob] [-AutoWriteCacheSize <Boolean> ] [-CimSession <CimSession[]> ] [-EnclosureAwareDefault <Boolean> ] [-LogicalSectorSizeDefault <UInt64> ] [-OtherUsageDescription <String> ] [-ProvisioningTypeDefault <ProvisioningType> ] [-ResiliencySettingNameDefault <String> ] [-ThrottleLimit <Int32> ] [-Usage <Usage> ] [-WriteCacheSizeDefault <UInt64> ] [ <CommonParameters>]

Parameter Set: ByUniqueId
New-StoragePool -FriendlyName <String> -PhysicalDisks <CimInstance[]> -StorageSubSystemUniqueId <String[]> [-AsJob] [-AutoWriteCacheSize <Boolean> ] [-CimSession <CimSession[]> ] [-EnclosureAwareDefault <Boolean> ] [-LogicalSectorSizeDefault <UInt64> ] [-OtherUsageDescription <String> ] [-ProvisioningTypeDefault <ProvisioningType> ] [-ResiliencySettingNameDefault <String> ] [-ThrottleLimit <Int32> ] [-Usage <Usage> ] [-WriteCacheSizeDefault <UInt64> ] [ <CommonParameters>]

Parameter Set: InputObject (cdxml)
New-StoragePool -FriendlyName <String> -InputObject <CimInstance[]> -PhysicalDisks <CimInstance[]> [-AsJob] [-AutoWriteCacheSize <Boolean> ] [-CimSession <CimSession[]> ] [-EnclosureAwareDefault <Boolean> ] [-LogicalSectorSizeDefault <UInt64> ] [-OtherUsageDescription <String> ] [-ProvisioningTypeDefault <ProvisioningType> ] [-ResiliencySettingNameDefault <String> ] [-ThrottleLimit <Int32> ] [-Usage <Usage> ] [-WriteCacheSizeDefault <UInt64> ] [ <CommonParameters>]

详细说明

The New-StoragePool cmdlet creates a new storage pool using a group of physical disks, and a specific storage subsystem exposed by a storage provider.

参数

-AsJob

别名

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-AutoWriteCacheSize<Boolean>

Indicates whether to set the size of the write-back cache to 1 GB for all types of storage spaces, which include simple, mirror, and parity, to create from the pool. If the number or size of the solid-state drives (SSDs) or journal disks in the storage pool is not sufficient and you specify a value of $True for this parameter, the cmdlet sets the write-back cache size to 0 for simple and mirror spaces, and to 32 MB for parity spaces.

别名

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-CimSession<CimSession[]>

在远程会话中或在远程计算机上运行 cmdlet。输入计算机名称或会话对象,例如 New-CimSessionGet-CimSession cmdlet 的输出。默认为本地计算机上的当前会话。

别名

Session

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-EnclosureAwareDefault<Boolean>

Specifies the default allocation policy for virtual disks created in an enclosure-aware storage pool. For example, an enclosure-aware subsystem could balance each data copy of the virtual disk across multiple physical enclosures such that each enclosure contains a full data copy of the virtual disk.

别名

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-FriendlyName<String>

Specifies a friendly name for the storage pool to be created. The friendly name may be defined by a user and is not guaranteed to be unique.

别名

StoragePoolFriendlyName

是否为必需?

true

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-InputObject<CimInstance[]>

Accepts an object from the pipeline as input.

别名

是否为必需?

true

位置?

named

默认值

是否接受管道输入?

True (ByValue)

是否接受通配符?

false

-LogicalSectorSizeDefault<UInt64>

Specifies the default logical sector size to use for virtual disks created in this pool. Valid logical sector size values (in bytes) for virtual disks created by using the Storage Spaces subsystem are 512 and 4096.

别名

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-OtherUsageDescription<String>

Specifies the usage description for the storage pool.

别名

StoragePoolOtherUsageDescription

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-PhysicalDisks<CimInstance[]>

Accepts one or more PhysicalDisk objects as input. The Physical Disk CIM objects represent the physical disks to be added to the storage pool.

别名

是否为必需?

true

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-ProvisioningTypeDefault<ProvisioningType>

Specifies the default type of provisioning for virtual disks created in this pool. 此参数可接受的值如下: Unknown, Fixed or Thin.

别名

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-ResiliencySettingNameDefault<String>

Specifies the default resiliency setting name for virtual disks created in this pool.

别名

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-StorageSubSystemFriendlyName<String[]>

Specifies the friendly name of the storage subsystem on which you want to create the storage pool.

别名

是否为必需?

true

位置?

1

默认值

是否接受管道输入?

True (ByPropertyName)

是否接受通配符?

false

-StorageSubSystemName<String[]>

Specifies the name of the storage subsystem (provided by the Storage Management) on which you want to create the storage pool.

别名

是否为必需?

true

位置?

named

默认值

是否接受管道输入?

True (ByPropertyName)

是否接受通配符?

false

-StorageSubSystemUniqueId<String[]>

Specifies the ID of the storage subsystem on which you want to create the storage pool

别名

StorageSubsystemId

是否为必需?

true

位置?

named

默认值

是否接受管道输入?

True (ByPropertyName)

是否接受通配符?

false

-ThrottleLimit<Int32>

指定可建立的用于运行此 cmdlet 的并发操作的最大数目。如果省略了此参数或输入了值 0,那么 Windows PowerShell® 将基于正在计算机上运行的 CIM cmdlet 的数目,计算 cmdlet 的最佳中止值。中止值仅适用于当前 cmdlet,而不适用于会话或计算机。

别名

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

-Usage<Usage>

Specifies the usage setting for the storage pool. 此参数可接受的值如下: Other, ReservedAsDeltaReplicaContainer, ReservedForComputerSystem, ReservedForLocalReplicationServices, ReservedForMigrationServices, ReservedForRemoteReplicationServices, ReservedForSparing, and Unrestricted.

别名

StoragePoolUsage

是否为必需?

false

位置?

named

默认值

Other

是否接受管道输入?

false

是否接受通配符?

false

-WriteCacheSizeDefault<UInt64>

Specifies the default write-back cache size for virtual disks in the storage pool.

别名

是否为必需?

false

位置?

named

默认值

是否接受管道输入?

false

是否接受通配符?

false

<CommonParameters>

此 cmdlet 支持通用参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

输入

输入类型是指可通过管道传送给 cmdlet 的对象的类型。

输出

输出类型是 cmdlet 所发出对象的类型。

注意

  • Microsoft.Management.Infrastructure.CimInstance 对象是一个显示 Windows Management Instrumentation (WMI) 对象的包装类。井号 (#) 后的路径提供基础 WMI 对象的命名空间和类名称。

示例

Example 1: Create a new storage pool using Storage Spaces

This example creates a new storage pool named CompanyData using the Storage Spaces subsytem, using the minimum parameters, and assuming that there are no other storage subsystems attached to the computer that have available disks.

This line uses the Get-PhysicalDisk cmdlet to get all PhysicalDisk objects than are not yet in a (concrete) storage pool, and assigns the array of objects to the $PhysicalDisks variable.

PS C:\> $PhysicalDisks = (Get-PhysicalDisk -CanPool $True)

This line creates a new storage pool using the $PhysicalDisks variable to specify the disks to include from the Storage Spaces subsystem (specified with a wildcard * to remove the need to modify the friendly name for different computers).

PS C:\> New-StoragePool -FriendlyName CompanyData -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks $PhysicalDisks

Example 2: Create a new pool and set defaults for virtual disks

This example creates a new storage pool named CompanyData using the Storage Spaces subsystem and sets default values for virtual disk creation.

PS C:\> $PhysicalDisks = (Get-PhysicalDisk -CanPool $True)
PS C:\> New-StoragePool -FriendlyName CompanyData -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks $PhysicalDisks -ResiliencySettingNameDefault Mirror -ProvisioningTypeDefault Thin –Verbose

Example 3: Create a new storage pool, virtual disk, partition, and volume

This example creates a new storage pool, and then makes use of the pipeline to create a new virtual disk in the pool, initialize the disk, create a new partition on the disk, and then format the new partition (volume). Alternatively you can use the New-Volume cmdlet to achieve a similar result in a single command.

The first line ($PhysicalDisks =…) gets the storage subsystem object for the Storage Spaces subsystem, passes it to the Get-PhysicalDisk cmdlet, which then gets the physical disks in the specified subsystem that are available to add to a storage pool, and assigns these disks to the $PhysicalDisks variable.

The second line of the command has five parts, connected by the pipeline (|). The first part (New-StoragePool…) creates a new storage pool using the physical disks in the $PhysicalDisks variable, and then passes the new storage pool down the pipeline. All of the following commands are logically part of one command and should be entered as such.

The second part (New-VirtualDisk…) creates a new virtual disk on the passed in storage pool and then passes the new virtual disk down the pipeline.

The third part (Initialize-Disk…) initializes the disk that was passed in, and then passes the disk down the pipeline.

The fourth part (New-Partition…) creates a new partition on the disk that was passed in, assigns it the next available drive letter, and then passes the partition down the pipeline.

The final part of the command (Format-Volume) formats the partition that was passed in.

PS C:\> $PhysicalDisks = Get-StorageSubSystem -FriendlyName "Storage Spaces*" | Get-PhysicalDisk -CanPool $True 
PS C:\> New-StoragePool -FriendlyName "CompanyData" -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks $PhysicalDisks |New-VirtualDisk -FriendlyName "UserData" -Size 100GB -ProvisioningType Thin |Initialize-Disk -PassThru |New-Partition -AssignDriveLetter -UseMaximumSize |Format-Volume

相关主题

Get-PhysicalDisk

Get-StoragePool

Get-StorageSubsystem

New-Volume

Remove-StoragePool

Set-StoragePool