在 Azure Stack HCI 中创建卷Create volumes in Azure Stack HCI

适用于:Azure Stack HCI 版本 20H2;Windows Server 2019Applies to: Azure Stack HCI, version 20H2; Windows Server 2019

本主题介绍如何使用 Windows Admin Center 和 Windows PowerShell 在 Azure Stack HCI 群集中创建卷、如何处理卷中的文件,以及如何在卷中启用重复数据删除和压缩。This topic describes how to create volumes on an Azure Stack HCI cluster by using Windows Admin Center and Windows PowerShell, how to work with files on the volumes, and how to enable data deduplication and compression on volumes. 若要了解如何为延伸群集创建卷并设置复制,请参阅创建延伸卷To learn how to create volumes and set up replication for stretched clusters, see Create stretched volumes.

创建三向镜像卷Create a three-way mirror volume

若要使用 Windows Admin Center 创建三向镜像卷:To create a three-way mirror volume using Windows Admin Center:

  1. 在 Windows Admin Center 中连接到存储空间直通群集,然后在“工具”窗格中选择“卷”。 In Windows Admin Center, connect to a Storage Spaces Direct cluster, and then select Volumes from the Tools pane.
  2. 在“卷”页上选择“库存”选项卡,然后选择“创建卷”。 On the Volumes page, select the Inventory tab, and then select Create volume.
  3. 在“创建卷”窗格中输入卷的名称,并将“复原”保留为“三向镜像”。 In the Create volume pane, enter a name for the volume, and leave Resiliency as Three-way mirror.
  4. 在“HDD 上的大小”中指定卷的大小。In Size on HDD, specify the size of the volume. 例如 5 TB。For example, 5 TB (terabytes).
  5. 选择“创建”。Select Create.

创建卷可能需要几分钟时间,具体取决于大小。Depending on the size, creating the volume can take a few minutes. 卷创建好之后,右上方会显示通知。Notifications in the upper-right will let you know when the volume is created. 新卷将显示在“库存”列表中。The new volume appears in the Inventory list.

创建镜像加速奇偶校验卷Create a mirror-accelerated parity volume

镜像加速奇偶校验可减少卷在 HDD 上的占用空间。Mirror-accelerated parity reduces the footprint of the volume on the HDD. 例如,三向镜像卷意味着每 10 TB 的卷大小需要 30 TB 的占用空间。For example, a three-way mirror volume would mean that for every 10 terabytes of size, you will need 30 terabytes as footprint. 为了减少占用空间开销,请创建使用镜像加速奇偶校验的卷。To reduce the overhead in footprint, create a volume with mirror-accelerated parity. 这样,即使只有 4 台服务器,也可以镜像最活跃的 20% 数据,然后使用空间效率更高的奇偶校验来存储剩余数据,从而将占用空间从 30 TB 减到 22 TB。This reduces the footprint from 30 terabytes to just 22 terabytes, even with only 4 servers, by mirroring the most active 20 percent of data, and using parity, which is more space efficient, to store the rest. 可以调整奇偶校验和镜像之比,在性能与容量方面做出最适合工作负荷的取舍。You can adjust this ratio of parity and mirror to make the performance versus capacity tradeoff that's right for your workload. 例如,使用 90% 的奇偶校验和 10% 的镜像所带来的性能效果不太理想,但可以进一步优化占用空间。For example, 90 percent parity and 10 percent mirror yields less performance but streamlines the footprint even further.

若要在 Windows Admin Center 创建使用镜像加速奇偶校验的卷:To create a volume with mirror-accelerated parity in Windows Admin Center:

  1. 在 Windows Admin Center 中连接到存储空间直通群集,然后在“工具”窗格中选择“卷”。 In Windows Admin Center, connect to a Storage Spaces Direct cluster, and then select Volumes from the Tools pane.
  2. 在“卷”页上选择“库存”选项卡,然后选择“创建卷”。 On the Volumes page, select the Inventory tab, and then select Create volume.
  3. 在“创建卷”窗格中输入卷的名称。In the Create volume pane, enter a name for the volume.
  4. 在“复原”中选择“镜像加速奇偶校验”。 In Resiliency, select Mirror-accelerated parity.
  5. 在“奇偶校验百分比”中选择奇偶校验的百分比。In Parity percentage, select the percentage of parity.
  6. 选择“创建”。Select Create.

打开卷并添加文件Open volume and add files

若要在 Windows Admin Center 中打开卷并将文件添加到卷:To open a volume and add files to the volume in Windows Admin Center:

  1. 在 Windows Admin Center 中连接到存储空间直通群集,然后在“工具”窗格中选择“卷”。 In Windows Admin Center, connect to a Storage Spaces Direct cluster, and then select Volumes from the Tools pane.

  2. 在“卷”页上选择“库存”选项卡。 On the Volumes page, select the Inventory tab.

  3. 在卷列表中,选择要打开的卷的名称。In the list of volumes, select the name of the volume that you want to open.

    在卷详细信息页上,可以看到卷的路径。On the volume details page, you can see the path to the volume.

  4. 在页面顶部选择“打开”。At the top of the page, select Open. 随即会在 Windows Admin Center 中启动“文件”工具。This launches the Files tool in Windows Admin Center.

  5. 导航到卷的路径。Navigate to the path of the volume. 可在此处浏览卷中的文件。Here you can browse the files in the volume.

  6. 选择“上传”,然后选择要上传的文件。Select Upload, and then select a file to upload.

  7. 使用浏览器中的“后退”按钮返回到 Windows Admin Center 中的“工具”窗格。 Use the browser Back button to go back to the Tools pane in Windows Admin Center.

启用重复数据删除和压缩Turn on deduplication and compression

重复数据删除和压缩是根据每个卷进行管理的。Deduplication and compression is managed per volume. 重复数据删除和压缩使用后处理模型,这意味着,在该功能运行之前,你看不到节省的空间。Deduplication and compression uses a post-processing model, which means that you won't see savings until it runs. 该功能在运行时会处理所有文件,甚至包括以前就已存在的文件。When it does, it'll work over all files, even those that were there from before.

若要了解详细信息,请参阅启用卷加密、重复数据删除和压缩To learn more, see Enable volume encryption, deduplication, and compression

使用 Windows PowerShell 创建卷Create volumes using Windows PowerShell

首先,从 Windows 的“开始”菜单启动 Windows PowerShell。First, launch Windows PowerShell from the Windows start menu. 建议使用 New-Volume cmdlet 来为 Azure Stack HCI 创建卷。We recommend using the New-Volume cmdlet to create volumes for Azure Stack HCI. 它可以提供最快且最直接的体验。It provides the fastest and most straightforward experience. 此单个 cmdlet 会自动创建虚拟磁盘,对其进行分区和格式化,使用匹配的名称创建卷,并将其添加到群集共享卷 - 这些全都在一个简单的步骤中完成。This single cmdlet automatically creates the virtual disk, partitions and formats it, creates the volume with matching name, and adds it to cluster shared volumes – all in one easy step.

New-Volume cmdlet 具有你将始终需要提供的四个参数:The New-Volume cmdlet has four parameters you'll always need to provide:

  • FriendlyName: 所需的任何字符串,例如 “Volume1”FriendlyName: Any string you want, for example "Volume1"

  • FileSystemCSVFS_ReFS(推荐)或 CSVFS_NTFSFileSystem: Either CSVFS_ReFS (recommended) or CSVFS_NTFS

  • StoragePoolFriendlyName: 你的存储池名称,例如 “S2D on ClusterName”StoragePoolFriendlyName: The name of your storage pool, for example "S2D on ClusterName"

  • Size: 卷的大小,例如 “10 TB”Size: The size of the volume, for example "10TB"


    Windows 以及 PowerShell 使用二进制(基数为 2)数字进行计数,而系统经常使用十进制(基数为 10)数字来标记驱动器。Windows, including PowerShell, counts using binary (base-2) numbers, whereas drives are often labeled using decimal (base-10) numbers. 这可以说明定义为 1,000,000,000,000 字节的“1 TB”驱动器在 Windows 中显示为大约“909 GB”的原因。This explains why a "one terabyte" drive, defined as 1,000,000,000,000 bytes, appears in Windows as about "909 GB". 这是正常情况。This is expected. 使用 New-Volume 创建卷时,你应使用二进制(基数为 2)数字指定 Size 参数。When creating volumes using New-Volume, you should specify the Size parameter in binary (base-2) numbers. 例如,指定“909 GB”或“0.909495TB”将创建大约 1,000,000,000,000 字节的卷。For example, specifying "909GB" or "0.909495TB" will create a volume of approximately 1,000,000,000,000 bytes.

示例:具有 2 个或 3 个服务器Example: With 2 or 3 servers

为使操作更简单,如果你的部署仅涉及两个服务器,则存储空间直通将自动使用双向镜像进行复原。To make things easier, if your deployment has only two servers, Storage Spaces Direct will automatically use two-way mirroring for resiliency. 如果你的部署仅涉及三个服务器,则它将自动使用三向镜像。If your deployment has only three servers, it will automatically use three-way mirroring.

New-Volume -FriendlyName "Volume1" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 1TB

示例:具有 4 个以上的服务器Example: With 4+ servers

如果你具有四个或更多个服务器,则可以使用可选的 ResiliencySettingName 参数来选择复原类型。If you have four or more servers, you can use the optional ResiliencySettingName parameter to choose your resiliency type.

  • ResiliencySettingName镜像奇偶校验ResiliencySettingName: Either Mirror or Parity.

在以下示例中,“Volume2” 使用三向镜像,“Volume3” 使用双奇偶校验(通常称为“擦除编码”)。In the following example, "Volume2" uses three-way mirroring and "Volume3" uses dual parity (often called "erasure coding").

New-Volume -FriendlyName "Volume2" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 1TB -ResiliencySettingName Mirror
New-Volume -FriendlyName "Volume3" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 1TB -ResiliencySettingName Parity

示例:使用存储层Example: Using storage tiers

在涉及三种驱动器类型的部署中,一个卷可以跨越 SSD 和 HDD 层以在每类驱动器上驻留一部分。In deployments with three types of drives, one volume can span the SSD and HDD tiers to reside partially on each. 同样,在涉及四个或更多个服务器的部署中,一个卷可以混合镜像和双奇偶校验以在每个服务器上驻留一部分。Likewise, in deployments with four or more servers, one volume can mix mirroring and dual parity to reside partially on each.

为了帮助你创建此类卷,存储空间直通会提供称为性能容量的默认层模板。To help you create such volumes, Storage Spaces Direct provides default tier templates called Performance and Capacity. 它们会在较快的容量驱动器(如果适用)上封装三向镜像的定义,在较慢的容量驱动器(如果适用)上封装双奇偶校验。They encapsulate definitions for three-way mirroring on the faster capacity drives (if applicable), and dual parity on the slower capacity drives (if applicable).

你可以通过运行Get-StorageTier cmdlet 查看它们。You can see them by running the Get-StorageTier cmdlet.

Get-StorageTier | Select FriendlyName, ResiliencySettingName, PhysicalDiskRedundancy

存储层 PowerShell 屏幕截图

若要创建分层卷,请使用 New-Volume cmdlet 的 StorageTierFriendlyNamesStorageTierSizes 参数引用这些层模板。To create tiered volumes, reference these tier templates using the StorageTierFriendlyNames and StorageTierSizes parameters of the New-Volume cmdlet. 例如,以下 cmdlet 会创建一个按 30:70 的比例混合三向镜像和双奇偶校验的卷。For example, the following cmdlet creates one volume which mixes three-way mirroring and dual parity in 30:70 proportions.

New-Volume -FriendlyName "Volume4" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -StorageTierFriendlyNames Performance, Capacity -StorageTierSizes 300GB, 700GB

大功告成!You're done! 根据需要重复操作以创建多个卷。Repeat as needed to create more than one volume.

后续步骤Next steps

有关相关主题和其他存储管理任务,另请参阅:For related topics and other storage management tasks, see also: