修补和更新虚拟机规模集

Patching and Updating Virtual Machine ScaleSets

据我了解,虚拟机规模集是虚拟机的集合。每一个都可以根据配置的突发奇想被摧毁和重组。 VM 是从某个映像重新创建的。这个理解对吗?

如果这是正确的,如何修补规模集?

考虑使用 Windows 2016 创建的规模集。自创建基本映像以来,通过更新服务提供了 50 个补丁。在负载较重期间,规模集创建了 3 个新 VM。新虚拟机在上线之前应该加载 50 个补丁。这可能需要几个小时。这些补丁可能根本不起作用。

处理此问题的最佳做法是什么?

我想建议从自定义映像创建 VMSS。您可以先部署 windows 2016 并安装 50 个补丁,然后将其作为自定义 VM 映像。此自定义 VM 映像包括任何必需的应用程序安装或配置。在规模集中创建的任何 VM 实例都使用自定义 VM 映像,并准备好为您的应用程序流量提供服务。在本教程中,您将学习如何:

  • Create and customize a VM
  • Deprovision and generalize the VM
  • Create a custom VM image
  • Deploy a scale set that uses the custom VM image

你可以用多种方法来制作。

Tutorial: Create and use a custom image for virtual machine scale sets with Azure PowerShell

Tutorial: Create and use a custom image for virtual machine scale sets with the Azure CLI

Add a custom image to an Azure scale set template

市场中的 Windows 服务器映像不断更新(大约每月一次),包含所有最新补丁。安装最新版本是保持实例 up-to-date.

的良好起点

为了在发布新映像时在现有实例上保留 up-to-date,您可以启用 automatic OS image upgrades,这将在映像的新版本可用时以滚动方式安全地更新实例.