本主题介绍如何使用 PowerShell 删除存储空间直通中的服务器。
删除服务器但保留其驱动器
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. 如果你使用故障转移群集管理器删除服务器,那么这是默认行为。
Use the Remove-ClusterNode cmdlet in PowerShell:
Remove-ClusterNode <Name>
此 cmdlet 会快速成功而不考虑任何容量注意事项,因为存储池会“记住”缺少的驱动器,并期待它们复原。 数据不会从缺少的驱动器中移走。 While they remain missing, their OperationalStatus will show as "Lost Communication", and your volumes will show "Incomplete".
当驱动器复原时,系统会自动检测它们并将其与池重新关联,即使它们现在在新服务器中也不例外。
Warning
不要将具有池数据的驱动器从一个服务器分发到多个其他服务器。 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.
删除服务器及其驱动器
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.
Use the Remove-ClusterNode cmdlet with the optional -CleanUpDisks flag:
Remove-ClusterNode <Name> -CleanUpDisks
此 cmdlet 可能会运行很长时间(有时会运行许多个小时),因为 Windows 必须将存储在该服务器上的所有数据移到群集中的其他服务器。 完成此操作后,将从存储池中永久删除驱动器,并会将受影响的卷恢复为正常运行状态。
Requirements
To permanently scale-in (remove a server and its drives), your cluster must meet the following two requirements. 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
首先,你必须在其余服务器中具有足够的存储容量以容纳所有卷。
例如,如果你安装了四个服务器,每个服务器都有 10 个 1 TB 的驱动器,那么你拥有 40 TB 的总物理存储容量。 删除一个服务器及其所有驱动器后,你将剩下 30 TB 的容量。 如果卷的占用空间合计超过了 30 TB,则其余服务器将无法容纳它们,因此 cmdlet 将返回错误,并且不会移动任何数据。
足够的故障域
其次,你必须具有足够的故障域(通常是服务器)来提供卷复原。
例如,如果你的卷在服务器级别使用三向镜像来进行复原,则它们无法完全正常运行,除非你至少具有三个服务器。 如果你刚好安装了 3 个服务器,然后尝试删除一个服务器及其所有驱动器,则 cmdlet 将返回一个错误并且不会移动任何数据。
下表显示了每种复原类型所需的最小故障域数。
Resiliency | 所需的最小容错域数 |
---|---|
Two-way mirror | 2 |
Three-way mirror | 3 |
Dual parity | 4 |
Note
可以简单地使用较少的服务器,例如在故障或维护期间。 但是,为了使卷恢复到完全正常运行状态,你必须安装上面列出的最小数量的服务器。