在 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 (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.

觀賞如何建立三向鏡像磁碟區的快速影片。Watch a quick video on how to create a three-way mirror volume.

建立鏡像加速同位磁片區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.

觀看有關如何建立鏡像加速同位磁片區的快速影片。Watch a quick video on how to create a mirror-accelerated parity volume.

開啟磁片區並新增檔案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.

觀賞如何開啟磁片區和新增檔案的快速影片。Watch a quick video on how to open a volume and add files.

開啟重復資料刪除和壓縮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. 建議您使用 新的磁片 區 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: 磁碟區大小,例如 "10TB"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 TB" 磁碟機,定義為 1,000,000,000,000 位元組,為何在 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. 例如,指定 "909GB" 或 "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.

  • ResiliencySettingNameMirrorParityResiliencySettingName: 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.

為了協助您建立這類磁碟區,儲存空間直接存取提供稱為 PerformanceCapacity 的預設分層範本。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: