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

管理 Azure 资源的预留Manage Reservations for Azure resources

有关 Azure 购买预订后,你可能需要将预订应用到其他订阅,更改谁可以管理预订,或更改预订的范围。After you buy an reservation for Azure, you may need to apply the reservation to a different subscription, change who can manage the reservation, or change the scope of the reservation. 还可以将预留拆分为两个预留,以将购买的一些实例应用于另一个订阅。You can also split a reservation into two reservations to apply some of the instances you bought to another subscription.

如果购买了 Azure 虚拟机预留实例,则可以更改预留的优化设置。If you bought Azure Reserved Virtual Machine Instances, you can change the optimize setting for the reservation. 预留折扣可以应用于同一系列中的 VM,也可以为特定的 VM 大小保留数据中心容量。The reservation discount can apply to VMs in the same series or you can reserve data center capacity for a specific VM size.

备注

本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

预订订单和保留Reservation Order and Reservation

当你购买的预订时,创建两个对象:预订订单预订When you purchase of a reservation, two objects are created: Reservation Order and Reservation.

在购买时,预订订单具有其下的有一个保留项。At the time of purchase, a Reservation Order has one Reservation under it. 操作,例如拆分、 合并、 部分退款或 exchange 创建下的新保留预订订单Actions such as split, merge, partial refund, or exchange create new reservations under the Reservation Order.

若要查看保留顺序,请转到预订> 选择保留项,并单击预订订单 IDTo view a Reservation Order, go to Reservations > select the reservation, and then click the Reservation order ID.

显示预订订单 ID 的预订订单详细信息的示例Example of reservation order details showing Reservation order ID

保留从其预订订单继承权限。A reservation inherits permissions from its reservation order.

更改预订范围Change the reservation scope

预订折扣适用于虚拟机、 SQL 数据库、 Azure Cosmos DB 或与预订匹配并在预订范围中运行的其他资源。Your reservation discount applies to virtual machines, SQL databases, Azure Cosmos DB, or other resources that match your reservation and run in the reservation scope. 计费上下文依赖于用于购买预订的订阅。The billing context is dependent on the subscription used to buy the reservation.

若要更新预订范围,请执行以下操作:To update the scope of a reservation:

  1. 登录到 Azure 门户Sign in to the Azure portal.
  2. 选择“所有服务” > “预订” 。Select All services > Reservations.
  3. 选择该预订。Select the reservation.
  4. 选择“设置” > “配置” 。Select Settings > Configuration.
  5. 更改范围。Change the scope.

如果要从“共享”更改为单个范围,只能选择自己是其所有者的订阅。If you change from shared to single scope, you can only select subscriptions where you are the owner. 只能选择与该预订相同的计费上下文中的订阅。Only subscriptions within the same billing context as the reservation, can be selected.

企业产品/服务 MS-条-0017 P 或 MS-条-0148 P 或 CSP 订阅类型,作用域仅适用于现用现付费率 (优惠 MS-条-0003 P 或 MS-条-0023 P),使用单独的订阅。The scope only applies to individual subscriptions with pay-as-you-go rates (offers MS-AZR-0003P or MS-AZR-0023P), Enterprise offer MS-AZR-0017P or MS-AZR-0148P, or CSP subscription types.

添加或更改可以管理预订的用户Add or change users who can manage a reservation

你可以通过将用户添加到角色预订订单或预订委托预订管理。You can delegate reservation management by adding people to roles on the reservation order or the reservation. 默认情况下,将预订订单和帐户管理员的人员具有保留顺序和预订所有者角色。By default, the person that places the reservation order and the account administrator have the Owner role on the reservation order and the reservation.

你可以管理对预订订单和预订独立于获取预订折扣的订阅的访问。You can manage access to reservations orders and reservations independently from the subscriptions that get the reservation discount. 如果您为某人提供管理预订订单或预订的权限,它不会向其提供管理订阅的权限。When you give someone permissions to manage a reservation order or the reservation, it doesn't give them permission to manage the subscription. 同样,如果您为某人提供管理预订的范围中的订阅的权限,它无法提供管理预订订单或预订的权限。Similarly, if you give someone permissions to manage a subscription in the reservation's scope, it doesn't give them rights to manage the reservation order or the reservation.

若要执行的 exchange 或退款,用户必须有权预订订单。To perform an exchange or refund, the user must have access to the reservation order. 授予用户权限时,最好以保留顺序,不保留对授予权限。When granting someone permissions, it’s best to grant permissions to the reservation order, not the reservation.

若要委托预订的访问管理,请执行以下操作:To delegate access management for a reservation:

  1. 登录到 Azure 门户Sign in to the Azure portal.
  2. 选择“所有服务” > “预订” 以列出自己有权访问的预订。Select All Services > Reservation to list reservations that you have access to.
  3. 选择要将访问权限委托给其他用户的预订。Select the reservation that you want to delegate access to other users.
  4. 选择“访问控制 (IAM)” 。Select Access control (IAM).
  5. 选择“添加角色分配” > “角色” > “所有者” 。Select Add role assignment > Role > Owner. 或者,如果希望提供有限的访问权限,请选择其他角色。Or, if you want to give limited access, select a different role.
  6. 键入要添加为“所有者”的用户的电子邮件地址。Type the email address of the user you want to add as owner.
  7. 选择用户,再选择“保存” 。Select the user, and then select Save.

将一个预订拆分为两个预订Split a single reservation into two reservations

购买一个预留中的多个资源实例后,可能会希望将一个预留中的实例分配给其他订阅。After you buy more than one resource instance within a reservation, you may want to assign instances within that reservation to different subscriptions. 默认情况下,所有实例都有一个范围 - 单个订阅或共享。By default, all instances have one scope - either single subscription or shared. 例如,已购买 10 个预留实例并将范围指定为订阅 A。现在可能需要将 7 个预留的范围更改为订阅 A,将剩余 3 个预留范围更改为订阅 B。通过拆分预留可以分配实例以进行精细的范围管理。For example, you bought 10 reservation instances and specified the scope to be subscription A. You may now want to change the scope for 7 reservations to subscription A and the remaining 3 to subscription B. Splitting a reservation allows you to distribute instances for granular scope management. 可以通过选择共享范围来简化分配到订阅。You can simplify the allocation to subscriptions by choosing shared scope. 但出于成本管理或预算目的,可以将数量分配到特定订阅。But for cost management or budgeting purposes, you can allocate quantities to specific subscriptions.

可以通过 PowerShell、CLI 或通过 API 将一个预订拆分为两个预订。You can split a reservation into two reservations though PowerShell, CLI, or through the API.

使用 PowerShell 拆分预订Split a reservation by using PowerShell

  1. 通过运行以下命令获取预订订单 ID:Get the reservation order ID by running the following command:

    # Get the reservation orders you have access to
    Get-AzReservationOrder
    
  2. 获取预订的详细信息:Get the details of a reservation:

    Get-AzReservation -ReservationOrderId a08160d4-ce6b-4295-bf52-b90a5d4c96a0 -ReservationId b8be062a-fb0a-46c1-808a-5a844714965a
    
  3. 将该预订拆分为两个预订并分配实例:Split the reservation into two and distribute the instances:

    # Split the reservation. The sum of the reservations, the quantity, must equal the total number of instances in the reservation that you're splitting.
    Split-AzReservation -ReservationOrderId a08160d4-ce6b-4295-bf52-b90a5d4c96a0 -ReservationId b8be062a-fb0a-46c1-808a-5a844714965a -Quantity 3,2
    
  4. 可运行以下命令更新范围:You can update the scope by running the following command:

    Update-AzReservation -ReservationOrderId a08160d4-ce6b-4295-bf52-b90a5d4c96a0 -ReservationId 5257501b-d3e8-449d-a1ab-4879b1863aca -AppliedScopeType Single -AppliedScope /subscriptions/15bb3be0-76d5-491c-8078-61fe3468d414
    

取消和更换Cancellations and exchanges

根据预订类型,可能无法取消或更换预订。Depending on the reservation type, you may be able to cancel or exchange a reservation. 有关详细信息,请参阅以下主题中的取消和交换部分:For more information, see the cancellation and exchanges sections in the following topics:

更改预留 VM 实例的优化设置Change optimize setting for Reserved VM Instances

购买 VM 预留实例时,可以选择实例大小的灵活性或容量优先级。When you buy a Reserved VM Instance, you choose instance size flexibility or capacity priority. 实例大小可以灵活调整,因此可将预留折扣应用到同一 VM 大小组中的其他 VM。Instance size flexibility applies the reservation discount to other VMs in the same VM size group. 容量优先级可以对部署优先使用数据中心容量。Capacity priority prioritizes data center capacity for your deployments. 此选项使你在需要时能够更加有把握地启动 VM 实例。This option offers additional confidence in your ability to launch the VM instances when you need them.

默认情况下,在共享预留范围时,将启用实例大小灵活性。By default, when the scope of the reservation is shared, the instance size flexibility is on. 数据中心容量未针对 VM 部署设置优先级。The data center capacity isn't prioritized for VM deployments.

对于只有一个范围的预留,可以根据容量优先级而不是 VM 实例大小灵活性来优化预留。For reservations where the scope is single, you can optimize the reservation for capacity priority instead of VM instance size flexibility.

若要更新预留的优化设置,请执行以下操作:To update the optimize setting for the reservation:

  1. 登录到 Azure 门户Sign in to the Azure portal.
  2. 选择“所有服务” > “预订” 。Select All Services > Reservations.
  3. 选择该预订。Select the reservation.
  4. 选择“设置” > “配置” 。Select Settings > Configuration.
  5. 更改“优化对象” 设置。Change the Optimize for setting.

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

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

后续步骤Next steps

若要了解有关 Azure 预订的详细信息,请参阅以下文章:To learn more about Azure Reservations, see the following articles:

购买服务计划:Buy a service plan:

购买的软件计划:Buy a software plan:

了解折扣和使用情况:Understand discount and usage: