您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

教程:根据建议优化成本Tutorial: Optimize costs from recommendations

Azure 成本管理与 Azure 顾问相结合,可以提供成本优化建议。Azure Cost Management works with Azure Advisor to provide cost optimization recommendations. Azure 顾问通过识别闲置和未充分利用的资源来优化和提高效率。Azure Advisor helps you optimize and improve efficiency by identifying idle and underutilized resources. 本教程通过一个示例逐步讲解如何识别未充分利用的 Azure 资源,并采取措施来降低成本。This tutorial walks you through an example where you identify underutilized Azure resources and then you take action to reduce costs.

本教程介绍如何执行下列操作:In this tutorial, you learn how to:

  • 查看成本优化建议,以查看潜在的低效使用情况。View cost optimization recommendations to view potential usage inefficiencies
  • 实施建议,以将虚拟机的大小调整为更具成本效益的选项Act on a recommendation to resize a virtual machine to a more cost-effective option
  • 验证操作,确保成功调整虚拟机的大小Verify the action to ensure that the virtual machine was successfully resized

必备组件Prerequisites

建议是可用于多个作用域和 Azure 帐户类型,包括企业协议 (EA)客户。Recommendations are available for a variety of scopes and Azure account types, including Enterprise Agreement (EA) customers. 若要查看支持的帐户类型的完整列表,请参阅了解成本管理数据To view the full list of supported account types, see Understand Cost Management data. 必须至少具有以下一个或多个范围的读取权限才能查看成本数据。You must have at least read access to one or more of the following scopes to view cost data. 有关范围的详细信息,请参阅了解并使用范围For more information about scopes, see Understand and work with scopes.

  • 订阅Subscription
  • 资源组Resource group

必须提供至少有 14 天保持活动状态的虚拟机。You must have active virtual machines with at least 14 days of activity.

登录 AzureSign in to Azure

https://portal.azure.com 中登录 Azure 门户。Sign in to the Azure portal at https://portal.azure.com.

查看成本优化建议View cost optimization recommendations

若要查看订阅的成本优化建议,可在 Azure 门户并选择中打开所需的范围顾问建议To view cost optimization recommendations for a subscription, open the desired scope in the Azure portal and select Advisor recommendations.

若要查看管理组的建议,可在 Azure 门户并选择中打开所需的范围成本分析菜单中。To view recommendations for a management group, open the desired scope in the Azure portal and select Cost analysis in the menu. 使用作用域药丸切换到不同的作用域,例如管理组。Use the Scope pill to switch to a different scope, such as a management group. 选择顾问建议菜单中。Select Advisor recommendations in the menu. 有关范围的详细信息,请参阅了解并使用范围For more information about scopes, see Understand and work with scopes.

在 Azure 门户中显示的成本管理顾问建议

建议列表会指明低效使用情况,或显示可帮助你节省更多资金的采购建议。The list of recommendations identifies usage inefficiencies or shows purchase recommendations that can help you save additional money. “潜在年度节省”合计值显示在关闭或解除分配所有符合建议规则的 VM 的情况下,可以节省的总金额。 The totaled Potential yearly savings shows the total amount that you can save if you shut down or deallocate all of your VMs that meet recommendation rules. 如果不想要关闭这些 VM,应考虑将其大小调整为费用更低的 VM SKU。If you don't want to shut them down, you should consider resizing them to a less expensive VM SKU.

“影响”类别和“潜在年度节省”旨在帮助识别哪些建议有可能会实现最大的节省。 The Impact category, along with the Potential yearly savings, are designed to help identify recommendations that have the potential to save as much as possible.

高影响建议包括:High impact recommendations include:

中等影响建议包括:Medium impact recommendations include:

实施建议Act on a recommendation

Azure 顾问会监视虚拟机 14 天的使用情况,并识别利用不足的虚拟机。Azure Advisor monitors your virtual machine usage for 14 days and then identifies underutilized virtual machines. 如果在 4 天或 4 天以上,虚拟机的 CPU 利用率都小于或等于 5% 且网络使用率小于或等于 7 MB,则会被视为利用率较低的虚拟机。Virtual machines whose CPU utilization is five percent or less and network usage is seven MB or less for four or more days are considered low-utilization virtual machines.

5% 或更低的 CPU 利用率设置是默认值,可以调整设置。The 5% or less CPU utilization setting is the default, but you can adjust the settings. 有关调整设置的详细信息,请参阅配置平均 CPU 利用率规则或低使用率虚拟机建议For more information about adjusting the setting, see the Configure the average CPU utilization rule or the low usage virtual machine recommendation.

虽然某些方案有意使虚拟机利用率较低,但将虚拟机大小更改为费用更低的大小通常可以降低成本。Although some scenarios can result in low utilization by design, you can often save money by changing the size of your virtual machines to less expensive sizes. 如果选择调整大小操作,实际节省的金额可能有所不同。Your actual savings might vary if you choose a resize action. 让我们演练一个调整虚拟机大小的示例。Let's walk through an example of resizing a virtual machine.

在建议列表中,单击“适当调整大小或关闭未充分利用的虚拟机”建议。 In the list of recommendations, click the Right-size or shutdown underutilized virtual machines recommendation. 在虚拟机候选项列表中,选择要调整大小的虚拟机并单击它。In the list of virtual machine candidates, choose a virtual machine to resize and then click the virtual machine. 随后会显示该虚拟机的详细信息,可在其中检查利用率指标。The virtual machine's details are shown so that you can verify the utilization metrics. “潜在年度节省”值是在关闭或删除该 VM 的情况下可以节省的金额。 The potential yearly savings value is what you can save if you shut down or remove the VM. 调整 VM 大小也许能够节省一定的资金,但不能节省“潜在年度节省”中所列的全额。Resizing a VM will probably save you money, but you won't save the full amount of the potential yearly savings.

建议详细信息示例

在 VM 详细信息中,检查虚拟机的利用率,以确认它是否适合调整大小。In the VM details, check the utilization of the virtual machine to confirm that it's a suitable resize candidate.

示例 VM 详细信息显示了历史利用率

注意当前虚拟机的大小。Note the current virtual machine's size. 确认应该调整该虚拟机的大小后,关闭 VM 详细信息以查看虚拟机列表。After you've verified that the virtual machine should be resized, close the VM details so that you see the list of virtual machines.

在要关闭或调整大小的候选项列表中,选择“调整虚拟机大小”。 In the list of candidates to shut down or resize, select Resize the virtual machine. 具有调整虚拟机大小选项的示例建议Example recommendation with the option to resize the virtual machine

接下来,会看到可用调整大小选项的列表。Next, you're presented with a list of available resize options. 选择能够为方案实现最佳性能和成本效益的选项。Choose the one that will give the best performance and cost-effectiveness for your scenario. 在以下示例中,所选的选项将 VM 大小从 DS14_V2 调整为 DS13_V2In the following example, the option chosen resizes from a DS14_V2 to a DS13_V2. 遵照建议可以节省 551.30 美元/月,或 6,615.60 美元/年。Following the recommendation saves $551.30/month or $6,615.60/year.

可以在其中选择一个大小的可用 VM 大小示例列表

选择合适的大小后,单击“选择”开始执行调整大小的操作。 After you choose a suitable size, click Select to start the resize action.

调整大小需要重启正在运行的虚拟机。Resizing requires an actively running virtual machine to restart. 如果该虚拟机在生产环境中,则我们建议在非营业时间运行调整大小操作。If the virtual machine is in a production environment, we recommend that you run the resize operation after business hours. 计划重启可以减少暂时性的中断造成的干扰。Scheduling the restart can reduce disruptions caused by momentarily unavailability.

验证操作Verify the action

成功完成 VM 大小调整后,会显示 Azure 通知。When the VM resizing completes successfully, an Azure notification is shown.

已成功调整大小的虚拟机通知

后续步骤Next steps

在本教程中,你将了解:In this tutorial, you learned how to:

  • 查看成本优化建议,以查看潜在的低效使用情况。View cost optimization recommendations to view potential usage inefficiencies
  • 实施建议,以将虚拟机的大小调整为更具成本效益的选项Act on a recommendation to resize a virtual machine to a more cost-effective option
  • 验证操作,确保成功调整虚拟机的大小Verify the action to ensure that the virtual machine was successfully resized

请阅读“成本管理最佳做法”一文,其中提供了有助于管理成本的概要指导和原则。If you haven't already read the Cost Management best practices article, it provides high-level guidance and principles to consider to help manage costs.