New-SCStorageFileShare
在 VMM 中创建存储文件共享。
语法
New-SCStorageFileShare
[-VMMServer <ServerConnection>]
-StorageFileServer <StorageFileServer>
-Name <String>
[-Description <String>]
-LocalPath <String>
[-ContinuouslyAvailable <Boolean>]
[-StorageClassification <StorageClassification>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCStorageFileShare
[-VMMServer <ServerConnection>]
-StorageFileServer <StorageFileServer>
-Name <String>
[-Description <String>]
-StoragePool <StoragePool>
[-FileSystem <String>]
[-DedupMode <DedupMode>]
[-AllocationUnitSizeKB <UInt32>]
[-StorageClassification <StorageClassification>]
[-ReadCacheSizeMB <UInt64>]
-JobGroup <Guid>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCStorageFileShare
[-VMMServer <ServerConnection>]
-StorageFileServer <StorageFileServer>
-Name <String>
[-Description <String>]
-StoragePool <StoragePool>
[-FileSystem <String>]
[-ResiliencySettingName <String>]
[-NumberOfColumns <UInt16>]
[-PhysicalDiskRedundancy <UInt16>]
[-DedupMode <DedupMode>]
[-AllocationUnitSizeKB <UInt32>]
-SizeMB <UInt64>
[-StorageClassification <StorageClassification>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCStorageFileShare
[-VMMServer <ServerConnection>]
-StorageFileServer <StorageFileServer>
-Name <String>
[-Description <String>]
-StoragePool <StoragePool>
[-FileSystem <String>]
[-ResiliencySettingName <String>]
[-NumberOfColumns <UInt16>]
[-PhysicalDiskRedundancy <UInt16>]
[-DedupMode <DedupMode>]
[-AllocationUnitSizeKB <UInt32>]
[-StorageClassification <StorageClassification>]
-MediaType <StoragePhysicalDiskMediaType[]>
-StorageTierSizeMB <UInt64[]>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCStorageFileShare
[-VMMServer <ServerConnection>]
-StorageFileServer <StorageFileServer>
-Name <String>
[-Description <String>]
-StorageVolume <StorageVolume>
[-StorageClassification <StorageClassification>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCStorageFileShare
[-VMMServer <ServerConnection>]
-StorageFileServer <StorageFileServer>
-Name <String>
[-Description <String>]
-HostedStoragePool <String>
-SizeMB <UInt64>
[-StorageClassification <StorageClassification>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
说明
New-SCStorageFileShare cmdlet 在 Virtual Machine Manager (VMM) 中创建存储文件共享。
示例
示例 1:创建存储文件共享
PS C:\> $FileServer = Get-SCStorageFileServer -Name "FileServer01.Contoso.com"
PS C:\> New-SCStorageFileShare -Name "FileShare02" -StorageFileServer $FileServer -LocalPath "C:\FileShare02"
第一个命令获取名为 FileServer01 的存储文件服务器对象,并将对象存储在$FileServer变量中。
第二个命令在 FileServer01 上创建名为 FileShare02 的存储文件共享。
示例 2:在共享 SOFS 上创建分层存储文件共享
PS C:\> $FileServer = Get-SCStorageFileServer -Name "FileServer01.Contoso.com"
PS C:\> $StoragePool = Get-SCStoragePool -Name "Pool01"
PS C:\> New-SCStorageTier -MediaType "SSD" -SizeMB 1024 -PhysicalDiskRedundancy "2" -ResiliencySettingName "Mirror" -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e6-64a54012dce3"
PS C:\> New-SCStorageTier -MediaType "HDD" -SizeMB 1024 -PhysicalDiskRedundancy "2" -ResiliencySettingName "Parity" -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e6-64a54012dce3"
PS C:\> $StorageClassification = Get-SCStorageClassification -Name "Gold"
PS C:\> $StorageFileShare = New-SCStorageFileShare -StorageFileServer $FileServer -StoragePool $StoragePool -Name "FileShare01" -Description "shared SOSF" -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e664a54012dce3" -FileSystem "CSVFS_ReFS" -StorageClassification $StorageClassification
第一个命令获取名为 FileServer01 的存储文件服务器对象,然后将其存储在$FileServer变量中。
第二个命令获取名为 Pool01 的存储池,然后将其存储在$StoragePool变量中。
第三和第四个命令创建存储层。
第五个命令获取名为 Gold 的存储分类,然后将其存储在$StorageClassification变量中。
最后一个命令创建名为 FileShare01 的分层文件共享。 该命令使用在前面的命令中创建的值。
示例 3:在 S2D 系统上创建分层存储文件共享
PS C:\> $FileServer = Get-SCStorageFileServer -Name "FileServer01.Contoso.com"
PS C:\> $StoragePool = Get-SCStoragePool -Name "S2DPool01"
PS C:\> New-SCStorageTier -StorageTierFriendlyName "Performance" -StorageTierSizeInMB 1024 -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e6-64a54012dce3"
PS C:\> New-SCStorageTier -StorageTierFriendlyName "Capacity" -StorageTierSizeInMB 1024 -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e6-64a54012dce3"
PS C:\> $StorageClassification = Get-SCStorageClassification -Name "Gold"
PS C:\> $StorageFileShare = New-SCStorageFileShare -StorageFileServer $FileServer -StoragePool $StoragePool -Name "FileShare01" -Description "storage spaces direct config" -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e664a54012dce3" -FileSystem "CSVFS_ReFS" -StorageClassification $StorageClassification"
第一个命令获取名为 FileServer01 的存储文件服务器对象,然后将其存储在$FileServer变量中。
第二个命令获取名为 S2DPool01 的存储池,然后将其存储在$StoragePool变量中。 这是存储空间直通池。
第三和第四个命令创建存储层。
第五个命令获取名为 Gold 的存储分类,然后将其存储在$StorageClassification变量中。
最后一个命令创建名为 FileShare01 的分层文件共享。 该命令使用在前面的命令中创建的值。
参数
-AllocationUnitSizeKB
指定卷的分配大小(以 KB 为单位)。
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ContinuouslyAvailable
指示文件共享是否连续可用。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DedupMode
根据工作负荷对卷或文件共享应用重复数据删除。 此参数的可接受值为:
- 0 - 已禁用
- 1 - GeneralPurpose
- 2 - Hyper-V
- 3 - 备份
Type: | DedupMode |
Accepted values: | Disabled, GeneralPurpose, HyperV, Backup, NotAvailable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
指定存储文件共享的说明。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FileSystem
指定存储卷的文件系统。 此参数的可接受值为:
- CSVFS_NTFS
- CSVFS_ReFS
Type: | String |
Accepted values: | CSVFS_NTFS, CSVFS_ReFS |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-HostedStoragePool
指定托管存储池。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobGroup
在运行最后一个包含相同作业组标识符的命令之前,为作为集合运行的一系列命令指定标识符。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LocalPath
指定存储文件共享的本地路径。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MediaType
指定存储物理磁盘媒体类型对象的数组。
Type: | StoragePhysicalDiskMediaType[] |
Accepted values: | Unknown, HDD, SSD |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定 VMM 对象的名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NumberOfColumns
指定虚拟磁盘的列数。
Type: | UInt16 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PhysicalDiskRedundancy
指定虚拟磁盘可以维持的物理磁盘故障数。
Type: | UInt16 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。 此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ReadCacheSizeMB
Type: | UInt64 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResiliencySettingName
指定虚拟磁盘的复原设置。 此参数的可接受值为:
- 简单
- 镜像
- Parity
Type: | String |
Accepted values: | Simple, Mirror, Parity |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业异步运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SizeMB
指定存储文件共享的大小(以 MB 为单位)。
Type: | UInt64 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageClassification
指定存储分类对象。
Type: | StorageClassification |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageFileServer
指定存储文件服务器对象。
Type: | StorageFileServer |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StoragePool
指定存储池对象。
Type: | StoragePool |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageTierSizeMB
指定存储层大小(以 MB 为单位)。
Type: | UInt64[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageVolume
指定特定虚拟机主机上的存储卷对象。
Type: | StorageVolume |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定VMM 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |