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

利用 Azure 保留 VM 实例节省成本Save costs with Azure Reserved VM Instances

当你提交到 Azure 保留 VM 实例时,你可以节省资金。When you commit to an Azure reserved VM instance you can save money. 预订折扣将自动应用于正在运行的与预订范围和属性匹配的虚拟机数量。The reservation discount is applied automatically to the number of running virtual machines that match the reservation scope and attributes. 无需为虚拟机分配预订即可获取折扣。You don't need to assign a reservation to a virtual machine to get the discounts. 购买的预订实例仅涵盖 VM 使用率的计算部分。A reserved instance purchase covers only the compute part of your VM usage. 对于 Windows Vm,使用情况计量分为两个不同的计量器。For Windows VMs, the usage meter is split into two separate meters. 有一个计算计量器,与 Linux 计量和 Windows IP 指标相同。There's a compute meter, which is same as the Linux meter, and a Windows IP meter. 进行购买时看到的费用仅适用于计算成本。The charges that you see when you make the purchase are only for the compute costs. 费用不包括 Windows 软件费用。Charges don't include Windows software costs. 有关软件成本的详细信息,请参阅Azure 保留 VM 实例中未包含的软件成本For more information about software costs, see Software costs not included with Azure Reserved VM Instances.

在购买前确定正确的 VM 大小Determine the right VM size before you buy

在购买预订之前,应确定所需的 VM 大小。Before you buy a reservation, you should determine the size of the VM that you need. 以下部分将帮助你确定正确的 VM 大小。The following sections will help you determine the right VM size.

使用预订建议Use reservation recommendations

你可以使用预订建议来帮助确定你应购买的预订。You can use reservation recommendations to help determine the reservations you should purchase.

  • 在 Azure 门户中购买 VM 预留实例时,将显示 "购买建议" 和 "推荐数量"。Purchase recommendations and recommended quantity are show when you purchase a VM reserved instance in the Azure portal.
  • Azure 顾问为各个订阅提供购买建议。Azure Advisor provides purchase recommendations for individual subscriptions.
  • 可以使用 Api 获取共享范围和单个订阅范围的购买建议。You can use the APIs to get purchase recommendations for both shared scope and single subscription scope. 有关详细信息,请参阅保留实例购买适用于企业客户的建议 apiFor more information, see Reserved instance purchase recommendation APIs for enterprise customers.
  • 对于企业协议(EA)和 Microsoft 客户协议(MCA)客户, Azure 使用见解 Power BI 内容包提供了针对共享订阅范围和单一订阅范围的购买建议。For Enterprise Agreement (EA) and Microsoft Customer Agreement (MCA) customers, purchase recommendations for shared and single subscription scopes are available with the Azure Consumption Insights Power BI content pack.

可获得 VM 保留折扣的服务Services that get VM reservation discounts

VM 预留可以应用于从多个服务发出的 VM 使用量 - 而不仅应用于 VM 部署。Your VM reservations can apply to VM usage emitted from multiple services - not just for your VM deployments. 可获得预留折扣的资源会根据实例大小灵活性设置而变化。Resources that get reservation discounts change depending on the instance size flexibility setting.

实例大小灵活性设置Instance size flexibility setting

实例大小灵活性设置确定哪些服务可获得预留实例折扣。The instance size flexibility setting determines which services get the reserved instance discounts.

无论该设置是打开还是关闭,预留折扣在 ConsumedServiceMicrosoft.Compute 时会自动应用到任何匹配的 VM 使用量。Whether the setting is on or off, reservation discounts automatically apply to any matching VM usage when the ConsumedService is Microsoft.Compute. 因此,请检查使用情况数据中的 ConsumedService 值。So, check your usage data for the ConsumedService value. 示例包括:Some examples include:

  • 虚拟机Virtual machines
  • 虚拟机规模集Virtual machine scale sets
  • 容器服务Container service
  • Azure Batch 部署(在用户订阅模式下)Azure Batch deployments (in user subscriptions mode)
  • Azure Kubernetes 服务 (AKS)Azure Kubernetes Service (AKS)
  • Service FabricService Fabric

打开此设置后,当 ConsumedService 为以下任一项时,预留折扣将自动应用于匹配的 VM 使用量:When the setting is on, reservation discounts automatically apply to matching VM usage when the ConsumedService is any of the following items:

  • Microsoft.ComputeMicrosoft.Compute
  • Microsoft.ClassicComputeMicrosoft.ClassicCompute
  • Microsoft.BatchMicrosoft.Batch
  • Microsoft.MachineLearningServicesMicrosoft.MachineLearningServices
  • Microsoft.KustoMicrosoft.Kusto

检查使用情况数据中的 ConsumedService 值,以确定该使用是否符合预留折扣的条件。Check the ConsumedService value in your usage data to determine if the usage is eligible for reservation discounts.

有关实例大小灵活性的详细信息,请参阅虚拟机预留实例的虚拟机大小灵活性For more information about instance size flexibility, see Virtual machine size flexibility with Reserved VM Instances.

分析使用情况信息Analyze your usage information

分析你的使用情况信息,以帮助确定你应购买哪些预订。Analyze your usage information to help determine which reservations you should purchase.

使用情况数据在使用文件和 Api 中可用。Usage data is available in the usage file and APIs. 将它们一起用于确定要购买的预订。Use them together to determine which reservation to purchase. 检查每日具有高使用率的 VM 实例,以确定要购买的预订数量。Check for VM instances that have high usage on daily basis to determine the quantity of reservations to purchase.

避免使用情况数据中的 Meter 子类别和 Product 字段。Avoid the Meter subcategory and Product fields in usage data. 它们不区分使用高级存储的 VM 大小。They don't distinguish between VM sizes that use premium storage. 如果你使用这些字段来确定用于预订购买的 VM 大小,则可能购买的大小不正确。If you use these fields to determine the VM size for reservation purchase, you may buy the wrong size. 然后,你将不会获得预期的预订折扣。Then you won't get the reservation discount you expect. 相反,请参阅使用情况文件或使用情况 API 中的 AdditionalInfo 字段,以确定正确的 VM 大小。Instead, refer to the AdditionalInfo field in your usage file or usage API to determine the correct VM size.

购买限制注意事项Purchase restriction considerations

保留的 VM 实例适用于大多数 VM 大小,但有一些例外情况。Reserved VM Instances are available for most VM sizes with some exceptions. 预订折扣不适用于以下 Vm:Reservation discounts don't apply for the following VMs:

  • VM 系列-A 系列、Av2 系列或 G 系列。VM series - A-series, Av2-series, or G-series.

  • 预览或促销 vm -任何采用预览版或使用促销计量的 vm 系列或大小。Preview or Promo VMs - Any VM-series or size that is in preview or uses promotional meter.

  • 预订不适用于德国或中国地区的购买。Clouds - Reservations aren't available for purchase in Germany or China regions.

  • 配额不足-作用于单个订阅的保留必须在新 RI 的订阅中具有 vCPU 配额。Insufficient quota - A reservation that is scoped to a single subscription must have vCPU quota available in the subscription for the new RI. 例如,如果目标订阅的配额限制为 10 个 vCPU(适用于 D 系列),则不能为 11 个 Standard_D1 实例购买预留。For example, if the target subscription has a quota limit of 10 vCPUs for D-Series, then you can't buy a reservation for 11 Standard_D1 instances. 虚拟机预留实例的配额检查包括已在订阅中部署的 VM。The quota check for reservations includes the VMs already deployed in the subscription. 例如,如果该订阅的配额为针对 D 系列购买 10 个 vCPU,并且已部署两个 Standard_D1 实例,则可在该订阅中为 10 个 Standard_D1 实例购买预留。For example, if the subscription has a quota of 10 vCPUs for D-Series and has two standard_D1 instances deployed, then you can buy a reservation for 10 standard_D1 instances in this subscription. 你可以创建报价增加请求以解决此问题。You can create quote increase request to resolve this issue.

  • 容量限制-在极少数情况下,Azure 会限制购买 VM 大小子集的新保留,因为区域中的容量不足。Capacity restrictions - In rare circumstances, Azure limits the purchase of new reservations for subset of VM sizes, because of low capacity in a region.

购买虚拟机预留实例Buy a Reserved VM Instance

可以在Azure 门户中购买保留 VM 实例。You can buy a reserved VM instance in the Azure portal. 通过提前付款或按月付款的方式为预留付款。Pay for the reservation up front or with monthly payments.

这些要求适用于购买保留 VM 实例:These requirements apply to buying a reserved VM instance:

  • 对于至少一个 EA 订阅或具有即用即付费率的订阅,必须是所有者角色。You must be in an Owner role for at least one EA subscription or a subscription with a pay-as-you-go rate.
  • 对于 EA 订阅,必须在ea 门户中启用 "添加保留实例" 选项。For EA subscriptions, the Add Reserved Instances option must be enabled in the EA portal. 或者,如果禁用此设置,则必须是订阅的 EA 管理员。Or, if that setting is disabled, you must be an EA Admin for the subscription.
  • 对于云解决方案提供商 (CSP) 计划,只有管理员代理或销售代理才能购买预留。For the Cloud Solution Provider (CSP) program, only the admin agents or sales agents can buy reservations.

若要购买实例:To buy an instance:

  1. 登录到 Azure 门户Sign in to the Azure portal.
  2. 选择“所有服务” > “预订”。Select All services > Reservations.
  3. 选择 "添加" 购买新的预订,然后单击 "虚拟机"。Select Add to purchase a new reservation and then click Virtual machine.
  4. 输入必填字段。Enter required fields. 与所选属性匹配的运行中 VM 实例有资格获得预订折扣。Running VM instances that match the attributes you select qualify to get the reservation discount. 实际获得折扣的 VM 实例数取决于所选范围和数量。The actual number of your VM instances that get the discount depend on the scope and quantity selected.
字段Field 说明Description
订阅Subscription 用于支付预订费用的订阅。The subscription used to pay for the reservation. 订阅的付款方式将按预订费用收费。The payment method on the subscription is charged the costs for the reservation. 订阅类型必须是企业协议(产品/服务编号: BC-OP-NT-AZR-Ms-azr-0017p 或 BC-OP-NT-AZR-Ms-azr-0148p)或 Microsoft 客户协议,或者使用即用即付费率的单个订阅(产品/服务编号: MS-BC-OP-NT-AZR-Ms-azr-0003p 或-bc-op-nt-azr)。The subscription type must be an enterprise agreement (offer numbers: MS-AZR-0017P or MS-AZR-0148P) or Microsoft Customer Agreement or an individual subscription with pay-as-you-go rates (offer numbers: MS-AZR-0003P or MS-AZR-0023P). 将从货币承诺余额中扣除费用(如果可用),或按超额计费。The charges are deducted from the monetary commitment balance, if available, or charged as overage. 对于使用即用即付费率的订阅,将对订阅上的信用卡或发票付款方式收取费用。For a subscription with pay-as-you-go rates, the charges are billed to the credit card or invoice payment method on the subscription.
作用域Scope 预订的范围可以包含一个订阅或多个订阅(共享范围)。The reservation’s scope can cover one subscription or multiple subscriptions (shared scope). 如果选择:If you select:
  • 单个资源组范围 - 仅将预留折扣应用到所选资源组中匹配的资源。Single resource group scope — Applies the reservation discount to the matching resources in the selected resource group only.
  • 单个订阅范围 - 将预留折扣应用到所选订阅中匹配的资源。Single subscription scope — Applies the reservation discount to the matching resources in the selected subscription.
  • 共享范围 - 将预留折扣应用到计费上下文中符合条件的订阅中的匹配资源。Shared scope — Applies the reservation discount to matching resources in eligible subscriptions that are in the billing context. 对于 EA 客户,计费上下文为 "注册"。For EA customers, the billing context is the enrollment. 对于采用即用即付费率的单个订阅,计费范围是由帐户管理员创建的所有符合条件的订阅。For individual subscriptions with pay-as-you-go rates, the billing scope is all eligible subscriptions created by the account administrator.
区域Region 预订涵盖的 Azure 区域。The Azure region that’s covered by the reservation.
VM 大小VM Size VM 实例的大小。The size of the VM instances.
优化对象Optimize for 默认情况下选择了 VM 实例大小灵活性。VM instance size flexibility is selected by default. 单击 "高级设置" 以更改实例大小的灵活性值,以将预订折扣应用于同一VM 大小组中的其他 vm。Click Advanced settings to change the instance size flexibility value to apply the reservation discount to other VMs in the same VM size group. 容量优先级可以对部署优先使用数据中心容量。Capacity priority prioritizes data center capacity for your deployments. 它可让你在需要时启动 VM 实例,从而提供更多的信心。It offers additional confidence in your ability to launch the VM instances when you need them. 仅当预留范围为单个订阅时,容量优先级才可用。Capacity priority is only available when the reservation scope is single subscription.
术语Term 一年或三年。One year or three years.
数量Quantity 预订中购买的实例数。The number of instances being purchased within the reservation. 数量是可以获得计费折扣的正在运行的 VM 实例数。The quantity is the number of running VM instances that can get the billing discount. 例如,如果你在美国东部运行10个 Standard_D2 Vm,则可将数量指定为10,以最大程度地提高所有正在运行的 Vm 的权益。For example, if you are running 10 Standard_D2 VMs in the East US, then you would specify quantity as 10 to maximize the benefit for all running VMs.

使用情况数据和预订利用率Usage data and reservation utilization

对于获得预留折扣的使用量,使用数据的有效价格为零。Your usage data has an effective price of zero for the usage that gets a reservation discount. 你可以看到哪个 VM 实例收到每个预订的预订折扣。You can see which VM instance received the reservation discount for each reservation.

有关如何在使用情况数据中显示预订折扣的详细信息,请参阅了解企业注册的 Azure 保留使用情况(如果你是 EA 客户)。For more information about how reservation discounts appear in usage data, see Understand Azure reservation usage for your Enterprise enrollment if you are an EA customer. 如果有单独的订阅,请参阅了解即用即付订阅的 Azure 保留使用情况If you have an individual subscription, see Understand Azure reservation usage for your Pay-As-You-Go subscription.

在购买后更改保留Change a reservation after purchase

可以在购买后对预留进行以下类型的更改:You can make the following types of changes to a reservation after purchase:

  • 更新预留范围Update reservation scope
  • 实例大小灵活性(如果适用)Instance size flexibility (if applicable)
  • 所有权Ownership

还可以将保留拆分为较小的区块,并合并已拆分的保留项。You can also split a reservation into smaller chunks and merge already split reservations. 任何更改都不会导致新的商业交易,也不会更改预订的结束日期。None of the changes cause a new commercial transaction or change the end date of the reservation.

在购买后,不能进行以下类型的更改:You can't make the following types of changes after purchase, directly:

  • 现有预订的区域An existing reservation’s region
  • SKUSKU
  • 数量Quantity
  • 持续时间Duration

不过,如果想要进行更改,则可以交换预订。However, you can exchange a reservation if you want to make changes.

对预留执行取消、交换或退款操作Cancel, exchange, or refund reservations

可以在一定的限制下对预留执行取消、交换或退款操作。You can cancel, exchange, or refund reservations with certain limitations. 有关详细信息,请参阅 Azure 预留的自助交换和退款For more information, see Self-service exchanges and refunds for Azure Reservations.

需要帮助?Need help? 请联系我们。Contact us.

如果你有任何疑问或需要帮助,请创建支持请求If you have questions or need help, create a support request.

后续步骤Next steps