在 Windows Server 2016 中更新磁碟機韌體Updating drive firmware in Windows Server 2016

適用於:Windows 10、Windows Server (半年度管道)、Windows Server 2016Applies to: Windows 10, Windows Server (Semi-Annual Channel), Windows Server 2016

更新磁碟機韌體向來都是可能導致停機的麻煩工作,這就是我們要改善儲存空間、Windows Server 及 Windows 10 版本 1703 和更新版本的原因。Updating the firmware for drives has historically been a cumbersome task with a potential for downtime, which is why we're making improvements to Storage Spaces, Windows Server, and Windows 10, version 1703 and newer. 如果您的磁碟機支援 Windows 中所含的新韌體更新機制,則可以更新生產磁碟機的磁碟機韌體,而不造成停機。If you have drives that support the new firmware update mechanism included in Windows, you can update drive firmware of in-production drives without downtime. 不過,如果您要更新生產磁碟機的韌體,請務必閱讀在使用這個功能強大的新功能時如何將風險降到最低的提示。However, if you're going to update the firmware of a production drive, make sure to read our tips on how to minimize the risk while using this powerful new functionality.

警告

韌體更新是可能會有風險的維護作業,而且您只應該在徹底測試新的韌體映像之後再套用它們。Firmware updates are a potentially risky maintenance operation and you should only apply them after thorough testing of the new firmware image. 不受支援硬體上的新韌體可能會對可靠性和穩定性造成負面影響,甚至導致資料遺失。It is possible that new firmware on unsupported hardware could negatively affect reliability and stability, or even cause data loss. 系統管理員應該閱讀所指定更新隨附的版本資訊,來判斷其影響和適用性。Administrators should read the release notes a given update comes with to determine its impact and applicability.

磁碟機相容性Drive compatibility

若要使用 Windows Server 來更新磁碟機韌體,您必須具有支援的磁碟機。To use Windows Server to update drive firmware, you must have supported drives. 為了確保通用裝置行為,一開始會定義適用於 SAS、SATA 和 NVMe 裝置的新和 (適用於 Windows 10 和 Windows Server 2016) 選擇性 Hardware Lab Kit (HLK) 需求。To ensure common device behavior, we began by defining new and - for Windows 10 and Windows Server 2016 - optional Hardware Lab Kit (HLK) requirements for SAS, SATA, and NVMe devices. 這些需求概述 SATA、SAS 或 NVMe 裝置必須支援的命令,以用來透過這些新的 Windows 原生 PowerShell Cmdlet 進行韌體更新。These requirements outline which commands a SATA, SAS, or NVMe device must support to be firmware-updatable using these new, Windows-native PowerShell cmdlets. 若要支援這些需求,會進行新的 HLK 測試,確認廠商產品支援正確的命令,並在未來的修訂中進行實作。To support these requirements, there is a new HLK test to verify if vendor products support the right commands and get them implemented in future revisions.

如需硬體是否支援 Windows 更新磁碟機韌體的相關資訊,請連絡解決方案廠商。Contact your solution vendor for info about whether your hardware supports Windows updating the drive firmware. 以下是各種需求的連結︰Here are links to the various requirements:

PowerShell CmdletPowerShell cmdlets

兩個新增至 Windows 的 Cmdlet 為:The two cmdlets added to Windows are:

  • Get-StorageFirmwareInformationGet-StorageFirmwareInformation
  • Update-StorageFirmwareUpdate-StorageFirmware

第一個 Cmdlet 提供裝置功能、韌體映像和修訂的詳細資訊。The first cmdlet provides you with detailed information about the device's capabilities, firmware images, and revisions. 在此情況下,機器只會包含有 1 個韌體插槽的單一 SATA SSD。In this case, the machine only contains a single SATA SSD with 1 firmware slot. 這裡提供一個範例:Here's an example:

Get-PhysicalDisk | Get-StorageFirmwareInformation

SupportsUpdate        : True
NumberOfSlots         : 1
ActiveSlotNumber      : 0
SlotNumber            : {0}
IsSlotWritable        : {True}
FirmwareVersionInSlot : {J3E16101}

請注意,因為沒有方法可以明確查詢支援這些命令的裝置,所以 SAS 裝置一律會將 "SupportsUpdate" 報告為 "True"。Note that SAS devices always report "SupportsUpdate" as "True", since there is no way of explicitly querying the device for support of these commands.

如果磁碟機支援新的韌體更新機制,則第二個 Cmdlet (Update-StorageFirmware) 可讓系統管理員使用映像檔來更新磁碟機韌體。The second cmdlet, Update-StorageFirmware, enables administrators to update the drive firmware with an image file, if the drive supports the new firmware update mechanism. 您應該直接從 OEM 或磁碟機廠商取得此映像檔。You should obtain this image file from the OEM or drive vendor directly.

注意

更新任何生產硬體之前,請測試實驗室設定中相同硬體上的特定韌體映像。Before updating any production hardware, test the particular firmware image on identical hardware in a lab setting.

磁碟機會先將新的韌體映像載入至內部臨時區域。The drive will first load the new firmware image to an internal staging area. 發生這種情況時,通常會繼續 I/O。While this happens, I/O typically continues. 映像會在下載之後啟用。The image activates after downloading. 因為發生內部重設,所以磁碟機在這段時間將無法回應 I/O 命令。During this time the drive will not be able to respond to I/O commands as an internal reset occurs. 這表示此磁碟機在啟用期間未提供任何資料。This means that this drive serves no data during the activation. 除非韌體啟用完成,否則存取此磁碟機上資料的應用程式必須等待回應。An application accessing data on this drive would have to wait for a response until the firmware activation completes. 以下是作用中的 Cmdlet 範例︰Here's an example of the cmdlet in action:

$pd | Update-StorageFirmware -ImagePath C:\Firmware\J3E160@3.enc -SlotNumber 0
$pd | Get-StorageFirmwareInformation

SupportsUpdate        : True
NumberOfSlots         : 1
ActiveSlotNumber      : 0
SlotNumber            : {0}
IsSlotWritable        : {True}
FirmwareVersionInSlot : {J3E160@3}

磁碟機在啟用新的韌體映像時通常不會完成 I/O 要求。Drives typically do not complete I/O requests when they activate a new firmware image. 磁碟機進行啟用所需的時間長度取決於設計和所更新的韌體類型。How long a drive takes to activate depends on its design and the type of firmware you update. 我們觀察到更新時間範圍從小於 5 秒到超過 30 秒。We have observed update times range from fewer than 5 seconds to more than 30 seconds.

這個磁碟機已在 ~5.8 秒內執行韌體更新,如下所示︰This drive performed the firmware update within ~5.8 seconds, as shown here:

Measure-Command {$pd | Update-StorageFirmware -ImagePath C:\\Firmware\\J3E16101.enc -SlotNumber 0}

 Days : 0
 Hours : 0
 Minutes : 0
 Seconds : 5
 Milliseconds : 791
 Ticks : 57913910
 TotalDays : 6.70299884259259E-05
 TotalHours : 0.00160871972222222
 TotalMinutes : 0.0965231833333333
 TotalSeconds : 5.791391
 TotalMilliseconds : 5791.391

更新生產環境中的磁碟機Updating drives in production

將伺服器置入生產環境之前,強烈建議將磁碟機的韌體更新成硬體廠商或所銷售並支援您解決方案 (存放裝置機箱、磁碟機和伺服器) 之 OEM 所建議的韌體。Before placing a server into production, we highly recommend updating the firmware of your drives to the firmware recommended by the hardware vendor or OEM that sold and supports your solution (storage enclosures, drives, and servers).

伺服器位於生產環境時,最好實際上對伺服器進行最少變更。Once a server is in production, it's a good idea to make as few changes to the server as is practical. 不過,有時解決方案廠商會建議您磁碟機有非常重要的韌體更新。However, there may be times when your solution vendor advises you that there is a critically important firmware update for your drives. 如果發生這種情況,以下是一些可在套用任何磁碟機韌體更新之前遵循的最佳作法︰If this occurs, here are a few good practices to follow before applying any drive firmware updates:

  1. 檢閱韌體版本資訊,並確認更新可解決可能會影響您環境的問題,而且韌體不會包含任何可能會對您造成負面影響的已知問題。Review the firmware release notes and confirm that the update addresses issues that could affect your environment, and that the firmware doesn't contain any known issues that could adversely affect you.

  2. 在實驗室中於具有相同磁碟機的伺服器上安裝韌體 (如果有相同磁碟機的多個修訂,則包含磁碟機修訂),並使用新的韌體測試正在進行載入的磁碟機。Install the firmware on a server in your lab that has identical drives (including the revision of the drive if there are multiple revisions of the same drive), and test the drive under load with the new firmware. 如需執行綜合負載測試的相關資訊,請參閱在 Windows Server 中使用綜合工作負載測試儲存空間效能For info about doing synthetic load testing, see Test Storage Spaces Performance Using Synthetic Workloads.

使用儲存空間直接存取的自動化韌體更新Automated firmware updates with Storage Spaces Direct

Windows Server 2016 包含儲存空間直接存取部署的健全狀況服務 (含 Microsoft Azure Stack 解決方案)。Windows Server 2016 includes a Health Service for Storage Spaces Direct deployments (including Microsoft Azure Stack solutions). 健全狀況服務的主要目的是為了方便監視和管理硬體部署。The main purpose of the Health Service is to make monitoring and management of your hardware deployment easier. 在管理功能期間,它可以推出跨整個叢集的磁碟機韌體,而不會讓任何工作負載離線或發生停機。As part of its management functions, it has the capability to roll-out drive firmware across an entire cluster without taking any workloads offline or incurring downtime. 這項功能是透過原則所驅動,並由系統管理員手動控制。This capability is policy-driven, with the control in the admin's hands.

使用健全狀況服務推出整個叢集的韌體非常簡單,並且包含下列步驟︰Using the Health Service to roll-out firmware across a cluster is very simple and involves the following steps:

  • 識別您預期成為儲存空間直接叢集一部分的 HDD 和 SSD 磁碟機,以及磁碟機是否支援執行韌體更新的 WindowsIdentify what HDD and SSD drives you expect to be part of your Storage Spaces Direct cluster, and whether the drives support Windows performing firmware updates
  • 在所支援的元件 xml 檔案中列出這些磁碟機List those drives in the Supported Components xml file
  • 在所支援的元件 xml 中,識別您預期這些磁碟機要具有的韌體版本 (包含韌體映像的位置路徑)Identify the firmware versions you expect those drives to have in the Supported Components xml (including location paths of the firmware images)
  • 將 xml 檔案上傳至叢集資料庫Upload the xml file to the cluster DB

此時,健全狀況服務將會檢查和剖析 xml,以及識別任何未部署所需韌體版本的磁碟機。At this point, the Health Service will inspect and parse the xml and identify any drives that do not have the desired firmware version deployed. 它接著會繼續逐節點重新導向遠離受影響磁碟機的 I/O,並更新其上的韌體。It will then proceed to re-direct I/O away from the affected drives – going node-by-node – and updating the firmware on them. 儲存空間直接存取叢集達成復原的方式是將資料分散到多個伺服器節點;健全狀況服務就可能找出需要更新磁碟機的整個節點。A Storage Spaces Direct cluster achieves resiliency by spreading data across multiple server nodes; it is possible for the health service to isolate an entire node worth of drives for updates. 節點更新之後,會先透過讓叢集中的所有資料複本重新彼此同步來起始儲存空間中的修復,再繼續進行下一個節點。Once a node updates, it will initiate a repair in Storage Spaces, bringing all copies of data across the cluster back in sync with each other, before moving on to the next node. 這對要在推出韌體時轉換為「降級」作業模式的儲存空間而言是預期且正常的作業。It is expected and normal for Storage Spaces to transition to a "degraded" mode of operation while firmware is rolled out.

為了確保新韌體映像可穩定推行並具有足夠驗證時間,則更新數部伺服器會有明顯的延遲。To ensure a stable roll-out and sufficient validation time of a new firmware image, there exists a significant delay between the updates of several servers. 根據預設,健全狀況服務將會等候 7 天,再更新第 2伺服器。Per default, the Health Service will wait 7 days before updating the 2nd server. 任何後續伺服器 (第 3、第 4、…) 的更新都會有 1 天的延遲。Any subsequent server (3rd, 4th, …) updates with a 1 day delay. 如果系統管理員發現韌體不穩定或不是所需要的,則隨時可以透過健全狀況服務停止進一步推出。Should an administrator find the firmware to be unstable or otherwise undesirable, she can stop further roll-out by the health service at any time. 如果先前已驗證過韌體,並且想要更快速地推出,可以修改這些預設值的天、小時或分鐘。If the firmware has been previously validated and a quicker roll-out is desired, these default values can be modified from days, to hours or minutes.

以下是一般儲存空間直接存取叢集的所支援元件 xml 範例︰Here is an example of the supported components xml for a generic Storage Spaces Direct cluster:

 <Components>
     <Disks>
        <Disk>
            <Manufacturer>Contoso</Manufacturer>
            <Model>XYZ9000</Model>
            <AllowedFirmware>
              <Version>2.0</Version>
              <Version>2.1>/Version>
              <Version>2.2</Version>
            </AllowedFirmware>
            <TargetFirmware>
              <Version>2.2</Version>
              <BinaryPath>\\path\to\image.bin</BinaryPath>
            </TargetFirmware>
        </Disk>
        ...
        ...
    </Disks>
 </Components>

若要推出在這個儲存空間直接存取叢集中啟動的新韌體,只需要將 .xml 上傳至叢集資料庫:To get the roll-out of the new firmware started in this Storage Spaces Direct cluster, simply upload the .xml to the cluster DB:

$SpacesDirect = Get-StorageSubSystem Clus*

$CurrentDoc = $SpacesDirect | Get-StorageHealtHealth Service etting -Name "System.Storage.SupportedComponents.Document"

$CurrentDoc.Value | Out-File <Path>

在慣用的編輯器 (例如 Visual Studio Code 或記事本) 中編輯並儲存檔案。Edit the file in your favorite editor, such as Visual Studio Code or Notepad, then save it.

$NewDoc = Get-Content <Path> | Out-String

$SpacesDirect | Set-StorageHealthSetting -Name "System.Storage.SupportedComponents.Document" -Value $NewDoc

如果您想要查看作用中的健全狀況服務,並深入了解其推出機制,請看這部影片︰https://channel9.msdn.com/Blogs/windowsserver/Update-Drive-Firmware-Without-Downtime-in-Storage-Spaces-DirectIf you would like to see the Health Service in action and learn more about its roll-out mechanism, have a look at this video: https://channel9.msdn.com/Blogs/windowsserver/Update-Drive-Firmware-Without-Downtime-in-Storage-Spaces-Direct

常見問題集Frequently asked questions

請參閱對磁碟機韌體更新進行疑難排解Also see Troubleshooting drive firmware updates.

這種作法是否適用於任何存放裝置Will this work on any storage device

這適用於在其韌體中實作正確命令的存放裝置。This will work on storage devices that implement the correct commands in their firmware. Get-StorageFirmwareInformation Cmdlet 將會顯示磁碟機韌體是否確實支援正確命令 (適用於 SATA/NVMe),而且 HLK 測試可讓廠商和 OEM 測試這種行為。The Get-StorageFirmwareInformation cmdlet will show if a drive's firmware indeed does support the correct commands (for SATA/NVMe) and the HLK test allows vendors and OEMs to test this behavior.

在我更新 SATA 磁碟機之後,報告不再支援更新機制。After I update a SATA drive, it reports to no longer support the update mechanism. 磁碟機是否發生錯誤Is something wrong with the drive

否,除非新的韌體不再允許更新,否則磁碟機沒有問題。No, the drive is fine, unless the new firmware doesn't allow updates anymore. 您遇到已知問題,因此磁碟機快取版本功能不正確。You are hitting a known issue whereby a cached version of the drive's capabilities is incorrect. 執行 "Update-StorageProviderCache -DiscoveryLevel Full" 將會重新列舉磁碟機功能並更新快取的複本。Running "Update-StorageProviderCache -DiscoveryLevel Full" will re-enumerate the drive capabilities and update the cached copy. 因應措施是建議執行上述命令一次,再於空間直接存取叢集上起始韌體更新或完成推出。As a work-around, we recommend running the above command once before initiating a firmware update or complete roll-out on a Spaces Direct cluster.

是否可以透過這項機制更新 SAN 上的韌體Can I update firmware on my SAN through this mechanism

否 - SAN 通常會有這類維護作業的專屬公用程式和介面。No - SANs usually have their own utilities and interfaces for such maintenance operations. 這個新的機制適用於直接連接的存放裝置,例如 SATA、SAS 或 NVMe 裝置。This new mechanism is for directly attached storage, such as SATA, SAS, or NVMe devices.

是否從這裡取得韌體映像From where do I get the firmware image

您一律應該直接從 OEM、解決方案廠商或磁碟機廠商取得任何韌體,而不是從另一方進行下載。You should always obtain any firmware directly from your OEM, solution vendor, or drive vendor and not download it from other parties. Windows 提供取得磁碟機映像的機制,但無法確認其完整性。Windows provides the mechanism to get the image to the drive, but cannot verify its integrity.

這是否作用於叢集磁碟機Will this work on clustered drives

這些 Cmdlet 也可以對叢集磁碟機執行其功能,但請記住健全狀況服務協調流程可降低執行中工作負載的 I/O 影響。The cmdlets can perform their function on clustered drives as well, but keep in mind that the Health Service orchestration mitigates the I/O impact on running workloads. 如果直接在叢集磁碟機上使用 Cmdlet,則 I/O 可能會停止。If the cmdlets are used directly on clustered drives, I/O is likely to stall. 一般而言,最好在沒有時或基礎磁碟機上只有最小工作負載時才執行磁碟機韌體更新。In general, it is a best practice to perform drive firmware updates when there is no, or just a minimal workload on the underlying drives.

在儲存空間上更新韌體時,會發生什麼事What happens when I update firmware on Storage Spaces

在儲存空間直接存取上部署健全狀況服務的 Windows Server 2016 上,您可以執行這項作業,而不需要讓工作負載離線,並假設磁碟機支援 Windows Server 更新韌體。On Windows Server 2016 with the Health Service deployed on Storage Spaces Direct, you can perform this operation without taking your workloads offline, assuming the drives support Windows Server updating the firmware.

如果更新失敗,會發生什麼事What happens if the update fails

更新可能會因各種原因而失敗,其中一部分是︰1) 磁碟機不支援讓 Windows 更新其韌體的正確命令。The update could fail for various reasons, some of them are: 1) The drive doesn't support the correct commands for Windows to update its firmware. 在此情況下,新的韌體映像永遠不會啟用,而且磁碟機會繼續使用舊的映像運作。In this case the new firmware image never activates and the drive continues functioning with the old image. 2) 映像無法下載至或套用至這個磁碟機 (版本不符、影像損毀…)。2) The image cannot download to or be applied to this drive (version mismatch, corrupt image, …). 在此情況下,磁碟機會讓 activate 命令失敗。In this case the drive fails the activate command. 同樣地,舊的韌體映像將會繼續使用函數。Again, the old firmware image will continue function.

如果磁碟機在韌體更新之後根本未回應,則您可能會在磁碟機韌體本身發現錯誤。If the drive does not respond at all after a firmware update, you are likely hitting a bug in the drive firmware itself. 先測試實驗室環境中的所有韌體更新,再將它們放到生產環境中。Test all firmware updates in a lab environment before putting them in production. 唯一的補救方式可能是更換磁碟機。The only remediation may be to replace the drive.

如需詳細資訊,請參閱對磁碟機韌體更新進行疑難排解For more info, see Troubleshooting drive firmware updates.

如何停止進行中韌體推出How do I stop an in-progress firmware roll-out

透過下列方式,在 PowerShell 中停用推出︰Disable the roll-out in PowerShell via:

Get-StorageSubSystem Cluster* | Set-StorageHealthSetting -Name "System.Storage.PhysicalDisk.AutoFirmwareUpdate.RollOut.Enabled" -Value false

我在推出期間看到拒絕存取或找不到路徑錯誤。如何修正這個問題I am seeing an access denied or path-not-found error during roll out. How do I fix this

確定所有叢集節點都可以存取您想要用於更新的韌體映像。Ensure that the firmware image you would like to use for the update is accessible by all cluster nodes. 確保這種情況的最簡單方法是將它放在叢集共用磁碟區上。The easiest way to ensure this is to place it on a cluster shared volume.