部署儲存空間直接存取Deploy Storage Spaces Direct

適用於: Windows Server 2019、 Windows Server 2016Applies to: Windows Server 2019, Windows Server 2016

本主題提供部署儲存空間直接存取的逐步指示。This topic provides step-by-step instructions to deploy Storage Spaces Direct.


想要取得超融合式基礎結構嗎?Looking to acquire Hyper-Converged Infrastructure? Microsoft 建議這些Windows Server 軟體定義解決方案,由我們的合作夥伴。Microsoft recommends these Windows Server Software-Defined solutions from our partners. 它們是設計、 組合,且核對我們參考架構,以確保相容性和可靠性,因此您讓啟動和執行快速。They are designed, assembled, and validated against our reference architecture to ensure compatibility and reliability, so you get up and running quickly.


您可以使用 HYPER-V 虛擬機器,來評估儲存空間直接存取硬體不包括 Microsoft Azure 中。You can use Hyper-V virtual machines, including in Microsoft Azure, to evaluate Storage Spaces Direct without hardware. 您也可以檢閱方便Windows Server 快速實驗室部署指令碼,我們會使用基於訓練。You may also want to review the handy Windows Server rapid lab deployment scripts, which we use for training purposes.

開始之前Before you start

檢閱儲存空間直接存取硬體需求,並瀏覽這份文件來自行熟悉的整體的做法及與一些步驟相關聯的重要資訊。Review the Storage Spaces Direct hardware requirements and skim this document to familiarize yourself with the overall approach and important notes associated with some steps.

收集的下列資訊:Gather the following information:

  • 部署選項。Deployment option. 儲存空間直接存取的支援兩個部署選項: 超融合式和融合,也稱為分離。Storage Spaces Direct supports two deployment options: hyper-converged and converged, also known as disaggregated. 熟悉每決定最適合您的優點。Familiarize yourself with the advantages of each to decide which is right for you. 步驟 1-3 下列適用於這兩個部署選項。Steps 1-3 below apply to both deployment options. 步驟 4 僅用於交集的部署。Step 4 is only needed for converged deployment.

  • 伺服器名稱。Server names. 熟悉您組織的電腦、 檔案、 路徑及其他資源的命名原則。Get familiar with your organization's naming policies for computers, files, paths, and other resources. 您將需要佈建數部伺服器,每一個都有唯一的名稱。You'll need to provision several servers, each with unique names.

  • 網域名稱。Domain name. 熟悉您組織的網域命名原則和網域加入的原則。Get familiar with your organization's policies for domain naming and domain joining. 您將會將伺服器加入您的網域,且您必須指定網域名稱。You'll be joining the servers to your domain, and you'll need to specify the domain name.

  • RDMA 網路。RDMA networking. 有兩種類型的 RDMA 通訊協定: iWarp 和 RoCE。There are two types of RDMA protocols: iWarp and RoCE. 請注意使用哪一個網路介面卡,如果 RoCE,也請注意 (v1 或 v2) 的版本。Note which one your network adapters use, and if RoCE, also note the version (v1 or v2). 針對 RoCE,也請注意頂端的 rack 交換器的模型。For RoCE, also note the model of your top-of-rack switch.

  • VLAN 識別碼。VLAN ID. 如果有的話,請注意 VLAN 識別碼,用於管理作業系統在伺服器上的網路介面卡。Note the VLAN ID to be used for management OS network adapters on the servers, if any. 您應該能夠從您的網路管理員取得。You should be able to obtain this from your network administrator.

步驟 1︰部署 Windows ServerStep 1: Deploy Windows Server

步驟 1.1︰ 安裝作業系統Step 1.1: Install the operating system

第一個步驟是將會在叢集中每個伺服器上安裝 Windows Server。The first step is to install Windows Server on every server that will be in the cluster. 儲存空間直接存取需要 Windows Server 2016 Datacenter Edition。Storage Spaces Direct requires Windows Server 2016 Datacenter Edition. 您可以使用 [Server Core 安裝選項或伺服器含有桌面體驗。You can use the Server Core installation option, or Server with Desktop Experience.

當您安裝 Windows Server 使用安裝精靈時,您可以選擇Windows Server (Server Core 參考) 和Windows Server (含有桌面體驗的伺服器),這相當於 [完整] 安裝選項在 Windows Server 2012 R2 中使用。When you install Windows Server using the Setup wizard, you can choose between Windows Server (referring to Server Core) and Windows Server (Server with Desktop Experience), which is the equivalent of the Full installation option available in Windows Server 2012 R2. 如果您沒有選擇,您將取得的 Server Core 安裝選項。If you don't choose, you'll get the Server Core installation option. 如需詳細資訊,請參閱適用於 Windows Server 2016 的安裝選項For more information, see Installation Options for Windows Server 2016.

步驟 1.2: 連線到伺服器Step 1.2: Connect to the servers

本指南著重的 Server Core 安裝選項和個別的管理系統,必須從遠端部署/管理:This guide focuses the Server Core installation option and deploying/managing remotely from a separate management system, which must have:

  • Windows Server 2016 與它所管理之伺服器相同的更新Windows Server 2016 with the same updates as the servers it's managing
  • 若要管理之伺服器的網路連線Network connectivity to the servers it's managing
  • 加入相同的網域或完全受信任的網域Joined to the same domain or a fully trusted domain
  • 適用於 Hyper-V 和容錯移轉叢集的遠端伺服器管理工具 (RSAT) 和 PowerShell 模組。Remote Server Administration Tools (RSAT) and PowerShell modules for Hyper-V and Failover Clustering. RSAT 工具和 PowerShell 模組是適用於 Windows Server 可以安裝而不安裝其他功能。RSAT tools and PowerShell modules are available on Windows Server and can be installed without installing other features. 您也可以在 Windows 10 管理電腦上安裝遠端伺服器管理工具You can also install the Remote Server Administration Tools on a Windows 10 management PC.

在管理系統上,安裝容錯移轉叢集與 Hyper-V 管理工具。On the Management system install the Failover Cluster and Hyper-V management tools. 這可以透過伺服器管理員使用 「新增角色及功能」 精靈完成。This can be done through Server Manager using the Add Roles and Features wizard. [功能] 頁面上,選取 [遠端伺服器管理工具],然後選取要安裝的工具。On the Features page, select Remote Server Administration Tools, and then select the tools to install.

進入 PS 工作階段,並使用伺服器名稱,或是您要連線之節點的 IP 位址。Enter the PS session and use either the server name or the IP address of the node you want to connect to. 您可以執行此命令之後,將會提示輸入密碼,請輸入您指定 Windows 時的系統管理員密碼。You'll be prompted for a password after you execute this command, enter the administrator password you specified when setting up Windows.

Enter-PSSession -ComputerName <myComputerName> -Credential LocalHost\Administrator

以下是執行相同的動作的方式,是比較好用的指令碼,以防您需要執行此動作一次以上的範例:Here's an example of doing the same thing in a way that is more useful in scripts, in case you need to do this more than once:

$myServer1 = "myServer-1"
$user = "$myServer1\Administrator"

Enter-PSSession -ComputerName $myServer1 -Credential $user


如果您要從管理系統從遠端進行部署,您可能會收到以下錯誤WinRM 無法處理要求。If you're deploying remotely from a management system, you might get an error like WinRM cannot process the request. 若要修正這個問題,請將每個伺服器新增至信任主機清單在您的管理電腦上使用 Windows PowerShell:To fix this, use Windows PowerShell to add each server to the Trusted Hosts list on your management computer:

Set-Item WSMAN:\Localhost\Client\TrustedHosts -Value Server01 -Force

注意: 信任的主機清單支援萬用字元,例如Server*Note: the trusted hosts list supports wildcards, like Server*.

若要檢視您的信任主機清單,請輸入Get-Item WSMAN:\Localhost\Client\TrustedHostsTo view your Trusted Hosts list, type Get-Item WSMAN:\Localhost\Client\TrustedHosts.

若要空的清單,輸入Clear-Item WSMAN:\Localhost\Client\TrustedHostTo empty the list, type Clear-Item WSMAN:\Localhost\Client\TrustedHost.

步驟 1.3: 加入網域,並加入網域帳戶Step 1.3: Join the domain and add domain accounts

到目前為止您設定好的個別伺服器與本機系統管理員帳戶, <ComputerName>\AdministratorSo far you've configured the individual servers with the local administrator account, <ComputerName>\Administrator.

若要管理儲存空間直接存取,您將需要加入網域的伺服器,並使用 Active Directory Domain Services 的網域帳戶中的每一個伺服器上的 Administrators 群組。To manage Storage Spaces Direct, you'll need to join the servers to a domain and use an Active Directory Domain Services domain account that is in the Administrators group on every server.

從管理系統,請以系統管理員權限開啟 PowerShell 主控台。From the management system, open a PowerShell console with Administrator privileges. 使用Enter-PSSession連線至每個伺服器,並執行下列 cmdlet,以取代您自己的電腦名稱、 網域名稱及網域認證:Use Enter-PSSession to connect to each server and run the following cmdlet, substituting your own computer name, domain name, and domain credentials:

Add-Computer -NewName "Server01" -DomainName "contoso.com" -Credential "CONTOSO\User" -Restart -Force  

如果您的儲存體系統管理員帳戶不是網域系統管理員群組的成員,將您的儲存體系統管理員帳戶新增到本機 Administrators 群組內的每個節點上,或更棒的是,新增您用於儲存體系統管理員群組。If your storage administrator account isn't a member of the Domain Admins group, add your storage administrator account to the local Administrators group on each node - or better yet, add the group you use for storage administrators. 您可以使用下列命令 (或撰寫的 Windows PowerShell 函式,若要這樣做,-如需詳細資訊,請參閱使用 PowerShell 將網域使用者新增至本機群組):You can use the following command (or write a Windows PowerShell function to do so - see Use PowerShell to Add Domain Users to a Local Group for more info):

Net localgroup Administrators <Domain\Account> /add

步驟 1.4︰ 安裝角色和功能Step 1.4: Install roles and features

下一個步驟是在每個伺服器上安裝伺服器角色。The next step is to install server roles on every server. 您可以使用Windows Admin Center伺服器管理員),或 PowerShell。You can do this by using Windows Admin Center, Server Manager), or PowerShell. 以下是要安裝的角色:Here are the roles to install:

  • 容錯移轉叢集Failover Clustering
  • Hyper-VHyper-V
  • 檔案伺服器 (如果您想要裝載任何的檔案共用,例如交集的部署)File Server (if you want to host any file shares, such as for a converged deployment)
  • 資料中心橋接 (如果您正在使用 RoCEv2 而非 iWARP 網路介面卡)Data-Center-Bridging (if you're using RoCEv2 instead of iWARP network adapters)
  • RSAT-Clustering-PowerShellRSAT-Clustering-PowerShell
  • Hyper-V-PowerShellHyper-V-PowerShell

若要透過 PowerShell 安裝,請使用安裝 Add-windowsfeature cmdlet。To install via PowerShell, use the Install-WindowsFeature cmdlet. 您可以使用它,就像這樣在單一伺服器上:You can use it on a single server like this:

Install-WindowsFeature -Name "Hyper-V", "Failover-Clustering", "Data-Center-Bridging", "RSAT-Clustering-PowerShell", "Hyper-V-PowerShell", "FS-FileServer"

若要為相同的時間叢集中所有伺服器上執行命令,使用指令碼,修改的開頭的指令碼,以符合您的環境變數清單的這一小段。To run the command on all servers in the cluster as the same time, use this little bit of script, modifying the list of variables at the beginning of the script to fit your environment.

# Fill in these variables with your values
$ServerList = "Server01", "Server02", "Server03", "Server04"
$FeatureList = "Hyper-V", "Failover-Clustering", "Data-Center-Bridging", "RSAT-Clustering-PowerShell", "Hyper-V-PowerShell", "FS-FileServer"

# This part runs the Install-WindowsFeature cmdlet on all servers in $ServerList, passing the list of features into the scriptblock with the "Using" scope modifier so you don't have to hard-code them here.
Invoke-Command ($ServerList) {
    Install-WindowsFeature -Name $Using:Featurelist

步驟 2:設定網路Step 2: Configure the network

如果您要部署儲存空間直接存取虛擬機器內,請略過本節。If you're deploying Storage Spaces Direct inside virtual machines, skip this section.

儲存空間直接存取需要高頻寬、 低延遲叢集中的伺服器之間網路功能。Storage Spaces Direct requires high-bandwidth, low-latency networking between servers in the cluster. 至少 10 GbE 網路功能需要,且建議的遠端直接記憶體存取 (RDMA)。At least 10 GbE networking is required and remote direct memory access (RDMA) is recommended. 您可以使用 iWARP 或 RoCE,只要其具有 Windows Server 2016 標誌即可,但 iWARP 通常是簡單的設定。You can use either iWARP or RoCE as long as it has the Windows Server 2016 logo, but iWARP is usually easier to set up.


視您網路的設備,而定,特別是使用 RoCE v2,可能需要一些設定的最上方的 rack 交換器。Depending on your networking equipment, and especially with RoCE v2, some configuration of the top-of-rack switch may be required. 正確的參數設定是以確保可靠性和效能的儲存空間直接存取重要。Correct switch configuration is important to ensure reliability and performance of Storage Spaces Direct.

Windows Server 2016 導入了交換器內嵌小組 (SET) 內的 HYPER-V 虛擬交換器。Windows Server 2016 introduces switch-embedded teaming (SET) within the Hyper-V virtual switch. 這可讓相同實體 NIC 連接埠,同時使用 RDMA,減少所需的實體 NIC 連接埠數目用於所有網路流量。This allows the same physical NIC ports to be used for all network traffic while using RDMA, reducing the number of physical NIC ports required. 交換器內嵌小組建議的儲存空間直接存取。Switch-embedded teaming is recommended for Storage Spaces Direct.

若要設定的儲存空間直接存取的網路功能的指示,請參閱Windows Server 2016 交集的 NIC 和客體 RDMA 部署指南For instructions to set up networking for Storage Spaces Direct, see Windows Server 2016 Converged NIC and Guest RDMA Deployment Guide.

步驟 3:設定儲存空間直接存取Step 3: Configure Storage Spaces Direct

下列步驟要在管理系統 (與要設定的伺服器相同版本) 上完成。The following steps are done on a management system that is the same version as the servers being configured. 下列步驟不應該會使用的 PowerShell 工作階段,從遠端執行而改為使用系統管理權限,在管理系統上執行的本機 PowerShell 工作階段中。The following steps should NOT be run remotely using a PowerShell session, but instead run in a local PowerShell session on the management system, with administrative permissions.

步驟 3.1: 清除的磁碟機Step 3.1: Clean drives

啟用儲存空間直接存取之前,請確定您的磁碟機都是空的: 沒有舊的磁碟分割或其他資料。Before you enable Storage Spaces Direct, ensure your drives are empty: no old partitions or other data. 執行下列指令碼,以取代您的電腦名稱,若要移除所有任何舊的磁碟分割或其他資料。Run the following script, substituting your computer names, to remove all any old partitions or other data.


這個指令碼將會永久移除任何以外的作業系統開機磁碟機的磁碟機上的任何資料 !This script will permanently remove any data on any drives other than the operating system boot drive!

# Fill in these variables with your values
$ServerList = "Server01", "Server02", "Server03", "Server04"

Invoke-Command ($ServerList) {
    Get-StoragePool | ? IsPrimordial -eq $false | Set-StoragePool -IsReadOnly:$false -ErrorAction SilentlyContinue
    Get-StoragePool | ? IsPrimordial -eq $false | Get-VirtualDisk | Remove-VirtualDisk -Confirm:$false -ErrorAction SilentlyContinue
    Get-StoragePool | ? IsPrimordial -eq $false | Remove-StoragePool -Confirm:$false -ErrorAction SilentlyContinue
    Get-PhysicalDisk | Reset-PhysicalDisk -ErrorAction SilentlyContinue
    Get-Disk | ? Number -ne $null | ? IsBoot -ne $true | ? IsSystem -ne $true | ? PartitionStyle -ne RAW | % {
        $_ | Set-Disk -isoffline:$false
        $_ | Set-Disk -isreadonly:$false
        $_ | Clear-Disk -RemoveData -RemoveOEM -Confirm:$false
        $_ | Set-Disk -isreadonly:$true
        $_ | Set-Disk -isoffline:$true
    Get-Disk | Where Number -Ne $Null | Where IsBoot -Ne $True | Where IsSystem -Ne $True | Where PartitionStyle -Eq RAW | Group -NoElement -Property FriendlyName
} | Sort -Property PsComputerName, Count

輸出看起來像這樣,計數所在的每個模型中每個伺服器的磁碟機數:The output will look like this, where Count is the number of drives of each model in each server:

Count Name                          PSComputerName
----- ----                          --------------
4     ATA SSDSC2BA800G4n            Server01
10    ATA ST4000NM0033              Server01
4     ATA SSDSC2BA800G4n            Server02
10    ATA ST4000NM0033              Server02
4     ATA SSDSC2BA800G4n            Server03
10    ATA ST4000NM0033              Server03
4     ATA SSDSC2BA800G4n            Server04
10    ATA ST4000NM0033              Server04

步驟 3.2: 驗證叢集Step 3.2: Validate the cluster

在此步驟中,您將執行叢集驗證工具,確保伺服器節點都正確設定,以使用儲存空間直接存取建立叢集。In this step, you'll run the cluster validation tool to ensure that the server nodes are configured correctly to create a cluster using Storage Spaces Direct. 當叢集驗證 (Test-Cluster) 是在建立叢集之前執行,它會執行測試來驗證組態是否適合而能夠做為容錯移轉叢集順利運作。When cluster validation (Test-Cluster) is run before the cluster is created, it runs the tests that verify that the configuration appears suitable to successfully function as a failover cluster. 使用下面的範例-Include指定參數,然後特定的測試類別。The example directly below uses the -Include parameter, and then the specific categories of tests are specified. 這可確保驗證中包含與儲存空間直接存取相關的測試。This ensures that the Storage Spaces Direct specific tests are included in the validation.

您可以使用下列 PowerShell 命令驗證一組用來做為儲存空間直接存取叢集的伺服器。Use the following PowerShell command to validate a set of servers for use as a Storage Spaces Direct cluster.

Test-Cluster –Node <MachineName1, MachineName2, MachineName3, MachineName4> –Include "Storage Spaces Direct", "Inventory", "Network", "System Configuration"

步驟 3.3: 建立叢集Step 3.3: Create the cluster

在此步驟中,您將建立與您已驗證過可用來使用下列 PowerShell cmdlet 在先前步驟中建立的叢集節點的叢集。In this step, you'll create a cluster with the nodes that you have validated for cluster creation in the preceding step using the following PowerShell cmdlet.

在建立叢集時,您會收到一則警告指出-「 時發生問題,建立叢集的角色可能會導致它無法啟動。When creating the cluster, you'll get a warning that states - "There were issues while creating the clustered role that may prevent it from starting. 如需詳細資訊,請檢視下面的報表檔案。」For more information, view the report file below." 您可以放心忽略這個警告。You can safely ignore this warning. 這是因為沒有磁碟可供叢集仲裁使用。It's due to no disks being available for the cluster quorum. 建議您在建立叢集之後設定檔案共用見證或雲端見證。Its recommended that a file share witness or cloud witness is configured after creating the cluster.


如果伺服器使用靜態 IP 位址,請修改下列命令,新增下列參數並指定 IP 位址:-StaticAddress <X.X.X.X> 以反映靜態 IP 位址。If the servers are using static IP addresses, modify the following command to reflect the static IP address by adding the following parameter and specifying the IP address:–StaticAddress <X.X.X.X>. 在下列命令中,ClusterName 預留位置應取代為唯一的 netbios 名稱 (15 個以下的字元)。In the following command the ClusterName placeholder should be replaced with a netbios name that is unique and 15 characters or less.

New-Cluster –Name <ClusterName> –Node <MachineName1,MachineName2,MachineName3,MachineName4> –NoStorage

叢集建立之後,叢集名稱的 DNS 項目需要一些時間才會被複寫。After the cluster is created, it can take time for DNS entry for the cluster name to be replicated. 時間則取決於環境和 DNS 複寫組態。The time is dependent on the environment and DNS replication configuration. 如果解析叢集不成功,在大多數情況下,使用節點 (屬於叢集的作用中成員) 的電腦名稱而不是叢集名稱可能會成功。If resolving the cluster isn't successful, in most cases you can be successful with using the machine name of a node that is an active member of the cluster may be used instead of the cluster name.

步驟 3.4︰ 設定叢集見證Step 3.4: Configure a cluster witness

建議您設定叢集見證,讓三個或多個節點系統可以承受兩個節點失敗或離線。It is recommended that you configure a witness for the cluster, so that a three or more node system can withstand two nodes failing or being offline. 雙節點部署需要一個叢集見證,否則任一個節點離線會使另一個節點變成也無法使用。A two-node deployment requires a cluster witness, otherwise either node going offline will cause the other to become unavailable as well. 您可以使用檔案共用作為見證,或使用雲端見證來搭配這些系統。With these systems, you can use a file share as a witness, or use cloud witness. 如需詳細資訊,請參閱部署容錯移轉叢集的雲端見證For more info, see Deploy a Cloud Witness for a Failover Cluster.

如需設定檔案共用見證的詳細資訊,請參閱 Configuring a File Share Witness on a Scale-Out File Server (在向外延展檔案伺服器上設定檔案共用見證)。For more information about configuring a file share witness, see Configuring a File Share Witness on a Scale-Out File Server.

步驟 3.5:啟用儲存空間直接存取Step 3.5: Enable Storage Spaces Direct

建立叢集之後, 使用Enable-ClusterStorageSpacesDirectPowerShell cmdlet,此功能將會儲存系統進入的儲存空間直接存取模式,並自動執行下列作業:After creating the cluster, use the Enable-ClusterStorageSpacesDirect PowerShell cmdlet, which will put the storage system into the Storage Spaces Direct mode and do the following automatically:

  • 建立集區︰建立有類似 "S2D on Cluster1" 名稱的單一大型集區。Create a pool: Creates a single large pool that has a name like "S2D on Cluster1".

  • 設定儲存空間直接存取快取︰如果有多個媒體 (磁碟機) 類型可供儲存空間直接存取使用,則允許以最快速的快取裝置來執行 (在大部分情況下可讀取和寫入)Configures the Storage Spaces Direct caches: If there is more than one media (drive) type available for Storage Spaces Direct use, it enables the fastest as cache devices (read and write in most cases)

  • 層: 建立兩個層,做為預設階層。Tiers: Creates two tiers as default tiers. 一個稱為「容量」,另一個稱為「效能」。One is called "Capacity" and the other called "Performance". 此 Cmdlet 會分析裝置,並使用混合的裝置類型和復原功能來設定每一層。The cmdlet analyzes the devices and configures each tier with the mix of device types and resiliency.

從管理系統以系統管理員權限開啟的 PowerShell 命令視窗中,起始下列命令。From the management system, in a PowerShell command windows opened with Administrator privileges, initiate the following command. 叢集名稱是您在先前步驟中建立的叢集名稱。The cluster name is the name of the cluster that you created in the previous steps. 如果此命令在其中一個本機節點上執行,則不需要 -CimSession 參數。If this command is run locally on one of the nodes, the -CimSession parameter is not necessary.

Enable-ClusterStorageSpacesDirect –CimSession <ClusterName>

若要使用上面的命令啟用儲存空間直接存取,您也可以使用節點名稱而不是叢集名稱。To enable Storage Spaces Direct using the above command, you can also use the node name instead of the cluster name. 使用節點名稱可能更可靠,因為新建立的叢集名稱可能會發生 DNS 複寫延遲。Using the node name may be more reliable due to DNS replication delays that may occur with the newly created cluster name.

此命令完成可能需要幾分鐘的時間,完成之後,系統就可以建立磁碟區。When this command is finished, which may take several minutes, the system will be ready for volumes to be created.

步驟 3.6:建立磁碟區Step 3.6: Create volumes

我們建議使用New-Volumecmdlet,因為它提供最快速與最簡單的體驗。We recommend using the New-Volume cmdlet as 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.

如需詳細資訊,請查看建立儲存空間直接存取中的磁碟區For more information, check out Creating volumes in Storage Spaces Direct.

步驟 3.7: 選擇性地啟用 CSV 快取Step 3.7: Optionally enable the CSV cache

您可以選擇啟用叢集共用磁碟區 (CSV) 快取寫入透過區塊層級的快取讀取作業不是已快取的 Windows 快取管理員為使用系統記憶體 (RAM)。You can optionally enable the cluster shared volume (CSV) cache to use system memory (RAM) as a write-through block-level cache of read operations that aren't already cached by the Windows cache manager. 這可以提升應用程式,例如 HYPER-V 的效能。This can improve performance for applications such as Hyper-V. CSV 快取可以激發讀取要求的效能,並也很適合用於外延展檔案伺服器的案例。The CSV cache can boost the performance of read requests and is also useful for Scale-Out File Server scenarios.

啟用 CSV 快取降低記憶體可用來在超融合式叢集上,執行虛擬機器,所以您必須使用中取得平衡存放裝置效能與 Vhd 可用的記憶體數量。Enabling the CSV cache reduces the amount of memory available to run VMs on a hyper-converged cluster, so you'll have to balance storage performance with memory available to VHDs.

若要設定的 CSV 快取的大小,開啟的 PowerShell 工作階段,在管理系統存放裝置叢集上, 擁有系統管理員權限的帳戶,然後使用這個指令碼,變更$ClusterName$CSVCacheSize做為適當的變數 (此範例會設定2 GB CSV 快取每部伺服器):To set the size of the CSV cache, open a PowerShell session on the management system with an account that has administrator permissions on the storage cluster, and then use this script, changing the $ClusterName and $CSVCacheSize variables as appropriate (this example sets a 2 GB CSV cache per server):

$ClusterName = "StorageSpacesDirect1"
$CSVCacheSize = 2048 #Size in MB

Write-Output "Setting the CSV cache..."
(Get-Cluster $ClusterName).BlockCacheSize = $CSVCacheSize

$CSVCurrentCacheSize = (Get-Cluster $ClusterName).BlockCacheSize
Write-Output "$ClusterName CSV cache size: $CSVCurrentCacheSize MB"

如需詳細資訊,請參閱使用 CSV 中記憶體內部讀取快取For more info, see Using the CSV in-memory read cache.

步驟 3.8: 部署超交集部署的虛擬機器Step 3.8: Deploy virtual machines for hyper-converged deployments

如果您要部署的超融合式叢集,最後一個步驟是在儲存空間直接存取叢集上的虛擬機器佈建。If you're deploying a hyper-converged cluster, the last step is to provision virtual machines on the Storage Spaces Direct cluster.

虛擬機器的檔案應該儲存在系統的 CSV 命名空間 (範例︰c:\ClusterStorage\Volume1),就像叢集容錯移轉叢集上的叢集 VM。The virtual machine's files should be stored on the systems CSV namespace (example: c:\ClusterStorage\Volume1) just like clustered VMs on failover clusters.

您可以使用內建工具或其他工具來管理儲存體和虛擬機器,例如 System Center 虛擬機器 Manager。You can use in-box tools or other tools to manage the storage and virtual machines, such as System Center Virtual Machine Manager.

步驟 4: 融合式解決方案部署外延展檔案伺服器Step 4: Deploy Scale-Out File Server for converged solutions

如果您要部署的融合式的解決方案下, 一個步驟是建立外延展檔案伺服器執行個體,並設定某些檔案共用。If you're deploying a converged solution, the next step is to create a Scale-Out File Server instance and setup some file shares. 如果您要部署超融合式叢集-您完成後,而且不需要這一節。If you're deploying a hyper-converged cluster - you're finished and don't need this section.

步驟 4.1: 建立外延展檔案伺服器角色Step 4.1: Create the Scale-Out File Server role

設定您的檔案伺服器的叢集服務的下一個步驟就建立叢集的檔案伺服器角色,也就是當您建立您的持續可用的檔案共用的裝載外延展檔案伺服器執行個體。The next step in setting up the cluster services for your file server is creating the clustered file server role, which is when you create the Scale-Out File Server instance on which your continuously available file shares are hosted.

若要使用伺服器管理員中建立外延展檔案伺服器角色To create a Scale-Out File Server role by using Server Manager

  1. 在容錯移轉叢集管理員中,選取叢集,移至 [角色],然後按一下 [ ...設定角色In Failover Cluster Manager, select the cluster, go to Roles, and then click Configure Role….
    高可用性精靈會出現。The High Availability Wizard appears.
  2. 選取的角色頁面上,按一下 [檔案伺服器On the Select Role page, click File Server.
  3. 檔案伺服器的類型頁面上,按一下 [應用程式資料外延展檔案伺服器On the File Server Type page, click Scale-Out File Server for application data.
  4. 用戶端存取點頁面上,輸入外延展檔案伺服器的名稱。On the Client Access Point page, type a name for the Scale-Out File Server.
  5. 請確認角色順利設定方式為前往角色,並確認狀態欄顯示執行叢集的檔案伺服器角色的旁邊,您建立,如圖 1 所示。Verify that the role was successfully set up by going to Roles and confirming that the Status column shows Running next to the clustered file server role you created, as shown in Figure 1.


    圖 1顯示與執行狀態外延展檔案伺服器容錯移轉叢集管理員Figure 1 Failover Cluster Manager showing the Scale-Out File Server with the Running status


建立叢集的角色之後, 可能會有一些網路傳播延遲,可能會使您無法在其上建立的檔案共用,幾分鐘的時間,或可能較長的時間。After creating the clustered role, there might be some network propagation delays that could prevent you from creating file shares on it for a few minutes, or potentially longer.

若要使用 Windows PowerShell 建立外延展檔案伺服器角色To create a Scale-Out File Server role by using Windows PowerShell

在 Windows PowerShell 工作階段連接到檔案伺服器叢集,輸入下列命令以建立外延展檔案伺服器角色,變更FSCLUSTER以符合您的叢集名稱和SOFS名稱使其符合您想要授予外延展檔案伺服器角色:In a Windows PowerShell session that's connected to the file server cluster, enter the following commands to create the Scale-Out File Server role, changing FSCLUSTER to match the name of your cluster, and SOFS to match the name you want to give the Scale-Out File Server role:

Add-ClusterScaleOutFileServerRole -Name SOFS -Cluster FSCLUSTER


建立叢集的角色之後, 可能會有一些網路傳播延遲,可能會使您無法在其上建立的檔案共用,幾分鐘的時間,或可能較長的時間。After creating the clustered role, there might be some network propagation delays that could prevent you from creating file shares on it for a few minutes, or potentially longer. 如果 SOFS 角色立即失敗,而不會啟動,它可能是因為叢集電腦物件不具權限,以建立 SOFS 角色的電腦帳戶。If the SOFS role fails immediately and won't start, it might be because the cluster's computer object doesn't have permission to create a computer account for the SOFS role. 適用於協助,請參閱此部落格文章:外延展檔案伺服器角色失敗到 [開始] 畫面與事件識別碼 1205,1069 和 1194年For help with that, see this blog post: Scale-Out File Server Role Fails To Start With Event IDs 1205, 1069, and 1194.

步驟 4.2: 建立檔案共用Step 4.2: Create file shares

您已經建立您的虛擬磁碟,並將其新增至 Csv 之後,它是每個 CSV 的一個檔案共用,每個虛擬磁碟的時間來建立檔案共用上他們的。After you've created your virtual disks and added them to CSVs, it's time to create file shares on them - one file share per CSV per virtual disk. System Center 虛擬機器 Manager (VMM) 可能是 handiest 若要這樣做,因為它會處理權限,但如果您不需要它在您的環境中,您可以使用 Windows PowerShell 將部分自動化部署方法。System Center Virtual Machine Manager (VMM) is probably the handiest way to do this because it handles permissions for you, but if you don't have it in your environment, you can use Windows PowerShell to partially automate the deployment.

使用包含在HYPER-V 工作負載的 SMB 共用設定指令碼,部分會建立群組和共用的程序自動化的指令碼。Use the scripts included in the SMB Share Configuration for Hyper-V Workloads script, which partially automates the process of creating groups and shares. 它撰寫對於 HYPER-V 工作負載,因此如果您要部署其他工作負載,您可能要修改設定,或在建立共用之後執行額外的步驟。It's written for Hyper-V workloads, so if you're deploying other workloads, you might have to modify the settings or perform additional steps after you create the shares. 例如,如果您使用 Microsoft SQL Server,SQL Server 服務帳戶必須授與共用和檔案系統上的完全控制權。For example, if you're using Microsoft SQL Server, the SQL Server service account must be granted full control on the share and the file system.


您必須更新群組成員資格,當您新增叢集節點,除非您使用 System Center 虛擬機器 Manager 來建立您的共用。You'll have to update the group membership when you add cluster nodes unless you use System Center Virtual Machine Manager to create your shares.

若要使用 PowerShell 指令碼建立的檔案共用,執行下列動作:To create file shares by using PowerShell scripts, do the following:

  1. 下載適用於 HYPER-V 工作負載的 SMB 共用設定至其中一個檔案伺服器叢集的節點中包含的指令碼。Download the scripts included in SMB Share Configuration for Hyper-V Workloads to one of the nodes of the file server cluster.
  2. 使用網域系統管理員認證,在管理系統上開啟 Windows PowerShell 工作階段,然後使用下列指令碼建立變更為適當的變數的值為 Active Directory 群組對於 HYPER-V 的電腦物件中,您環境:Open a Windows PowerShell session with Domain Administrator credentials on the management system, and then use the following script to create an Active Directory group for the Hyper-V computer objects, changing the values for the variables as appropriate for your environment:

    # Replace the values of these variables
    $HyperVClusterName = "Compute01"
    $HyperVObjectADGroupSamName = "Hyper-VServerComputerAccounts" <#No spaces#>
    $ScriptFolder = "C:\Scripts\SetupSMBSharesWithHyperV"
    # Start of script itself
    CD $ScriptFolder
    .\ADGroupSetup.ps1 -HyperVObjectADGroupSamName $HyperVObjectADGroupSamName -HyperVClusterName $HyperVClusterName
  3. 開啟 Windows PowerShell 工作階段與上一個存放裝置節點,系統管理員認證,然後使用下列指令碼來為每個 CSV 建立共用,並針對共用的系統管理權限授與網域系統管理員群組和計算叢集。Open a Windows PowerShell session with Administrator credentials on one of the storage nodes, and then use the following script to create shares for each CSV and grant administrative permissions for the shares to the Domain Admins group and the compute cluster.

    # Replace the values of these variables
    $StorageClusterName = "StorageSpacesDirect1"
    $HyperVObjectADGroupSamName = "Hyper-VServerComputerAccounts" <#No spaces#>
    $SOFSName = "SOFS"
    $SharePrefix = "Share"
    $ScriptFolder = "C:\Scripts\SetupSMBSharesWithHyperV"
    # Start of the script itself
    CD $ScriptFolder
    Get-ClusterSharedVolume -Cluster $StorageClusterName | ForEach-Object
        $ShareName = $SharePrefix + $_.SharedVolumeInfo.friendlyvolumename.trimstart("C:\ClusterStorage\Volume")
        Write-host "Creating share $ShareName on "$_.name "on Volume: " $_.SharedVolumeInfo.friendlyvolumename
        .\FileShareSetup.ps1 -HyperVClusterName $StorageClusterName -CSVVolumeNumber $_.SharedVolumeInfo.friendlyvolumename.trimstart("C:\ClusterStorage\Volume") -ScaleOutFSName $SOFSName -ShareName $ShareName -HyperVObjectADGroupSamName $HyperVObjectADGroupSamName

步驟 4.3 啟用 Kerberos 限制委派Step 4.3 Enable Kerberos constrained delegation

若要安裝遠端案例的管理以及提高的即時移轉安全性,其中包含從其中一個的存放裝置叢集節點上,限制的 Kerberos 委派使用包含在SMB 共用設定,對於 HYPER-V 工作負載KCDSetup.ps1 指令碼。To setup Kerberos constrained delegation for remote scenario management and increased Live Migration security, from one of the storage cluster nodes, use the KCDSetup.ps1 script included in SMB Share Configuration for Hyper-V Workloads. 以下是一些包裝函式的指令碼:Here's a little wrapper for the script:

$HyperVClusterName = "Compute01"
$ScaleOutFSName = "SOFS"
$ScriptFolder = "C:\Scripts\SetupSMBSharesWithHyperV"

CD $ScriptFolder
.\KCDSetup.ps1 -HyperVClusterName $HyperVClusterName -ScaleOutFSName $ScaleOutFSName -EnableLM

後續步驟Next steps

部署您的叢集的檔案伺服器之後,我們建議測試您的方案使用綜合工作負載在之前移任何實際的工作負載的效能。After deploying your clustered file server, we recommend testing the performance of your solution using synthetic workloads prior to bringing up any real workloads. 這可讓您確認 [方案正常執行,並新增複雜的工作負載之前工作任何延遲所遇到的問題。This lets you confirm that the solution is performing properly and work out any lingering issues before adding the complexity of workloads. 如需詳細資訊,請參閱測試儲存空間效能使用綜合工作負載For more info, see Test Storage Spaces Performance Using Synthetic Workloads.

請參閱See also