使用 Windows Server 2016 儲存空間直接存取的超交集解決方案Hyper-converged solution using Storage Spaces Direct in Windows Server 2016

適用於:Windows Server 2016Applies to: Windows Server 2016

本主題將說明如何部署儲存空間直接存取,為裝載在與相同的超融合叢集中的虛擬機器提供軟體定義的儲存空間。This topic provides instructions for how to deploy Storage Spaces Direct to provide software-defined storage for virtual machines hosted in the same hyper-converged cluster.

請注意,建議為生產環境取得 Windows Server 軟體定義硬體/軟體供應項目,其中包括生產環境部署工具和程序。Note that for production environments we recommend acquiring a Windows Server Software-Defined hardware/software offering, which includes production deployment tools and procedures. 這些供應項目經過設計、組合和驗證,符合 Microsoft 的私人雲端環境需求,因此有助於確保作業的可靠性。These offerings are designed, assembled, and validated to meet Microsoft's requirements for private cloud environments, helping ensure reliable operation. Windows Server 軟體定義供應項目將於本年度稍後正式提供 - 到時可回頭檢查更新!Windows Server Software-Defined offerings will be available later this year - check back for updates!

如果您想要評估 Windows Server 2016 的儲存空間直接存取而不投資硬體,可以使用 Hyper-V 虛擬機器,如 Testing Storage Spaces Direct using Windows Server 2016 virtual machines (使用 Windows Server 2016 虛擬機器測試儲存空間直接存取) 中所述。If you would like to evaluate Storage Spaces Direct in Windows Server 2016 without investing in hardware, you can use Hyper-V virtual machines, as described in Testing Storage Spaces Direct using Windows Server 2016 virtual machines.

提示

在部署儲存空間直接存取之前,建議您先概括地閱讀本文件,讓自己熟悉整體的做法,了解與一些步驟相關的重要附註,並且熟悉其他支援資源和文件。Before deploying Storage Spaces Direct, we recommended briefly reading this document to familiarize yourself with the overall approach, to get a sense for the important notes associated with some steps, and to acquaint yourself with the additional supporting resources and documentation.

本指南說明如何使用 Windows Server 2016 搭配 [含有桌面體驗的伺服器] 或 [Server Core] 安裝選項,來安裝及設定超交集系統的元件。This guide includes instructions to install and configure the components of a hyper-converged system using Windows Server 2016 with either the Server with Desktop Experience or Server Core installation options. 部署超交集系統的動作可以分成三個高等級階段:The act of deploying a hyper-converged system can be divided into three high level phases:

您可以一次進行幾個步驟,或一次進行所有步驟。You can work on these steps a few at a time or all at once. 不過,步驟必須依序完成。However, they do need to be completed in order. 本指南在介紹一些必要條件和術語之後,會更詳細說明這三個階段並提供範例。After describing some prerequisites and terminology, this guide describes each of the three phases in more detail and provides examples.

解決方案概觀Solution overview

在本指南所描述的超交集設定中,儲存空間直接存取緊密整合您目前所知的各種 Windows Server 軟體定義儲存堆疊功能,包括叢集共用磁碟區檔案系統 (CSVFS)、儲存空間和容錯移轉叢集。In the hyper-converged configuration described in this guide, Storage Spaces Direct seamlessly integrates with the features you know today that make up the Windows Server software defined storage stack, including Clustered Shared Volume File System (CSVFS), Storage Spaces and Failover Clustering.

超交集部署案例的 Hyper-V (計算) 和儲存空間直接存取 (儲存) 元件位於相同的叢集上。The hyper-converged deployment scenario has the Hyper-V (compute) and Storage Spaces Direct (storage) components on the same cluster. 虛擬機器檔案則儲存在本機 CSV 中。Virtual machine files are stored on local CSVs. 這樣可和搭配使用的儲存體一起調整 Hyper-V 運算叢集。This allows for scaling Hyper-V compute clusters together with the storage it is using. 一旦設定好儲存空間直接存取且 CSV 磁碟區可用時,就可以使用與您在容錯移轉叢集上部署任何其他 Hyper-V 相同的程序和工具,設定和佈建 Hyper-V。Once Storage Spaces Direct is configured and the CSV volumes are available, configuring and provisioning Hyper-V is the same process and uses the same tools that you would use with any other Hyper-V deployment on a failover cluster. 圖 1 說明超融合部署案例。Figure 1 illustrates the hyper-converged deployment scenario.

此圖顯示超交集堆疊,並以單一叢集裝載儲存體和所有虛擬機器

圖 1:超融合 - 與儲存空間直接存取相同的叢集設定與虛擬機器裝載FIGURE 1: Hyperconverged - same cluster configured for Storage Spaces Direct and the hosting of virtual machines

收集的資訊Information gathering

設定佈建及管理超融合系統時必須輸入下列資訊,如果您開始進行時手上有這些資訊,可加快程序,您也會更輕鬆︰The following information will be needed as inputs to configure provision and manage the hyper-converged system, and therefore it will speed up the process and make it easier for you if you have it on hand when you start:

  • 伺服器名稱:您需要熟悉您組織的電腦、檔案、路徑以及其他資源的命名原則,因為您要佈建數部伺服器,而每部伺服器都必須有唯一的伺服器名稱。Server Names You should be familiar with your organization's naming policies for computers, files, paths, and other resources as you will be provisioning several servers each will need to have a unique server name.

  • 網域名稱 您要將電腦加入網域,而且您必須指定網域名稱。Domain name You will be joining computers to your domain, and you will need to specify the domain name. 請務必熟悉您的內部網域命名原則和網域加入原則。It would be good to familiarize with your internal domain naming and domain joining policies.

  • 針對 RDMA 設定:For RDMA configurations:

    • Top of Rack 交換器品牌/型號 (使用 RoCE v2 NIC 時才需要)Top of Rack switch make/model (required when using RoCE v2 NICs)

    • 網路介面卡品牌/型號Network adapter make/model

      有 2 種類型的 RDMA 通訊協定,請記下您的 RDMA 介面卡類型 (RoCEv2 或 iWarp)。There are 2 types of RDMA protocols, note which type your RDMA adapter is (RoCE v2 or iWarp).

    • 要用於超融合主機管理作業系統使用的 2 個網路介面的 VLAN ID。VLAN ID to be used for the 2 network interfaces used by the management OS on the hyper-converged hosts. 您應該能夠從您的網路管理員取得。You should be able to obtain this from your network administrator.

安裝選項Installation options

超交集部署也可以使用 Windows Server 2016 的 [Server Core] 或 [含有桌面體驗的伺服器] 安裝來完成。Hyper-converged deployments can be done using a Server Core, or Server with Desktop Experience installation of Windows Server 2016.

本指南著重在使用 [Server Core] 安裝選項來部署超交集系統。This guide focuses on deploying hyper-converged systems using the Server Core installation option.

不過,無論您使用的是 [含有桌面體驗的伺服器] 還是 [Server Core] 安裝,<設定網路>和<設定儲存空間直接存取>兩節中的步驟都相同。However, the steps in the "Configure the Network" and "Configure Storage Spaces Direct" sections are identical whether you are using Server with Desktop Experience or Server Core installations.

管理系統Management system

為了方便本文使用,擁有可本機或遠端管理叢集之管理工具的電腦會稱為管理系統。For the purposes of this document, the machine that has the management tools to locally or remotely manage the cluster is referred to as the management system. 管理系統電腦必須符合下列需求︰The management system machine has the following requirements:

  • 執行 Windows Server 2016 並套用與所管理之伺服器相同的更新,而且同時加入相同的網域或完全受信任的網域。Running Windows Server 2016 with the same updates as the servers it's managing, and also 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. Windows Server 2016 上有 RSAT 工具和 PowerShell 模組,可以加以安裝但不安裝其他功能。RSAT tools and PowerShell modules are available on Windows Server 2016 and can be installed without installing other features.

  • 管理系統可以在虛擬機器內或在實體機器上執行。Management system can be run inside of a virtual machine or on a physical machine.

  • 需要能連線到所管理之伺服器的網路。Requires network connectivity to the servers it's managing.

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

當您使用安裝精靈安裝 Windows Server 2016 時,您可以在 Windows Server 2016 和 Windows Server 2016 (含有桌面體驗的伺服器) 之間進行選擇。When you install Windows Server 2016 using the Setup wizard, you may be able to choose between Windows Server 2016 and Windows Server 2016 (Server with Desktop Experience). Windows Server 2016 的 [含有桌面體驗的伺服器] 選項,相當於已安裝桌面體驗功能之 Windows Server 2012 R2 中的 [完整] 安裝選項。The Server with Desktop Experience option is the Windows Server 2016 equivalent of the Full installation option available in Windows Server 2012 R2 with the Desktop Experience feature installed. 如果您不在安裝精靈中做出選擇,系統將會使用 [Server Core]安裝選項來安裝 Windows Server 2016。If you don't make a choice in the Setup wizard, Windows Server 2016 is installed with the Server Core installation option. [Server Core] 選項可以減少所需的磁碟空間及潛在的攻擊面,並能特別減少維護需求。因此,除非您特別需要 [含有桌面體驗的伺服器] 選項所包含的額外使用者介面元素與圖形化管理工具,否則我們建議您選擇 [Server Core] 安裝。The Server Core option reduces the space required on disk, the potential attack surface, and especially the servicing requirements, so we recommend that you choose the Server Core installation unless you have a particular need for the additional user interface elements and graphical management tools that are included in the Server with Desktop Experience option.

如需這兩個安裝選項的詳細資訊,請參閱 Windows Server 2016 的安裝選項For more information about these two installation options, see Installation Options for Windows Server 2016. 如需在 Server Core 模式中部署 Windows Server 2016 的詳細資訊,請參閱安裝 Server CoreFor detailed information about deploying Windows Server 2016 in Server Core mode, see Install Server Core.

步驟 1.1︰連線到叢集節點Step 1.1: Connecting to the cluster nodes

您需要一個具有 Windows Server 2016 的管理系統,並套用與叢集節點相同的更新,才能進行管理和設定。You will need a management system that has Windows Server 2016 with the same updates to manage and configuration as the cluster nodes. 如果是 [含有桌面體驗的伺服器] 部署,您可以從遠端電腦或藉由登入其中一個叢集節點進行管理。If it's a Server with Desktop Experience deployment, you can manage it from a remote machine or by logging into one of the cluster nodes. 您也可以使用已安裝最新更新和適用於 Windows Server 2016 工具之用戶端遠端伺服器管理工具 (RSAT) 的 Windows 10 用戶端電腦。You may also use a Windows 10 client machine that has the latest updates installed, and the client Remote Server Administration Tools (RSAT) for Windows Server 2016 tools installed.

  1. 在管理系統上,安裝容錯移轉叢集與 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.

    以系統管理員權限開啟 PowerShell 工作階段並執行下列命令。Open a PowerShell session with Administrator privileges and execute the following. 這會對所有主機設定信任的主機。This will configure the trusted hosts to all hosts.

    Set-Item WSMan:\localhost\Client\TrustedHosts "*"
    

    上面的組態是一次性,之後您就不需要重複 Set-Item。After the onetime configuration above, you will not need to repeat Set-Item. 不過,每次您關閉並重新開啟 PowerShell 主控台時,需執行下列命令建立新的遠端 PS 工作階段連線到伺服器:However, each time you close and reopen the PowerShell console you should establish a new remote PS Session to the server by running the commands below:

  2. 進入 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 will 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
    

如果您必須執行多次,下列範例執行相同的動作,不過是使用比較好用的指令碼︰Examples of doing the same thing in a way that is more useful in scripts, in case you need to do this more than once:

範例 1:使用 IP 位址︰Example 1: using an IP address:

$ip = "10.100.0.1"
$user = "$ip\Administrator"

Enter-PSSession -ComputerName $ip -Credential $user

範例 2:或者,您可以使用電腦名稱而不是 IP 位址執行類似的動作。Example 2: OR you can do something similar with computer name instead of IP address.

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

Enter-PSSession -ComputerName $myServer1 -Credential $user

步驟 1.2:新增網域帳戶Step 1.2: Adding domain accounts

到目前為止,本指南已讓您使用本機系統管理員帳戶 <ComputerName>\Administrator 部署並設定了個別節點。So far this guide has had you deploying and configuring individual nodes with the local administrator account <ComputerName>\Administrator.

管理超融合系統 (包括叢集、儲存體和虛擬化元件),通常需要使用每個節點上 Administrators 群組的網域帳戶。Managing a hyper-converged system, including the cluster and storage and virtualization components, often requires using a domain account that is in the Administrators group on each node.

從管理系統執行下列步驟:From the management system, perform the following steps:

  1. 在管理系統上,以系統管理員權限開啟 PowerShell 主控台。On the management system, open a PowerShell console with Administrator privileges.
  2. 使用 Enter-PSSession 連線到每個節點,然後執行下列命令,將您的網域帳戶新增至 Administrators 本機安全性群組。Use Enter-PSSession to connect to each node and then run the following command to add your domain account(s) to the Administrators local security group. 如需如何使用 PSSession 連線到伺服器的資訊,請參閱上一節。See the section above for information about how to connect to the servers using PSSession.

    Net localgroup Administrators <Domain\Account> /add
    

步驟 1.3:安裝伺服器角色及功能Step 1.3: Install server roles and features

下一個步驟要在所有的節點上安裝下列伺服器角色及功能:The next step is to install the following server roles and features on all of the nodes:

  • 容錯移轉叢集Failover Clustering
  • Hyper-VHyper-V
  • 資料中心橋接 (如果您正在使用 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 命令:To do so, use the following PowerShell command:

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

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

儲存空間直接存取要求節點之間有高頻寬和低延遲的網路連線。Storage Spaces Direct requires high bandwidth and low latency network connections between nodes. 此網路連線對於系統效能和可靠性而言很重要。This network connectivity is important for both system performance and reliability. 建議節點之間至少有 2 個 10gb 連線。It is recommended to have at least 2 10gb connections between the nodes. 也建議使用 RDMA,因為它提供明顯更佳的輸送量,且能減少網路流量的 CPU 使用量。RDMA is also recommended since it provides significantly better throughput and reduces the CPU usage for network traffic.

RDMA 網路介面卡有兩個常見的版本。There are two common versions of RDMA network adapters. RoCE 和 iWARP。RoCE and iWARP. 您可以使用任一版本搭配儲存空間直接存取,只要其具有 Windows Server 2016 標誌即可。You can use either with Storage Spaces Direct as long as it has the Windows Server 2016 logo. Top of Rack 交換器和伺服器設定可能會因網路介面卡和交換器而有所不同。Top of Rack switches and server configurations may vary, depending on the network adapter and switch. 請務必正確設定伺服器和交換器,以確保儲存空間直接存取的可靠性和效能。Configuring the server and switch correctly is important to ensure reliability and performance of Storage Spaces Direct.

Windows Server 2016 也引進新的虛擬交換器,其內建網路小組功能,稱為交換器內嵌小組 (SET)。Windows Server 2016 also introduces a new virtual switch that has network teaming built in called Switch Embedded Teaming (SET). 這個新的虛擬交換器可讓 2 個相同的實體 NIC 連接埠同時用於 VM 和伺服器的父分割,以提供 RDMA 連線。This new virtual switch allows the same 2 physical NIC ports to be used both for VMs as well as the parent partition of the server to have RDMA connectivity. 如此可減少必要的實體 NIC 連接埠數目,並允許透過 Windows Server 2016 的 [軟體定義網路] 功能來管理網路功能。The result is reducing the number of physical NIC ports that would otherwise be required and allows managing the networking through the Software Defined Network features of Windows Server 2016. 本指南中的步驟適用於實作支援父分割之 RDMA 和已設定 SET 的新虛擬交換器。The steps in this guide are for implementing the new virtual switch with RDMA enabled to the parent partition and SET configured.

以下假設有 2 個 RDMA 實體 NIC 連接埠 (1 個雙埠或 2 個單埠),以及使用支援 RDMA 之主機虛擬 NIC 部署的 Hyper-V 交換器。The following assumes 2 RDMA physical NIC Ports (1 dual port, or 2 single port) and the Hyper-V switch deployed with RDMA-enabled host virtual NICs. 請完成下列步驟,以設定「每部伺服器」的網路。Complete the following steps to configure the network on each server.

如果您要在虛擬機器內測試儲存空間直接存取,請略過<網路組態>這節。Skip this Network Configuration section, if you are testing Storage Spaces Direct inside of virtual machines. 虛擬機器內部的網路無法使用 RDMA。RDMA is not available for networking inside a virtual machine.

步驟 2.1:設定 Top of Rack (TOR) 交換器Step 2.1: Configure the Top of Rack (TOR) Switch

我們的範例組態所使用的網路介面卡使用 RoCEv2 實作 RDMA。Our example configuration is using a network adapter that implements RDMA using RoCEv2. 這種 RDMA 的網路 QoS 和可靠的資料流程,要求 TOR 必須為 NIC 連線的網路連接埠設定特定功能。Network QoS and reliable flow of data for this type of RDMA requires that the TOR have specific capabilities set for the network ports that the NICs are connected to. 如果您要使用 iWarp 進行部署,TOR 可能不需要任何設定。If you are deploying with iWarp, the TOR may not need any configuration.

步驟 2.2:啟用網路服務品質 (QoS)Step 2.2: Enable Network Quality of Service (QoS)

網路 QoS 在此超融合組態中是用來確保軟體定義儲存系統在節點之間有足夠的頻寬可以進行通訊,以確保擁有回復性與效能。Network QoS is used to in this hyper-converged configuration to ensure that the Software Defined Storage system has enough bandwidth to communicate between the nodes to ensure resiliency and performance. 從管理系統使用 Enter-PSSession 執行下列步驟進行連線,並對每部伺服器執行下列動作。Do the following steps from a management system using Enter-PSSession to connect and do the following to each of the servers.

  1. 設定 SMB 直接傳輸的網路 QoS 原則,這是軟體定義儲存系統使用的通訊協定。Set a network QoS policy for SMB-Direct, which is the protocol that the software defined storage system uses.

    New-NetQosPolicy "SMB" –NetDirectPortMatchCondition 445 –PriorityValue8021Action 3
    

    輸出應該看起來像這樣:The output should look something like this:

    Name : SMB
    Owner : Group Policy (Machine)
    NetworkProfile : All
    Precedence : 127
    JobObject :
    NetDirectPort : 445
    PriorityValue :
    
  2. 如果您正在使用 RoCEv2 時,請安裝資料中心橋接 (若還沒有) (請參閱步驟 1.3),然後開啟 SMB 的流量控制,如下所示 (對 iWarp 為非必要):If you are using RoCEv2, install Data-Center-Bridging if you haven't already (see Step 1.3), then turn on Flow Control for SMB as follows (not required for iWarp):

    Enable-NetQosFlowControl –Priority 3
    
  3. 停用其他流量的流量控制,如下所示 (對 iWarp 為選擇性):Disable flow control for other traffic as follows (optional for iWarp):

    Disable-NetQosFlowControl –Priority 0,1,2,4,5,6,7
    
  4. 如下取得網路介面卡清單以找出目標介面卡 (RDMA 介面卡)︰Get a list of the network adapters to identify the target adapters (RDMA adapters) as follows:

    Get-NetAdapter | FT Name, InterfaceDescription, Status, LinkSpeed
    

    輸出應該看起來像下面這樣。The output should look something like the following. Mellanox ConnectX03 Pro 介面卡是 RDMA 網路介面卡,在此範例組態中也是唯一連線到交換器的網路介面卡。The Mellanox ConnectX03 Pro adapters are the RDMA network adapters and are the only ones connected to a switch, in this example configuration.

    Name       InterfaceDescription                                      Status       LinkSpeed
    ----       --------------------------------------------------------- ----------   ----------
    NIC3       QLogic BCM57800 Gigabit Ethernet (NDIS VBD Client) #46    Disconnected 0 bps
    Ethernet 2 Mellanox ConnectX-3 Pro Ethernet Adapter #2               Up           10 Gbps
    SLOT #     Mellanox ConnectX-3 Pro Ethernet Adapter                  Up           10 Gbps
    NIC4       QLogic BCM57800 Gigabit Ethernet (NDIS VBD Client) #47    Disconnected 0 bps
    NIC1       QLogic BCM57800 10 Gigabit Ethernet (NDIS VBD Client) #44 Disconnected 0 bps
    NIC2       QLogic BCM57800 10 Gigabit Ethernet (NDIS VBD Client) #45 Disconnected 0 bps
    
  5. 將網路 QoS 原則套用到目標介面卡。Apply network QoS policy to the target adapters. 目標介面卡是 RDMA 介面卡。The target adapters are the RDMA adapters. 在下列範例中的 –Name 使用目標介面卡的「名稱」Use the "Name" of the target adapters for the –Name in the following example

    Enable-NetAdapterQos –Name "<adapter1>", "<adapter2>"
    

    使用上面的範例,命令看起來會像這樣︰Using the example above, the command would look like this:

    Enable-NetAdapterQoS –Name "Ethernet 2", "SLOT #"
    
  6. 建立「流量」類別,並給 SMB 直接傳輸最小頻寬的 30%。Create a Traffic class and give SMB Direct 30% of the bandwidth minimum. 類別的名稱將是 "SMB"。The name of the class will be "SMB".

    New-NetQosTrafficClass "SMB" –Priority 3 –BandwidthPercentage 30 –Algorithm ETS
    

步驟 2.3:建立 Hyper-V 虛擬交換器Step 2.3: Create a Hyper-V virtual switch

Hyper-V 虛擬交換器可讓主機和虛擬機器兩者使用實體 NIC 連接埠,而且會啟用主機的 RDMA 而獲得更多輸送量、降低延遲,以及減少系統 (CPU) 影響。The Hyper-V virtual switch allows the physical NIC ports to be used for both the host and virtual machines and enables RDMA from the host which allows for more throughput, lower latency, and less system (CPU) impact. 實體網路介面是使用 Windows Server 2016 中新的 Switch Embedded Teaming (SET) 功能組合在一起。The physical network interfaces are teamed using the Switch Embedded Teaming (SET) feature that is new in Windows Server 2016.

從管理系統使用 Enter-PSSession 執行下列步驟連線到每部伺服器。Do the following steps from a management system using Enter-PSSession to connect to each of the servers.

  1. 找出網路介面卡 (您將在步驟 2 中使用此資訊)Identify the network adapters (you will use this info in step #2)

    Get-NetAdapter | FT Name, InterfaceDescription, Status, LinkSpeed
    
  2. 建立連線至這兩個實體網路介面卡的虛擬交換器,並啟用 Switch Embedded Teaming (SET)。Create the virtual switch connected to both of the physical network adapters, and enable the Switch Embedded Teaming (SET). 您可能會注意到您的 PSSession 中斷連線的訊息。You may notice a message that your PSSession lost connection. 這是預期的行為,您的工作階段會重新連線。This is expected and your session will reconnect.

    New-VMSwitch –Name SETswitch –NetAdapterName "<adapter1>", "<adapter2>" –EnableEmbeddedTeaming $true
    
  3. 將主機 vNIC 新增至虛擬交換器。Add host vNICs to the virtual switch. 這會從您剛才設定好讓管理作業系統使用的虛擬交換器設定虛擬 NIC (vNIC)。This configures a virtual NIC (vNIC) from the virtual switch that you just configured for the management OS to use.

    Add-VMNetworkAdapter –SwitchName SETswitch –Name SMB_1 –managementOS
    Add-VMNetworkAdapter –SwitchName SETswitch –Name SMB_2 –managementOS
    
  4. 設定主機 vNIC 使用 Vlan。Configure the host vNIC to use a Vlan. 它們可以位於相同或不同的 VLAN 上。They can be on the same or different Vlans.

    Set-VMNetworkAdapterVlan -VMNetworkAdapterName "SMB_1" -VlanId <vlan number> -Access -ManagementOS
    Set-VMNetworkAdapterVlan -VMNetworkAdapterName "SMB_2" -VlanId <vlan number> -Access -ManagementOS
    
  5. 確認已設定好 VLANIDVerify that the VLANID is set

    Get-VMNetworkAdapterVlan –ManagementOS
    

    輸出應該看起來像這樣:The output should look like this:

    VMName VMNetworkAdapterName Mode VlanList
    ------ ------------------- ---- --------
           SMB_1               Access 13
           SETswitch           Untagged
           SMB_2               Access 13
    
  6. 重新啟動每張主機 vNIC 介面卡,讓 VLAN 為作用中。Restart each host vNIC adapter so that the Vlan is active.

    Restart-NetAdapter "vEthernet (SMB_1)"
    Restart-NetAdapter "vEthernet (SMB_2)"
    
  7. 在主機 vNIC 介面卡上啟用 RDMAEnable RDMA on the host vNIC adapters

    Enable-NetAdapterRDMA "vEthernet (SMB_1)", "vEthernet (SMB_2)"
    
  8. 將設定支援 RDMA 的每個 vNIC 與連線到虛擬交換器的實體介面卡產生關聯Associate each of the vNICs configured for RDMA to a physical adapter that is connected to the virtual switch

    Set-VMNetworkAdapterTeamMapping -VMNetworkAdapterName "SMB_1" –ManagementOS –PhysicalNetAdapterName "SLOT 2"
    Set-VMNetworkAdapterTeamMapping -VMNetworkAdapterName "SMB_2" –ManagementOS –PhysicalNetAdapterName "SLOT 2 2"
    
  9. 確認 RDMA 功能。Verify RDMA capabilities.

    Get-SmbClientNetworkInterface
    

    對於啟用 RDMA 的介面,[支援 RDMA] 的值應該會顯示 TrueValues should show True for RDMA Capable for the RDMA enabled interfaces. 在下列範例中,介面卡 vEthernet (SMB_1)vEthernet (SMB_2) 會顯示 True。The following is an example where you show true for the adapters vEthernet (SMB_1) and vEthernet (SMB_2).

步驟 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. 下列步驟不應該使用 PSSession 從遠端執行,而要使用系統管理權限,在管理系統的本機 PowerShell 工作階段中執行。The following steps should NOT be run remotely using a PSSession, but instead run in a local PowerShell session on the management system, with administrative permissions.

步驟 3.1:執行叢集驗證Step 3.1: Run cluster validation

在此步驟中,您將執行叢集驗證工具,確保伺服器節點都正確設定以使用儲存空間直接存取建立叢集。In this step, you will 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.2:建立叢集Step 3.2: Create a cluster

在此步驟中,您將使用下列 PowerShell Cmdlet 建立一個叢集,其中包含您在上一個步驟中已驗證過可用來建立叢集的節點。In this step, you will create a cluster with the nodes that you have validated for cluster creation in the preceding step using the following PowerShell cmdlet. -NoStorage 參數很重要,必須加入 Cmdlet,否則磁碟可能會自動加入叢集,您就必須在啟用儲存空間直接存取之前先移除這些磁碟,否則不會包含在儲存空間直接存取的儲存集區中。The –NoStorage parameter is important to be added to the cmdlet, otherwise disks may be automatically added to the cluster and you will need to remove them before enabling Storage Spaces Direct otherwise they will not be included in the Storage Spaces Direct storage pool.

建立叢集時,您會收到一則警告指出 -「建立叢集角色時的問題可能會讓角色無法啟動。When creating the cluster, you will 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.3:設定叢集見證Step 3.3: Configure a cluster witness

建議您為叢集設定見證,讓 3 個或多個節點系統可以承受兩個節點失敗或離線。It is recommended that you configure a witness for the cluster, so that a 3 or more node system can withstand two nodes failing or being offline. 雙節點部署需要一個叢集見證,否則其中一個節點離線也會使另一個節點變成無法使用。A 2 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.4︰清理磁碟Step 3.4: Clean disks

要供儲存空間直接存取使用的磁碟都必須是空的,而且沒有磁碟分割或其他資料。The disks intended to be used for Storage Spaces Direct need to be empty and without partitions or other data. 如果磁碟有磁碟分割或其他資料,就不會包含在儲存空間直接存取系統中。If a disk has partitions or other data, it will not be included in the Storage Spaces Direct system.

在管理系統上,以系統管理員權限開啟 PowerShell ISE 視窗,然後建立並執行下列指令碼,並以適當的叢集名稱取代 <ClusterName> 變數。On the management system, open a PowerShell ISE window with Administrator privileges, and then create and run the following script, replacing the <ClusterName> variable with the appropriate cluster name. 執行這個指令碼有助於找出每個節點上被偵測到可供儲存空間直接存取使用的磁碟,而且會移除這些磁碟中的所有資料和磁碟分割。Running this script will help identify the disks on each node that are detected to be able to be used for Storage Spaces Direct, and removes all data and partitions from those disks.

如果磁碟已清理過或驗證過沒有磁碟分割,您可以略過此步驟。You can skip this step if the disks have already been cleaned or verified to be without partitions.

警告

在執行這組命令之前,請確定叢集的所有磁碟上沒有任何資料。Ensure that there is no data on any of the disks of the cluster before running this set of commands. 它將會移除作業系統未使用的任何磁碟資料。It will remove any data on the disks that are not being use by the operating system.

icm (Get-Cluster -Name <cluster or node name> | Get-ClusterNode) {

Update-StorageProviderCache

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 |? Number -ne $null |? IsBoot -ne $true |? IsSystem -ne $true |? PartitionStyle -eq RAW | Group -NoElement -Property FriendlyName

} | Sort -Property PsComputerName,Count

這個指令碼的輸出看起來會像下面這樣。The output from this script will look similar to the following. Count 是每個叢集節點 (PSComputerName) 有該名稱的磁碟數目︰The Count is the number of disks with that name per cluster node (PSComputerName):

Count Name                          PSComputerName
----- ----                          --------------
4     ATA SSDSC2BA800G4n            StorageClusterNode1
10    ATA ST4000NM0033              StorageClusterNode1
4     ATA SSDSC2BA800G4n            StorageClusterNode2
10    ATA ST4000NM0033              StorageClusterNode2
4     ATA SSDSC2BA800G4n            StorageClusterNode3
10    ATA ST4000NM0033              StorageClusterNode3
4     ATA SSDSC2BA800G4n            StorageClusterNode4
10    ATA ST4000NM0033              StorageClusterNode4

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

建立叢集之後,請使用 Enable-ClusterStorageSpacesDirect PowerShell 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)

  • 階層︰建立 2 層做為預設階層。Tiers: Creates 2 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-Volume cmdlet,因為它提供最快速與最簡單的體驗。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:部署虛擬機器Step 3.7: Deploy virtual machines

現在您可以將虛擬機器佈建到超交集儲存空間直接存取叢集的節點上。At this point you can provision virtual machines on to the nodes of the hyper-converged 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 Virtual Machine Manager。You may use in-box tools or other tools to manage the storage and virtual machines, including System Center Virtual Machine Manager.

請參閱See also