删除存储空间直通中的服务器Removing servers in Storage Spaces Direct

适用于:Windows Server 2019、Windows Server 2016Applies to: Windows Server 2019, Windows Server 2016

本主题介绍如何使用 PowerShell 删除存储空间直通中的服务器。This topic describes how to remove servers in Storage Spaces Direct using PowerShell.

删除服务器但保留其驱动器Remove a server but leave its drives

如果你打算不久将服务器添加回群集,或者如果你打算通过将其移到另一个服务器来保留其驱动器,则可以从群集中删除服务器,但从存储池中删除其驱动器。If you intend to add the server back into the cluster soon, or if you intend to keep its drives by moving them to another server, you can remove the server from the cluster without removing its drives from the storage pool. 如果你使用故障转移群集管理器删除服务器,那么这是默认行为。This is the default behavior if you use Failover Cluster Manager to remove the server.

使用 PowerShell 中的 Remove-ClusterNode cmdlet:Use the Remove-ClusterNode cmdlet in PowerShell:

Remove-ClusterNode <Name>

此 cmdlet 会快速成功而不考虑任何容量注意事项,因为存储池会“记住”缺少的驱动器,并期待它们复原。This cmdlet succeeds quickly, regardless of any capacity considerations, because the storage pool "remembers" the missing drives and expects them to come back. 数据不会从缺少的驱动器中移走。There is no data movement away from the missing drives. 虽然缺少驱动器,但其 OperationalStatus 将显示为“通信中断”,并且你的卷将显示为“不完整”。While they remain missing, their OperationalStatus will show as "Lost Communication", and your volumes will show "Incomplete".

当驱动器复原时,系统会自动检测它们并将其与池重新关联,即使它们现在在新服务器中也不例外。When the drives come back, they are automatically detected and re-associated with the pool, even if they are now in a new server.

警告

不要将具有池数据的驱动器从一个服务器分发到多个其他服务器。Do not distribute drives with pool data from one server into multiple other servers. 例如,如果一个具有十个驱动器的服务器发生故障(例如,因为其主板或启动驱动器发生故障),那么你可以将所有十个驱动器移到一个新服务器中,但是不可以将其中每个驱动器分别移到不同的其他服务器中。For example, if one server with ten drives fails (because its motherboard or boot drive failed, for instance), you can move all ten drives into one new server, but you cannot move each of them separately into different other servers.

删除服务器及其驱动器Remove a server and its drives

如果你想从群集中永久删除服务器(有时称为缩容),则可以从群集中删除该服务器从存储池中删除其驱动器。If you want to permanently remove a server from the cluster (sometimes referred to as scaling-in), you can remove the server from the cluster and remove its drives from the storage pool.

Remove-ClusterNode cmdlet 与可选的 -CleanUpDisks 标志配合使用:Use the Remove-ClusterNode cmdlet with the optional -CleanUpDisks flag:

Remove-ClusterNode <Name> -CleanUpDisks

此 cmdlet 可能会运行很长时间(有时会运行许多个小时),因为 Windows 必须将存储在该服务器上的所有数据移到群集中的其他服务器。This cmdlet might take a long time (sometimes many hours) to run because Windows must move all the data stored on that server to other servers in the cluster. 完成此操作后,将从存储池中永久删除驱动器,并会将受影响的卷恢复为正常运行状态。Once this is complete, the drives are permanently removed from the storage pool, returning affected volumes to a healthy state.

要求Requirements

若要永久缩容(删除服务器其驱动器),群集必须满足以下两个要求。To permanently scale-in (remove a server and its drives), your cluster must meet the following two requirements. 否则,Remove-ClusterNode -CleanUpDisks cmdlet 将在开始执行任何数据移动之前立即返回错误以最大程度减少中断。If it doesn't, the Remove-ClusterNode -CleanUpDisks cmdlet will return an error immediately, before it begins any data movement, to minimize disruption.

足够的容量Enough capacity

首先,剩余服务器中必须有足够的存储容量,才能容纳所有卷。First, you must have enough storage capacity in the remaining servers to accommodate all your volumes.

例如,如果你安装了四个服务器,每个服务器都有 10 个 1 TB 的驱动器,那么你拥有 40 TB 的总物理存储容量。For example, if you have four servers, each with 10 x 1 TB drives, you have 40 TB of total physical storage capacity. 删除一个服务器及其所有驱动器后,你将剩下 30 TB 的容量。After removing one server and all its drives, you will have 30 TB of capacity left. 如果卷的占用空间合计超过了 30 TB,则其余服务器将无法容纳它们,因此 cmdlet 将返回错误,并且不会移动任何数据。If the footprints of your volumes are more than 30 TB together, they won't fit in the remaining servers, so the cmdlet will return an error and not move any data.

足够的故障域Enough fault domains

其次,你必须具有足够的故障域(通常是服务器)来提供卷复原。Second, you must have enough fault domains (typically servers) to provide the resiliency of your volumes.

例如,如果你的卷在服务器级别使用三向镜像来进行复原,则它们无法完全正常运行,除非你至少具有三个服务器。For example, if your volumes use three-way mirroring at the server level for resiliency, they cannot be fully healthy unless you have at least three servers. 如果你刚好安装了 3 个服务器,然后尝试删除一个服务器及其所有驱动器,则 cmdlet 将返回一个错误并且不会移动任何数据。If you have exactly three servers, and then attempt to remove one and all its drives, the cmdlet will return an error and not move any data.

下表显示了每种复原类型所需的最小故障域数。This table shows the minimum number of fault domains required for each resiliency type.

复原能力Resiliency 所需的最小故障域数Minimum required fault domains
“双向镜像”Two-way mirror 22
“三向镜像”Three-way mirror 33
双重奇偶校验Dual parity 44

备注

可以简单地使用较少的服务器,例如在故障或维护期间。It is okay to briefly have fewer servers, such as during failures or maintenance. 但是,为了使卷恢复到完全正常运行状态,你必须安装上面列出的最小数量的服务器。However, in order for volumes to return to a fully healthy state, you must have the minimum number of servers listed above.

其他参考Additional References