将动态组与更新管理配合使用Use dynamic groups with Update Management

使用更新管理可定位 Azure VM 或非 Azure VM 的动态组以进行更新部署。Update Management allows you to target a dynamic group of Azure or non-Azure VMs for update deployments. 使用动态组可以在不编辑部署的情况下更新计算机。Using a dynamic group keeps you from having to edit your deployment to update machines.

备注

动态组不适用于经典 VM。Dynamic groups do not work with classic VMs.

你可以通过 Azure 门户中的更新管理为 Azure 或非 Azure 计算机定义动态组。You can define dynamic groups for Azure or non-Azure machines from Update management in the Azure portal. 请参阅管理 VM 的更新See Manage updates for VMs.

动态组由 Azure 自动化在部署时计算的查询定义。A dynamic group is defined by a query that Azure Automation evaluates at deployment time. 即使动态组查询检索到大量计算机,Azure 自动化一次最多只能处理 1000 台计算机。Even if a dynamic group query retrieves a large number of machines, Azure Automation can process only a maximum of 1000 machines at a time. 请参阅 Azure 订阅和服务限制、配额和约束See Azure subscription and service limits, quotas, and constraints.

备注

如果希望更新 1000 台以上计算机,我们建议将更新拆分为多个更新计划。If you expect to update more than 1000 machines, we recommend that you split up the updates among multiple update schedules.

为 Azure 计算机定义动态组Define dynamic groups for Azure machines

为 Azure 计算机定义动态组查询时,可以使用以下项填充动态组:When defining a dynamic group query for Azure machines, you can use the following items to populate the dynamic group:

  • 订阅Subscription
  • 资源组Resource groups
  • 位置Locations
  • TagsTags

选择组

若要预览动态组查询的结果,请单击“预览”。To preview the results of your dynamic group query, click Preview. 预览将显示当前的组成员身份。The preview shows the group membership at the current time. 在本例中,我们将为组 BackendServer 搜索具有标记 Role 的计算机。In the example, we're searching for machines having the tag Role for the group BackendServer. 如果多台计算机已添加此标记,系统会针对该组将它们添加到任何未来部署中。If more machines have this tag added, they are added to any future deployments against that group.

预览组

为非 Azure 计算机定义动态组Define dynamic groups for non-Azure machines

非 Azure 计算机的动态组使用保存的搜索,也称为计算机组。A dynamic group for non-Azure machines uses saved searches, also called computer groups. 若要了解如何创建保存的搜索,请参阅创建计算机组To learn how to create a saved search, see Creating a computer group. 创建保存的搜索后,可以从 Azure 门户“更新管理”中的保存的搜索列表中选择它。Once your saved search is created, you can select it from the list of saved searches in Update management in the Azure portal. 单击“预览”,可预览保存的搜索中的计算机。Click Preview to preview the computers in the saved search.

屏幕截图显示了非 Azure(预览版)的“选择组”页和右侧的“预览”窗格。

后续步骤Next steps

查询 Azure Monitor 日志来分析更新评估、部署和其他相关管理任务。You can query Azure Monitor logs to analyze update assessments, deployments, and other related management tasks. 它包含预定义的查询,可帮助你入门。It includes pre-defined queries to help you get started.