How to install specific hotfix on Windows Server
Windows 容器环境有个特点, Host 与 Container 的 OS Builder Number 必须匹配, 有点场景甚至要求 Revision Number 匹配, 所以经常要为 K8s Node 安装指定 Revision 的 hotfix, 用 powershell 在线安装时下载过程缓慢而不可控, 体验最好的路径还是直接找到相应 Revision Number 的 msu 安装包,直接安装:
1. 从 Windows Update History 网站找到版本对应的 KB. 如: Windows Server 1809 OS Build 10.0.17763.1158 https://support.microsoft.com/en-us/help/4549949
2. 在 Windows Update Catelog 按 KB 搜索: https://www.catalog.update.microsoft.com/ 找到相应的下载包. 如 17763.1158 对应的 KB4549949: https://www.catalog.update.microsoft.com/Search.aspx?q=KB4549949
3. 下载 msu 安装包后使用 wusa 指令安装即可:
wusa windows10.0-kb4549949-x64_90e8805e69944530b8d4d4877c7609b9a9e68d81.msu
附:
为了防止 Windows Node 版本变更, 还要关闭 Windows Auto Update, 防止 Node OS 自己变更版本:
a). 查看 Auto Update 状态:
%systemroot%\system32\Cscript %systemroot%\system32\scregedit.wsf /AU /v
b). 禁用 Windows Auto Update:
Net stop wuauserv
%systemroot%\system32\Cscript %systemroot%\system32\scregedit.wsf /AU 1
Net start wuauserv
PS: 可使用 wmic qfe list 查看已安装的 hostfix
Reference: https://docs.microsoft.com/en-us/windows-server/administration/server-core/server-core-servicing
