將儲存空間直接存取伺服器離線以進行維護Taking a Storage Spaces Direct server offline for maintenance

適用於︰Windows Server 2016Applies To: Windows Server 2016

此主題說明如何使用 直接儲存空間 正確地重新啟動或關閉伺服器。This topic provides guidance on how to properly restart or shutdown servers with Storage Spaces Direct.

透過「儲存空間直接存取」將伺服器離線,也意味著將叢集中所有伺服器共用的儲存空間部分離線。With Storage Spaces Direct, taking a server offline (bringing it down) also means taking offline portions of the storage that is shared across all servers in the cluster. 若要這樣做,您必須先暫停要離線的伺服器、將角色移至叢集中的其他伺服器,並確認叢集中其他伺服器上的所有資料皆可使用,以確保維護期間資料的安全及正常存取。Doing so requires pausing (suspending) the server you want to take offline, moving roles to other servers in the cluster, and verifying that all data is available on the other servers in the cluster so that the data remains safe and accessible throughout the maintenance.

使用下列程序,在將儲存空間直接存取叢集中的伺服器離線之前,先正確將其暫停。Use the following procedures to properly pause a server in a Storage Spaces Direct cluster before taking it offline.

重要

若要在儲存空間直接存取叢集中安裝更新,請使用叢集感知更新 (CAU),它會自動執行此主題中的程序,因此您不需要在安裝更新時手動執行。To install updates on a Storage Spaces Direct cluster, use Cluster-Aware Updating (CAU), which automatically performs the procedures in this topic so you don't have to when installing updates. 如需詳細資訊,請參閱 叢集感知更新 (CAU)For more info, see Cluster Aware Updating (CAU).

確認伺服器是否可安全離線。Verifying it's safe to take the server offline

將伺服器離線以進行維護之前,確認所有磁碟區皆狀況良好。Before taking a server offline for maintenance, verify that all your volumes are healthy.

若要這樣做,請使用系統管理權限開啟 PowerShell 工作階段,並執行下列命令以檢視磁碟區狀態︰To do so, open a PowerShell session with Administrator permissions and then run the following command to view volume status:

Get-VirtualDisk 

此輸出可能看起來會像以下的範例:Here's an example of what the output might look like:

FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach Size
------------ --------------------- ----------------- ------------ -------------- ----
MyVolume1    Mirror                OK                Healthy      True           1 TB
MyVolume2    Mirror                OK                Healthy      True           1 TB
MyVolume3    Mirror                OK                Healthy      True           1 TB

確認每個磁碟區 (虛擬磁碟) 的 [HealthStatus]屬性皆為 [狀況良好]Verify that the HealthStatus property for every volume (virtual disk) is Healthy.

若要在容錯移轉叢集管理員中執行此動作,請移至 [儲存] > [磁碟]To do this in Failover Cluster Manager, go to Storage > Disks.

確認每個磁碟區 (虛擬磁碟) 的 [狀態] 欄皆顯示 [線上]Verify that the Status column for every volume (virtual disk) shows Online.

暫停和清空伺服器Pausing and draining the server

在重新啟動或關閉伺服器之前,先暫停和清空任何角色,例如在其中執行的虛擬機器。Before restarting or shutting down the server, pause and drain (move off) any roles such as virtual machines running on it. 這也可以讓儲存空間直接存取能正常清除和認可資料,以確保該伺服器上執行的任何應用程式皆能完全掌握關機動作。This also gives Storage Spaces Direct an opportunity to gracefully flush and commit data to ensure the shutdown is transparent to any applications running on that server.

重要

在關閉叢集伺服器之前,請務必先將其暫停並清空。Always pause and drain clustered servers before restarting or shutting them down.

在 PowerShell 中,(以系統管理員身分) 執行下列 Cmdlet 以將其暫停和清空。In PowerShell, run the following cmdlet (as Administrator) to pause and drain.

Suspend-ClusterNode -Drain

若要在容錯移轉叢集管理員中執行此動作,請移至 [節點],在節點上按滑鼠右鍵,然後選取 [暫停] > [清空角色]To do this in Failover Cluster Manager, go to Nodes, right-click the node, and then select Pause > Drain Roles.

Pause-Drain

所有虛擬機器都將開始即時移轉至叢集中的其他伺服器。All virtual machines will begin live migrating to other servers in the cluster. 這可能需要幾分鐘的時間。This can take a few minutes.

注意

當您正確暫停並清空叢集結點時,Windows 會執行自動安全檢查以確保該程序可繼續執行。When you pause and drain the cluster node properly, Windows performs an automatic safety check to ensure it is safe to proceed. 如果磁碟區狀況不良,它將會停止,並提醒您繼續執行並不安全。If there are unhealthy volumes, it will stop and alert you that it's not safe to proceed.

Safety-Check

正在關閉伺服器Shutting down the server

伺服器完成清空之後,將會在容錯移轉叢集管理員和 PowerShell 中顯示為 [已暫停]Once the server has completed draining, it will show as Paused in Failover Cluster Manager and PowerShell.

已暫停

您現在可以放心地像平常一樣重新啟動或將它關閉 (例如,使用 Restart-Computer 或 Stop-Computer PowerShell Cmdlet)。You can now safely restart or shut it down, just like you would normally (for example, by using the Restart-Computer or Stop-Computer PowerShell cmdlets).

注意

當伺服器暫停時,儲存體 IO 並不會流向其磁碟機。While the server is paused, storage IO does not flow to its drives. 這表示,雖然所有的磁碟區仍保持連線且可存取,其在容錯移轉叢集管理員或 PowerShell 中仍會顯示為 [未完成]This means that although all your volumes remain online and accessible, they will show as Incomplete in Failover Cluster Manager or PowerShell. 此為預期性行為。This is expected.

Get-VirtualDisk 

FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach Size
------------ --------------------- ----------------- ------------ -------------- ----
MyVolume1    Mirror                Incomplete        Warning      True           1 TB
MyVolume2    Mirror                Incomplete        Warning      True           1 TB
MyVolume3    Mirror                Incomplete        Warning      True           1 TB

這是正常現象,因此應該不會造成問題。This is normal and should not cause concern. 所有的磁碟區仍保持連線且可存取。All your volumes remain online and accessible.

繼續執行伺服器Resuming the server

當您準備讓伺服器開始再次裝載工作負載時,請繼續執行。When you are ready for the server to begin hosting workloads again, resume it.

在 PowerShell 中,(以系統管理員身分) 執行下列 Cmdlet 以繼續執行。In PowerShell, run the following cmdlet (as Administrator) to resume.

Resume-ClusterNode

若要回復之前在此伺服器上執行的角色,請使用選擇性 [-Failback] 旗標。To move the roles that were previously running on this server back, use the optional -Failback flag.

Resume-ClusterNode –Failback Immediate

若要在容錯移轉叢集管理員中執行此動作,請移至 [節點],在節點上按滑鼠右鍵,然後選取 [繼續] > [容錯回復角色]To do this in Failover Cluster Manager, go to Nodes, right-click the node, and then select Resume > Fail Roles Back.

Resume-Failback

等候存放裝置重新同步Waiting for storage to resync

當伺服器繼續執行時,任何在伺服器暫停期間 (且磁碟機未接收儲存體 IO) 發生的寫入動作皆需要重新同步。When the server resumes, any new writes that happened while it was paused (while its drives were not receiving storage IO) need to resync. 此動作會自動執行。This happens automatically. 使用智慧型變更追蹤時,您不需要掃描或同步處理所有資料,只需要針對變更部分執行這些動作。Using intelligent change tracking, it's not necessary for all data to be scanned or synchronized; only the changes. 此程序會進行調整以減少對於生產工作負載造成的影響。This process is throttled to mitigate impact to production workloads. 根據暫停時間的長短以及寫入的新資料數量,系統可能需要數分鐘完成。Depending on how long the server was paused, and how much new data as written, it may take many minutes to complete.

您必須等候重新同步完成才能將從叢集中的其他伺服器離線。You must wait for re-syncing to complete before taking any others servers in the cluster offline.

在 PowerShell 中,(以系統管理員身分) 執行下列 Cmdlet 以監視進度。In PowerShell, run the following cmdlet (as Administrator) to monitor progress.

Get-StorageJob

以下是一些顯示重新同步 (維修) 工作的輸出範例︰Here's some example output, showing the resync (repair) jobs:

Name   IsBackgroundTask ElapsedTime JobState  PercentComplete BytesProcessed BytesTotal
----   ---------------- ----------- --------  --------------- -------------- ----------
Repair True             00:06:23    Running   65              11477975040    17448304640
Repair True             00:06:40    Running   66              15987900416    23890755584
Repair True             00:06:52    Running   68              20104802841    22104819713

BytesTotal 顯示需要重新同步多少儲存空間。The BytesTotal shows how much storage needs to resync. PercentComplete 顯示進度。The PercentComplete displays progress.

警告

請務必等候這些修復工作完成後再將另一部伺服器離線。It's not safe to take another server offline until these repair jobs finish.

在此期間,您的磁碟區將繼續顯示為 [Warning],此為正常現象。During this time, your volumes will continue to show as Warning, which is normal.

例如,如果您使用 Get-VirtualDisk Cmdlet,您可能會看到以下輸出︰For example, if you use the Get-VirtualDisk cmdlet, you might see the following output:

FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach Size
------------ --------------------- ----------------- ------------ -------------- ----
MyVolume1    Mirror                InService         Warning      True           1 TB
MyVolume2    Mirror                InService         Warning      True           1 TB
MyVolume3    Mirror                InService         Warning      True           1 TB

一旦工作完成,請使用 Get-VirtualDisk Cmdlet 以再次確認磁碟區顯示為 [Healthy]Once the jobs complete, verify that volumes show Healthy again by using the Get-VirtualDisk cmdlet. 以下是一些輸出範例︰Here's some example output:

FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach Size
------------ --------------------- ----------------- ------------ -------------- ----
MyVolume1    Mirror                OK                Healthy      True           1 TB
MyVolume2    Mirror                OK                Healthy      True           1 TB
MyVolume3    Mirror                OK                Healthy      True           1 TB

您現在可以放心地暫停並重新啟動叢集中的其他伺服器。It's now safe to pause and restart other servers in the cluster.

另請參閱See also