排查存储空间和存储空间直通的运行状况与操作状态问题

本主题介绍存储空间直通存储空间中的存储池、虚拟磁盘(位于存储空间中的卷下方)和驱动器的运行状况和操作状态。 当你尝试排查各种问题(例如,由于使用只读配置而无法删除虚拟磁盘)时,这些状态可以提供宝贵的信息。 本主题还将讨论为何无法将驱动器添加到池中 (CannotPoolReason)。

Storage Spaces has three primary objects - physical disks (hard drives, SSDs, etc.) that are added to a storage pool, virtualizing the storage so that you can create virtual disks from free space in the pool, as shown here. 池元数据写入池中的每个驱动器。 卷是在虚拟磁盘上创建的,用于存储文件,但本主题不讨论卷。

将物理磁盘添加到存储池,然后基于池空间创建虚拟磁盘

可以在服务器管理器中或使用 PowerShell 查看运行状况和操作状态。 Here's an example of a variety of (mostly bad) health and operational states on a Storage Spaces Direct cluster that's missing most of its cluster nodes (right-click the column headers to add Operational Status). 这不是一个正常的群集。

服务器管理器显示了存储空间直通群集中缺少两个节点的结果 - 大量缺失的物理磁盘和虚拟磁盘处于不正常状态

存储池状态

Every storage pool has a health status - Healthy, Warning, or Unknown/Unhealthy, as well as one or more operational states.

若要了解池所处的状态,请使用以下 PowerShell 命令:

Get-StoragePool -IsPrimordial $False | Select-Object HealthStatus, OperationalStatus, ReadOnlyReason

以下示例输出显示存储池处于“未知”运行状态和“只读”操作状态:

FriendlyName                OperationalStatus HealthStatus IsPrimordial IsReadOnly
------------                ----------------- ------------ ------------ ----------
S2D on StorageSpacesDirect1 Read-only         Unknown      False        True

以下部分列出了运行状况和工作状态。

池运行状态:正常

Operational state Description
OK 存储池正常。

池运行状态:警告

When the storage pool is in the Warning health state, it means that the pool is accessible, but one or more drives failed or are missing. 因此,该存储池的复原能力可能会降低。

Operational state Description
Degraded 存储池中的驱动器有故障或缺失。 这种状态只会出现在托管池元数据的驱动器上。

Action: Check the state of your drives and replace any failed drives before there are additional failures.

池运行状态:“未知”或“不正常”

When a storage pool is in the Unknown or Unhealthy health state, it means that the storage pool is read-only and can't be modified until the pool is returned to the Warning or OK health states.

Operational state Read-only reason Description
Read-only Incomplete This can occur if the storage pool loses its quorum, which means that most drives in the pool have failed or are offline for some reason. 当池丢失仲裁时,存储空间会自动将该池的配置设置为只读,直到再次有足够的驱动器可用。

Action:
1. 重新连接任何缺失的驱动器,如果使用的是存储空间直通,请将所有服务器联机。
2. 使用管理权限打开 PowerShell 会话并键入以下命令,将池重新设置为读写:

Get-StoragePool <PoolName> -IsPrimordial $False | Set-StoragePool -IsReadOnly $false
Policy 管理员将存储池设置为只读。

Action: To set a clustered storage pool to read-write access in Failover Cluster Manager, go to Pools, right-click the pool and then select Bring Online.

对于其他服务器和电脑,请使用管理权限打开 PowerShell 会话,然后键入:

Get-StoragePool <PoolName> | Set-StoragePool -IsReadOnly $false

Starting 存储空间正在启动或等待池中连接的驱动器。 这应该是一种临时状态。 一旦完全启动,该池应该就会转换为不同的操作状态。

Action: If the pool stays in the Starting state, make sure that all drives in the pool are connected properly.

另请参阅 Windows Server 存储论坛

虚拟磁盘状态

在存储空间中,卷放置在从池的可用空间中划分出来的虚拟磁盘(存储空间)上。 Every virtual disk has a health status - Healthy, Warning, Unhealthy, or Unknown as well as one or more operational states.

若要确定虚拟磁盘所处的状态,请使用以下 PowerShell 命令:

Get-VirtualDisk | Select-Object FriendlyName,HealthStatus, OperationalStatus, DetachedReason

以下输出示例显示了一个分离的虚拟磁盘和一个已降级/不完整的虚拟磁盘:

FriendlyName HealthStatus OperationalStatus      DetachedReason
------------ ------------ -----------------      --------------
Volume1      Unknown      Detached               By Policy
Volume2      Warning      {Degraded, Incomplete} None

以下部分列出了运行状况和工作状态。

虚拟磁盘运行状态:正常

Operational state Description
OK 虚拟磁盘正常。
Suboptimal 数据未均匀写入到各个驱动器。

Action: Optimize drive usage in the storage pool by running the Optimize-StoragePool cmdlet.

虚拟磁盘运行状态:警告

When the virtual disk is in a Warning health state, it means that one or more copies of your data are unavailable, but Storage Spaces can still read at least one copy of your data.

Operational state Description
In service Windows 正在修复虚拟磁盘,例如在添加或删除驱动器之后。 修复完成后,虚拟磁盘应该会恢复“正常”运行状态。
Incomplete 由于一个或多个驱动器出现故障或缺失,虚拟磁盘的复原能力下降。 但是,缺失的驱动器包含数据的最新副本。

Action:
1. 重新连接所有缺失的驱动器,更换所有出现故障的驱动器,如果使用了存储空间直通,请将所有脱机的服务器联机。
2. If you're not using Storage Spaces Direct, next repair the virtual disk using the Repair-VirtualDisk cmdlet.
重新连接或更换驱动器后,存储空间直通会根据需要自动开始修复。
Degraded 由于一个或多个驱动器出现故障或缺失,并且这些驱动器包含已过时的数据副本,因此虚拟磁盘的复原能力下降。

Action:
1. 重新连接所有缺失的驱动器,更换所有出现故障的驱动器,如果使用了存储空间直通,请将所有脱机的服务器联机。
2. If you're not using Storage Spaces Direct, next repair the virtual disk using the Repair-VirtualDisk cmdlet.
重新连接或更换驱动器后,存储空间直通会根据需要自动开始修复。

虚拟磁盘运行状态:不正常

When a virtual disk is in an Unhealthy health state, some or all of the data on the virtual disk is currently inaccessible.

Operational state Description
No redundancy 由于太多驱动器发生故障,虚拟磁盘已丢失数据。

Action: Replace failed drives and then restore your data from backup.

虚拟磁盘运行状态:信息/未知

The virtual disk can also be in the Information health state (as shown in the Storage Spaces Control Panel item) or Unknown health state (as shown in PowerShell) if an administrator took the virtual disk offline or the virtual disk has become detached.

Operational state Detached reason Description
Detached By Policy 管理员已使虚拟磁盘脱机或将虚拟磁盘设置为需要手动附加,在这种情况下,必须在每次重启 Windows 时手动附加虚拟磁盘。

Action: Bring the virtual disk back online. To do so when the virtual disk is in a clustered storage pool, in Failover Cluster Manager select Storage>Pools>Virtual Disks, select the virtual disk that shows the Offline status and then select Bring Online.

若要使不在群集中的虚拟磁盘重新联机,请以管理员身份打开 PowerShell 会话,然后尝试使用以下命令:

Get-VirtualDisk | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk

若要在重启 Windows 之后自动附加所有非群集虚拟磁盘,请以管理员身份打开 PowerShell 会话,然后使用以下命令:

Get-VirtualDisk | Set-VirtualDisk -ismanualattach $false
多数磁盘不正常 在此虚拟磁盘使用的驱动器中,有过多的驱动器出现故障、缺失或包含过时的数据。

Action:
1. 重新连接所有缺失的驱动器,如果使用了存储空间直通,请将所有脱机的服务器联机。
2. 在所有驱动器和服务器都联机后,更换所有出现故障的驱动器。 See Health Service for details.
重新连接或更换驱动器后,存储空间直通会根据需要自动开始修复。
3. If you're not using Storage Spaces Direct, next repair the virtual disk using the Repair-VirtualDisk cmdlet.

如果有故障的磁盘数超过你的数据副本数,并且在每两次故障之间虚拟磁盘未修复,则虚拟磁盘上的所有数据将永久丢失。 在这种不妙的情况下,请删除虚拟磁盘,创建新的虚拟磁盘,然后从备份中还原。
Incomplete 没有足够的驱动器可用于读取虚拟磁盘。

Action:
1. 重新连接所有缺失的驱动器,如果使用了存储空间直通,请将所有脱机的服务器联机。
2. 在所有驱动器和服务器都联机后,更换所有出现故障的驱动器。 See Health Service for details.
重新连接或更换驱动器后,存储空间直通会根据需要自动开始修复。
3. If you're not using Storage Spaces Direct, next repair the virtual disk using the Repair-VirtualDisk cmdlet.

如果有故障的磁盘数超过你的数据副本数,并且在每两次故障之间虚拟磁盘未修复,则虚拟磁盘上的所有数据将永久丢失。 在这种不妙的情况下,请删除虚拟磁盘,创建新的虚拟磁盘,然后从备份中还原。
Timeout 附加虚拟磁盘花费的时间过长

Action: This shouldn't happen often, so you might try see if the condition passes in time. Or you can try disconnecting the virtual disk with the Disconnect-VirtualDisk cmdlet, then using the Connect-VirtualDisk cmdlet to reconnect it.

驱动器(物理磁盘)状态

以下部分描述了驱动器可能处于的运行状况。 Drives in a pool are represented in PowerShell as physical disk objects.

驱动器运行状况:正常

Operational state Description
OK 驱动器正常。
In service 驱动器正在执行某些内部保养操作。 When the action is complete, the drive should return to the OK health state.

驱动器运行状况:警告

处于“警告”状态的驱动器可以成功读取和写入数据,但存在问题。

Operational state Description
Lost communication 驱动器缺失。 如果使用的是存储空间直通,则原因可能是服务器已关闭。

Action: If you're using Storage Spaces Direct, bring all servers back online. 如果这样无法解决问题,请重新连接驱动器、更换驱动器,或者尝试按照“使用 Windows 错误报告进行故障排除 >物理磁盘超时”中的步骤获取有关该驱动器的详细诊断信息。
从池中删除 存储空间正在从其存储池中删除驱动器。

这是一种暂时性的状态。 删除完成后,如果驱动器仍附加到系统,则驱动器将转换为原始池中的另一种操作状态(通常为“正常”)。
启动维护模式 在管理员将驱动器置于维护模式后,存储空间正在将驱动器置于维护模式。 这是一种暂时性的状态 - 驱动器应该很快就会处于“维护中模式”状态。
维护中模式 管理员已将驱动器置于维护模式,从而停止了从该驱动器的读取和写入。 此操作通常在更新驱动器固件之前或者在测试故障时执行。

Action: To take the drive out of maintenance mode, use the Disable-StorageMaintenanceMode cmdlet.
停止维护模式 管理员使驱动器退出了维护模式,存储空间正在使驱动器重新联机。 This is a temporary state - the drive should soon be in another state - ideally Healthy.
Predictive failure 驱动器已报告它即将发生故障。

Action: Replace the drive.
IO error 访问驱动器时发生暂时性错误。

Action:
1. If the drive doesn't transition back to the OK state, you can try using the Reset-PhysicalDisk cmdlet to wipe the drive.
2. Use Repair-VirtualDisk to restore the resiliency of affected virtual disks.
3. 如果这种情况持续发生,请更换驱动器。
Transient error 驱动器出现暂时性错误。 此错误通常表示驱动器无响应,但也可能表示不恰当地从驱动器中删除了存储空间的保护分区。

Action:
1. If the drive doesn't transition back to the OK state, you can try using the Reset-PhysicalDisk cmdlet to wipe the drive.
2. Use Repair-VirtualDisk to restore the resiliency of affected virtual disks.
3. 如果这种情况持续发生,请更换驱动器,或者尝试按照“使用 Windows 错误报告进行故障排除 >物理磁盘无法联机”中的步骤获取有关该驱动器的详细诊断信息。
Abnormal latency 根据存储空间直通中运行状况服务的度量,驱动器运行速度缓慢。

Action: If this keeps happening, replace the drive so it doesn't reduce the performance of Storage Spaces as a whole.

驱动器运行状况:不正常

当前无法写入或访问处于“不正常”状态的驱动器。

Operational state Description
Not usable 存储空间不能使用此驱动器。 有关详细信息,请参阅存储空间直通 硬件要求;如果未使用存储空间直通,请参阅存储空间概述
Split 已从池中分离驱动器。

Action: Reset the drive, erasing all data from the drive and adding it back to the pool as an empty drive. To do so, open a PowerShell session as an administrator, run the Reset-PhysicalDisk cmdlet, and then run Repair-VirtualDisk.

若要获取有关此驱动器的详细诊断信息,请按照“使用 Windows 错误报告进行故障排除 >物理磁盘无法联机”中的步骤操作。
Stale metadata 存储空间在驱动器上找到旧元数据。

Action: This should be a temporary state. If the drive doesn't transition back to OK, you can run Repair-VirtualDisk to start a repair operation on affected virtual disks. If that doesn't resolve the issue, you can reset the drive with the Reset-PhysicalDisk cmdlet, wiping all data from the drive, and then run Repair-VirtualDisk.
Unrecognized metadata 存储空间在驱动器上找到了无法识别的元数据,这通常表示驱动器包含来自其他池的元数据。

Action: To wipe the drive and add it to the current pool, reset the drive. To reset the drive, open a PowerShell session as an administrator, run the Reset-PhysicalDisk cmdlet, and then run Repair-VirtualDisk.
Failed media 驱动器出现故障,不再可供存储空间使用。

Action: Replace the drive.

若要获取有关此驱动器的详细诊断信息,请按照“使用 Windows 错误报告进行故障排除 >物理磁盘无法联机”中的步骤操作。
设备硬件故障 此驱动器上出现硬件故障。

Action: Replace the drive.
Updating firmware Windows 正在更新驱动器上的固件。 这是一种暂时性的状态,其持续时间通常小于一分钟,在此期间,池中的其他驱动器会处理所有读取和写入操作。 有关详细信息,请参阅更新驱动器固件
Starting 驱动器正在为操作做好准备。 这应该是一种暂时性的状态 - 完成后,驱动器应会过渡到另一种工作状态。

驱动器无法入池的原因

某些驱动器尚未准备好放入存储池。 通过查看物理磁盘的 CannotPoolReason 属性,可以确定驱动器为何不符合入池条件。 下面是用于显示 CannotPoolReason 属性的示例 PowerShell 脚本:

Get-PhysicalDisk | Format-Table FriendlyName,MediaType,Size,CanPool,CannotPoolReason

下面是示例输出:

FriendlyName          MediaType          Size CanPool CannotPoolReason
------------          ---------          ---- ------- ----------------
ATA MZ7LM120HCFD00D3  SSD        120034123776   False Insufficient Capacity
Msft Virtual Disk     SSD         10737418240    True
Generic Physical Disk SSD        119990648832   False In a Pool

下表更具体地描述了每种原因。

Reason Description
在池中 驱动器已属于某个存储池。

驱动器只能属于一个存储池。 若要在另一个存储池中使用此驱动器,请先将此驱动器从其当前所在的池中删除,这会告知存储空间将此驱动器上的数据移动到池中的另一驱动器。 或者,如果在未通知存储空间的情况下将驱动器与其所在的池断开连接,请重置该驱动器。

To safely remove a drive from a storage pool, use Remove-PhysicalDisk, or go to Server Manager >File and Storage Services>Storage Pools, >Physical Disks, right-click the drive and then select Remove Disk.

To reset a drive, use Reset-PhysicalDisk.
Not healthy 该驱动器不处于正常状态,可能需要更换。
Removable media 该驱动器分类为可移动驱动器。

存储空间不支持由 Windows 识别为可移动媒体的媒体,例如蓝光驱动器。 Although many fixed drives are in removable slots, in general, media that are classified by Windows as removable aren't suitable for use with Storage Spaces.
已由群集使用 该驱动器当前已由故障转移群集使用。
Offline 驱动器已脱机。

若要使所有脱机的驱动器联机并将其设置为读/写,请以管理员身份打开 PowerShell 会话,然后使用以下脚本:

Get-Disk | Where-Object -Property OperationalStatus -EQ "Offline" | Set-Disk -IsOffline $false

Get-Disk | Where-Object -Property IsReadOnly -EQ $true | Set-Disk -IsReadOnly $false
Insufficient capacity 当有分区占用了驱动器上的可用空间时,通常会发生这种情况。

Action: Delete any volumes on the drive, erasing all data on the drive. One way to do that is to use the Clear-Disk PowerShell cmdlet.
正在验证 The Health Service is checking to see if the drive or firmware on the drive is approved for use by the server administrator.
Verification failed The Health Service couldn't check to see if the drive or firmware on the drive is approved for use by the server administrator.
固件不合规 The firmware on the physical drive isn't in the list of approved firmware revisions specified by the server administrator by using the Health Service.
硬件不合规 The drive isn't in the list of approved storage models specified by the server administrator by using the Health Service.

Additional References