You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/capacity-reservation-associate-virtual-machine-scale-set.md
+84-76Lines changed: 84 additions & 76 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -544,21 +544,25 @@ To associate a Virtual Machine Scale Set with a Capacity Reservation Group, see
544
544
545
545
## Associate an existing virtual machine scale set to a capacity reservation group
546
546
547
-
To add an existing capacity reservation group to an existing uniform scale set:
547
+
Existing zonal virtual machine scale set can simply be updated with Capacity Reservation Group property without the need of deallocation. Existing regional virtual machine scale set can include similar process but must be reallocated.
548
+
549
+
### Regional Virtual Machine Scale Set
550
+
551
+
To add an existing regional capacity reservation group to an existing uniform scale set:
548
552
549
553
- Stop the scale set to deallocate the VM instances.
550
554
- Update the scale set to use a matching capacity reservation group.
551
555
- Start the scale set.
552
556
553
557
This process ensures that the placement for the capacity reservations and scale set in the region are compatible.
554
558
555
-
### Important notes on upgrade policies
559
+
####Important notes on upgrade policies
556
560
557
561
-**Automatic upgrade**: In this mode, the scale set VM instances are automatically associated to the capacity reservation group without any further action from you. When the scale set VMs are reallocated, they start consuming the reserved capacity.
558
562
-**Rolling upgrade**: In this mode, scale set VM instances are associated to the capacity reservation group without any further action from you. However, they're updated in batches with an optional pause time between them. When the scale set VMs are reallocated, they start consuming the reserved capacity.
559
563
-**Manual upgrade**: In this mode, nothing happens to the scale set VM instances when the virtual machine scale set is attached to a capacity reservation group. You need to update to each scale set VM by [upgrading it with the latest scale set model](../virtual-machine-scale-sets/virtual-machine-scale-sets-upgrade-policy.md).
560
564
561
-
### [API](#tab/api2)
565
+
####[API](#tab/api2)
562
566
563
567
1. Deallocate the virtual machine scale set:
564
568
@@ -587,7 +591,7 @@ This process ensures that the placement for the capacity reservations and scale
587
591
}
588
592
```
589
593
590
-
### [CLI](#tab/cli2)
594
+
#### [CLI](#tab/cli2)
591
595
592
596
1. Deallocate the virtual machine scale set:
593
597
@@ -607,7 +611,7 @@ This process ensures that the placement for the capacity reservations and scale
@@ -634,7 +638,7 @@ This process ensures that the placement for the capacity reservations and scale
634
638
635
639
To learn more, see the Azure PowerShell commands [Stop-AzVmss](/powershell/module/az.compute/stop-azvmss), [Get-AzVmss](/powershell/module/az.compute/get-azvmss), and [Update-AzVmss](/powershell/module/az.compute/update-azvmss).
636
640
637
-
### [Portal](#tab/portal2)
641
+
#### [Portal](#tab/portal2)
638
642
639
643
<!-- no images necessary if steps are straightforward -->
640
644
@@ -648,96 +652,100 @@ To learn more, see the Azure PowerShell commands [Stop-AzVmss](/powershell/modul
648
652
---
649
653
<!-- The three dashes above show that your section of tabbed content is complete. Don't remove them :) -->
650
654
651
-
## View virtual machine scale set association with the Instance View
655
+
### Zonal Virtual Machine Scale Set
656
+
657
+
If you have capacity in an existing capacity reservation group and you want to add an existing zonal uniform scale set to it, simply update the scale set to the capacity reservation group to use a matching capacity reservation.
658
+
659
+
> [!IMPORTANT]
660
+
> The feature to associate an existing zonal scale set to a reservation group without the need to deallocate, is currently in **Preview**. See the [Preview Terms of Use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
661
+
> The feature is currently not available in Microsoft Azure Government and Microsoft Azure operated by 21Vianet.
662
+
663
+
#### Important notes on upgrade policies
664
+
665
+
- **Automatic upgrade**: In this mode, the scale set VM instances are automatically associated to the capacity reservation group without any further action from you. If already running, the scale set VM instances start consuming the reserved capacity. If the existing scale set VMs are in deallocated state, they start consuming the reserved capacity when reallocated.
666
+
- **Rolling upgrade**: In this mode, scale set VM instances are associated to the capacity reservation group without any further action from you. However, they're updated in batches with an optional pause time between them. If already running, the scale set VM instances start consuming the reserved capacity. If the existing scale set VMs are in deallocated state, they start consuming the reserved capacity when reallocated.
667
+
- **Manual upgrade**: In this mode, nothing happens to the scale set VM instances when the virtual machine scale set is attached to a capacity reservation group. You need to update to each scale set VM by [upgrading it with the latest scale set model](../virtual-machine-scale-sets/virtual-machine-scale-sets-upgrade-policy.md).
652
668
653
-
After the uniform virtual machine scale set is associated to the capacity reservation group, all the subsequent VM allocations will happen against the capacity reservation. Azure automatically finds the matching capacity reservation in the group and consumes a reserved slot.
669
+
#### [API](#tab/api2)
654
670
655
-
### [API](#tab/api3)
656
671
657
-
The capacity reservation group Instance View reflects the new scale set VMs under the `virtualMachinesAssociated` and `virtualMachinesAllocated` properties:
672
+
Add the `capacityReservationGroup` property to the scale set model. Construct the following `PUT` request to `Microsoft.Compute` provider:
658
673
659
674
```rest
660
-
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/CapacityReservationGroups/{CapacityReservationGroupName}?$expand=instanceview&api-version=2021-04-01
675
+
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourcegroupname}/providers/Microsoft.Compute/virtualMachineScaleSets/{VMScaleSetName}?api-version=2021-04-01
661
676
```
662
677
678
+
In the request body, include the `capacityReservationGroup` property:
To learn more, see the Azure PowerShell commands [Stop-AzVmss](/powershell/module/az.compute/stop-azvmss), [Get-AzVmss](/powershell/module/az.compute/get-azvmss), and [Update-AzVmss](/powershell/module/az.compute/update-azvmss).
732
722
733
-
1. Open [Azure portal](https://portal.azure.com).
734
-
1. Go to your capacity reservation group.
735
-
1. Under **Setting**, select **Resources**.
736
-
1. In the table, you can see all the scale set VMs that are associated to the capacity reservation group.
723
+
#### [Portal](#tab/portal2)
724
+
725
+
To associate the scale set to the capacity reservation group using the Azure portal:
726
+
727
+
1. Open the [Azure portal](https://portal.azure.com).
728
+
1. Go to your Virtual Machine Scale Set.
729
+
1. Select **Overview**.
730
+
1. Go to **Configurations** on the left.
731
+
1. In the **Capacity Reservation group** dropdown list, select the group that you want to associate to the scale set.
737
732
738
733
---
739
734
<!-- The three dashes above show that your section of tabbed content is complete. Don't remove them :) -->
740
735
736
+
737
+
### Secure existing zonal virtual machine scale sets using zero size reservation
738
+
739
+
Zonally deployed virtual machines scale sets can be converted to using an On Demand Capacity Reservation without reallocation. If you do not have capacity in an existing capacity reservation group, you can start by creating a zero size matching reservation to secure your workloads. The basic process involves 3 steps:
740
+
741
+
1. Create a Capacity Reservation Group and then matching capacity reservations in each target zone with the reserved quantity set to zero. This requires no additional quota or capacity. For more information on how to create a reservation, see [Create a capacity reservation](/azure/virtual-machines/capacity-reservation-create?tabs=portal1%2Capi1%2Capi2#create-a-capacity-reservation-1).
742
+
743
+
2. Associate existing running zonal virtual machine scale set to the capacity reservation. Set the Virtual Machine Scale Set (VMSS) capacityReservationGroup property to the desired Capacity Reservation Group, then execute a model update on the VMSS (VMSS uniform) or update each member VM with the capacityReservationGroup property (VMSS Flex). When complete, each target capacity reservation will be overallocated See [Zonal Virtual Machine Scale Set](#zonal-virtual-machine-scale-set)
744
+
745
+
3. Increase the reserved quantity of each capacity reservation (CR) to match the allocated Virtual Machine (VM) count. Since each CR is already overallocated, this step requires no additional quota or capacity. For more information on how to update the reserved count, see [Capacity reservation modify](/azure/virtual-machines/capacity-reservation-modify?tabs=api1%2Capi2%2Capi3#update-the-number-of-instances-reserved)
746
+
747
+
After the quantity increase, you should see the CR in a fully allocated state with all the VMSS virtual machines allocated. See [View VM allocation with the Instance View](/azure/virtual-machines/capacity-reservation-associate-vm?tabs=api1%2Capi2%2Capi3#view-vm-allocation-with-the-instance-view).
748
+
741
749
## Region and availability zone considerations
742
750
743
751
You can create virtual machine scale sets regionally or in one or more availability zones to help protect them from datacenter-level failure. To learn more about multizonal virtual machine scale sets, see [Virtual machine scale sets that use availability zones](../virtual-machine-scale-sets/virtual-machine-scale-sets-use-availability-zones.md).
0 commit comments