When a Digital Machine Scale Set must scale out, it usually makes use of a single VM dimension (also called SKU). While that’s easy, it may possibly additionally turn out to be a constraint. For instance the dimensions out may be restricted if that particular dimension has restricted regional capability, quota strain, or a worth profile that’s not ideally suited for each scale-out occasion.
Occasion Combine for Azure Digital Machine Scale Units means that you can configure your scale out with extra choices by outline a number of suitable VM sizes in a single scale set. When scaling out, Azure can select out of your listing throughout provisioning based mostly on the allocation technique you choose.
Occasion Combine is a Digital Machine Scale Units functionality that permits you to specify as much as 5 VM sizes for a single scale set that makes use of Versatile orchestration mode. As an alternative of setting the dimensions set to a single dimension comparable to Standard_D2s_v5, you set the dimensions set SKU title to Combine and outline the actual VM sizes within the skuProfile.
At provisioning time, Azure makes use of the skuProfile.vmSizes listing and the chosen allocation technique to determine which VM dimension to deploy.
The high-level mannequin seems like this:
{
"sku": {
"title": "Combine",
"capability": 2
},
"properties": {
"skuProfile": {
"vmSizes": [
{ "name": "Standard_D2s_v5" },
{ "name": "Standard_D2as_v5" },
{ "name": "Standard_D2s_v4" }
],
"allocationStrategy": "CapacityOptimized"
}
}
}
You need to use this in case your workload can run on multiple VM dimension and also you wish to enhance provisioning success, optimize for price, or align allocation with reservations or financial savings plans.
Occasion Combine is an effective match when:
- Your software can run appropriately on a number of related VM sizes.
- You need scale-out to have multiple capability possibility in a area.
- You run Spot VMs and wish Azure to want lower-priced capability when obtainable.
- You have got reservations for particular sizes, or wish to favor VM sizes with higher savings-plan economics, and want predictable precedence.
- You need one scale set as an alternative of a number of separate scale units for equal employee capability.
It’s often greatest for stateless or horizontally scalable workloads, comparable to net entrance ends, API tiers, queue staff, batch staff, and different scale-out companies the place every occasion performs the identical position.
Keep away from utilizing Occasion Combine as a approach to mix very completely different machines in a single pool. For instance, mixing a small general-purpose VM with a a lot bigger memory-optimized VM could make capability planning, load distribution, and efficiency troubleshooting tougher. Greatest observe is to make use of sizes with related vCPU and reminiscence for balanced load distribution and related VM sorts for constant efficiency.
Earlier than you deploy, examine these necessities:
| Requirement | Element |
|---|---|
| Orchestration mode | Occasion Combine is on the market just for Digital Machine Scale Units utilizing Versatile orchestration mode. |
| Variety of VM sizes | You may specify as much as 5 VM sizes. |
| VM household assist | The Occasion Combine skuProfile helps A, B, D, E, and F VM households. |
| Structure | Don’t combine CPU architectures. For instance, don’t combine Arm64 and x64 sizes in the identical Occasion Combine. |
| Storage interface | Don’t combine incompatible storage interfaces comparable to SCSI and NVMe. |
| Premium storage functionality | Don’t combine VM SKUs that use premium storage with SKUs that don’t. |
| Safety profile | The chosen sizes should use a suitable safety profile. |
| Native disk configuration | The chosen sizes will need to have a constant native disk configuration. |
| Quota | You need to have already got quota for the VM sizes you embody. Occasion Combine doesn’t request quota for you. |
| Unsupported eventualities | Occasion Combine presently doesn’t assist Standby Swimming pools, Azure Devoted Host, Proximity Placement Teams, on-demand capability reservations, or diffDiskSettings on the OS disk. |
Microsoft Study presently states that each one public Azure areas assist Occasion Combine. VM dimension availability and quota nonetheless range by area and subscription, so it is best to examine the precise sizes you intend to make use of earlier than deploying.
Occasion Combine helps three allocation methods.
| Technique | Greatest for | Habits |
|---|---|---|
LowestPrice |
Value-sensitive and fault-tolerant workloads, particularly Spot | Azure prefers the lowest-priced VM sizes within the listing whereas contemplating obtainable capability. It deploys as most of the lowest-priced VMs as capability permits earlier than shifting to higher-priced sizes, so higher-cost sizes could also be chosen to safe capability. That is the default technique if you don’t specify one. |
CapacityOptimized |
Manufacturing workloads the place provisioning success is extra vital than the bottom doable worth | Azure prioritizes VM sizes which have the very best chance of obtainable capability within the goal area. Value just isn’t thought of, and higher-cost sizes could also be chosen to safe capability. |
Prioritized |
Predictable ordering, reservations, or financial savings plan alignment | Azure follows user-defined rank values on VM sizes when offered, topic to quota and regional capability. Decrease rank values have larger precedence. This technique is presently documented as preview. |
Rank word: Use rank solely with Prioritized. Ranks are non-obligatory with Prioritized; when specified, decrease numbers have larger precedence, and rank values may be duplicated or non-sequential. Omit ranks for LowestPrice and CapacityOptimized.
For a lot of operations groups, CapacityOptimized is a sensible start line for manufacturing scale units as a result of it’s designed to enhance the possibility of profitable provisioning. For Spot-heavy or extremely cost-sensitive workloads, LowestPrice could also be a greater first alternative. When you’ve got reservations for particular sizes, or wish to favor VM sizes with higher savings-plan economics, use Prioritized and rank these reservation-backed or most well-liked sizes first.
The instructions beneath are Bash-specific. Use Azure Cloud Shell in Bash mode or one other Bash atmosphere with Azure CLI put in.
You want:
- An Azure subscription.
- Permission to create useful resource teams, networking, and Digital Machine Scale Units.
- Azure CLI model 2.66.0 or later.
- An SSH-capable consumer in case you plan to hook up with the Linux situations.
Examine your Azure CLI model:
az model --query '"azure-cli"' --output tsv
Check in and choose the subscription you wish to use:
az login
az account set --subscription ""
Set variables for the instance:
RG="rg-vmss-instancemix-demo"
LOCATION="australiaeast"
VMSS="vmss-instancemix-demo"
ADMIN_USER="azureuser"
You may change LOCATION to a different public Azure area in case you do not feel like sharing a datacenter rack with drop bears and the occasional kangaroo. Hold the VM sizes within the examples suitable in case you change areas or households.
Earlier than creating the dimensions set, examine that the candidate VM sizes can be found in your goal area and subscription.
az vm list-skus
--location "$LOCATION"
--resource-type virtualMachines
--size Standard_D
--all
--output desk
For this walkthrough, we are going to use these D-series sizes:
Standard_D2s_v5Standard_D2as_v5Standard_D2s_v4
Within the az vm list-skus output, examine the Restrictions column. If a dimension is restricted in your area or subscription, select one other suitable dimension or deploy in a special area.
Occasion Combine doesn’t mechanically request quota. If one dimension within the combine lacks quota, Azure can attempt one other dimension from the listing that has quota. If not one of the eligible sizes has sufficient quota, deployment or scale-out can fail.
Examine present regional VM quota and utilization:
az vm list-usage
--location "$LOCATION"
--output desk
Search for:
Complete Regional vCPUs- The household quota rows that match your chosen VM sizes, comparable to DSv5, DASv5, or DSv4 household vCPUs
If quota is just too low, both request a quota improve or select sizes which have obtainable quota within the goal area.
Create a useful resource group for the demo:
az group create
--name "$RG"
--location "$LOCATION"
The important thing settings are:
--orchestration-mode Versatile--vm-sku Combine--skuprofile-vmsizes--skuprofile-allocation-strategy
Create the dimensions set:
az vmss create
--resource-group "$RG"
--name "$VMSS"
--location "$LOCATION"
--orchestration-mode Versatile
--image Ubuntu2204
--vm-sku Combine
--skuprofile-vmsizes Standard_D2s_v5 Standard_D2as_v5 Standard_D2s_v4
--skuprofile-allocation-strategy CapacityOptimized
--instance-count 2
--admin-username "$ADMIN_USER"
--generate-ssh-keys
This creates a Versatile orchestration scale set with two situations. As a result of the dimensions set makes use of Occasion Combine, the dimensions set SKU title is Combine, and the allowed VM sizes are saved in skuProfile.vmSizes.
Don’t count on each VM dimension within the listing to seem instantly. Azure could deploy all preliminary situations utilizing the identical VM dimension if that satisfies the chosen allocation technique and capability is on the market. The purpose of Occasion Combine is to present Azure extra eligible selections throughout provisioning and scaling.
View the entire skuProfile:
az vmss present
--resource-group "$RG"
--name "$VMSS"
--query "skuProfile"
--output jsonc
Instance output:
{
"allocationStrategy": "CapacityOptimized",
"vmSizes": [
{
"name": "Standard_D2s_v5"
},
{
"name": "Standard_D2as_v5"
},
{
"name": "Standard_D2s_v4"
}
]
}
View solely the configured VM sizes:
az vmss present
--resource-group "$RG"
--name "$VMSS"
--query "skuProfile.vmSizes[].title"
--output tsv
View solely the allocation technique:
az vmss present
--resource-group "$RG"
--name "$VMSS"
--query "skuProfile.allocationStrategy"
--output tsv
Listing the present situations and their VM sizes. As a result of Versatile orchestration situations are customary Azure VMs, use az vm listing for full occasion particulars and filter by the dimensions set useful resource ID:
VMSS_ID=$(az vmss present
--resource-group "$RG"
--name "$VMSS"
--query id
--output tsv)
az vm listing
--resource-group "$RG"
--query "[?virtualMachineScaleSet.id=='$VMSS_ID'].{Title:title, VMSize:hardwareProfile.vmSize, ProvisioningState:provisioningState}"
--output desk
Scale the set from two situations to 5:
az vmss scale
--resource-group "$RG"
--name "$VMSS"
--new-capacity 5
Listing the situations once more:
VMSS_ID=$(az vmss present
--resource-group "$RG"
--name "$VMSS"
--query id
--output tsv)
az vm listing
--resource-group "$RG"
--query "[?virtualMachineScaleSet.id=='$VMSS_ID'].{Title:title, VMSize:hardwareProfile.vmSize, ProvisioningState:provisioningState}"
--output desk
You might even see one VM dimension or a number of VM sizes. The consequence depends upon allocation technique, quota, regional capability, and the sizes in your skuProfile.
Occasion Combine doesn’t require autoscale, nevertheless it turns into particularly helpful when a workload scales out below demand. Autoscale asks the dimensions set so as to add situations; Occasion Combine offers Azure a number of eligible VM sizes to make use of for these new situations.
Create an autoscale profile:
az monitor autoscale create
--resource-group "$RG"
--resource "$VMSS"
--resource-type Microsoft.Compute/virtualMachineScaleSets
--name "vmss-autoscale"
--min-count 2
--max-count 10
--count 2
Create a scale-out rule that provides two situations when common CPU is bigger than 70 % for 5 minutes:
az monitor autoscale rule create
--resource-group "$RG"
--autoscale-name "vmss-autoscale"
--condition "Share CPU > 70 avg 5m"
--scale out 2
Create a scale-in rule that removes one occasion when common CPU is lower than 30 % for 5 minutes:
az monitor autoscale rule create
--resource-group "$RG"
--autoscale-name "vmss-autoscale"
--condition "Share CPU < 30 avg 5m"
--scale in 1
Tune these thresholds in your workload. Scale out aggressively sufficient to guard availability, and scale in conservatively sufficient to keep away from pointless churn.
You may change the VM sizes in an present Occasion Combine configuration. The vital element is that updating --skuprofile-vmsizes replaces the total listing. It doesn’t add or take away a single dimension incrementally.
For instance, this command replaces the combo with 4 sizes:
az vmss replace
--resource-group "$RG"
--name "$VMSS"
--skuprofile-vmsizes Standard_D2s_v5 Standard_D2as_v5 Standard_D2s_v4 Standard_D2as_v4
If you wish to take away a dimension, specify the total listing of sizes you wish to preserve. If you wish to add a dimension, specify the total present listing plus the brand new dimension.
Confirm the brand new listing:
az vmss present
--resource-group "$RG"
--name "$VMSS"
--query "skuProfile.vmSizes[].title"
--output tsv
You can too replace the allocation technique.
For instance, this adjustments the walkthrough scale set from its unique CapacityOptimized technique to LowestPrice. Use this as an actual replace instance, not as a blanket manufacturing suggestion:
az vmss replace
--resource-group "$RG"
--name "$VMSS"
--set skuProfile.allocationStrategy=LowestPrice
If you change the allocation technique, present VMs will not be instantly reshaped. The brand new technique takes impact after the dimensions set scales in or out.
In case you change from Prioritized to a different allocation technique, Microsoft Study notes that you will need to first nullify the precedence ranks related to the VM sizes.
You may allow Occasion Combine on a separate present scale set if it makes use of Versatile orchestration mode, doesn’t already use Occasion Combine, and the chosen VM sizes are suitable. Don’t run this process in opposition to the $VMSS scale set created earlier, as a result of that scale set is already Occasion Combine-enabled.
The required settings are:
- Set
sku.titletoCombine. - Set
sku.tierexplicitly tonulluntil you’ve got confirmed it’s alreadynullor absent. - Present no less than one VM dimension in
skuProfile.vmSizes. - Present an allocation technique, or let Azure use the default lowest-price technique.
Set a separate variable for the prevailing scale set you wish to convert:
EXISTING_VMSS="my-existing-flex-vmss"
Instance:
az vmss replace
--resource-group "$RG"
--name "$EXISTING_VMSS"
--set sku.title=Combine sku.tier=null
--skuprofile-vmsizes Standard_D2as_v4 Standard_D2s_v5 Standard_D2as_v5
--set skuProfile.allocationStrategy=CapacityOptimized
As with different Occasion Combine updates, present VM situations will not be essentially modified instantly. The configuration is used for subsequent scale actions.
In case you want the Azure portal:
- Go to Digital machine scale units.
- Choose Create.
- On the Fundamentals tab, select the subscription, useful resource group, scale set title, area, picture, and administrator settings.
- Set Orchestration mode to Versatile.
- Within the Dimension part, select Choose as much as 5 sizes.
- Choose as much as 5 suitable VM sizes.
- Select the Allocation technique.
- In case you select Prioritized (preview), a Rank dimension part seems beneath Allocation technique. Choose Rank precedence to open the prioritization blade and order the VM sizes based mostly in your most well-liked precedence.
- Full the remaining tabs for networking, administration, well being, scaling, and superior settings.
- Choose Overview + create, then create the dimensions set.
After deployment, open the dimensions set and examine the Overview blade. Within the Properties part, examine Dimension for the configured VM sizes and Administration for the allocation technique.
For net, API, and employee tiers, select sizes with related vCPU and reminiscence. This makes autoscale habits simpler to cause about and helps load distribution stay balanced.
Occasion Combine can use one other listed dimension if one dimension lacks quota, nevertheless it doesn’t request quota for you. Examine quota earlier than manufacturing deployment, particularly in case your autoscale most is excessive.
Reserved occasion pricing and savings-plan reductions can apply with Occasion Combine. If you wish to devour reservation-backed sizes first, or favor sizes with higher savings-plan economics, use the Prioritized technique and rank these sizes first.
Occasion Combine can be utilized with each Spot and Commonplace VMs. The Occasion Combine FAQ says to make use of Spot Precedence Combine once you want an outlined break up between Spot and Commonplace capability.
Caveat: Occasion Combine helps B-family sizes for normal capability, however Azure Spot VMs don’t assist B-series or promo variations of any dimension. In case your scale set will use Spot capability, select Spot-supported sizes for the combo.
If a deployment template contains unsupported properties comparable to Azure Devoted Host, on-demand capability reservation, Standby Swimming pools, Proximity Placement Teams, or OS disk diffDiskSettings, take away these settings earlier than utilizing Occasion Combine.
| Error code | That means | Repair |
|---|---|---|
SkuProfileAllocationStrategyInvalid |
The allocation technique just isn’t legitimate. | Use CapacityOptimized, Prioritized, or LowestPrice for the allocation technique. |
SkuProfileVMSizesCannotBeNullOrEmpty |
No VM sizes have been offered. | Add no less than one VM dimension to skuProfile.vmSizes. |
SkuProfileHasTooManyVMSizesInRequest |
Greater than 5 VM sizes have been specified. | Scale back the listing to not more than 5 VM sizes. |
SkuProfileVMSizesCannotHaveDuplicates |
The identical VM dimension seems greater than as soon as. | Take away duplicate VM sizes. |
SkuNameMustBeMixIfSkuProfileIsSpecified |
A skuProfile was offered, however sku.title just isn’t Combine. |
Set sku.title to Combine. |
SkuTierMustNotBeSetIfSkuProfileIsSpecified |
sku.tier is ready when utilizing Occasion Combine. |
Set sku.tier to null or omit it. |
SkuProfileScenarioNotSupported |
The template features a property not supported with Occasion Combine. | Take away unsupported properties comparable to host teams, capability reservations, or standby pool settings. |
Occasion Combine offers your operations group a sensible approach to make scale units extra versatile. By defining a number of suitable VM sizes and deciding on the suitable allocation technique, you possibly can enhance scale-out success, give Azure extra capability selections, and higher align VM allocation with price or reservation objectives.
For many manufacturing workloads, begin with related VM sizes, confirm regional availability and quota, use Versatile orchestration mode, and take a look at scale-out habits earlier than counting on the configuration in a vital atmosphere.
Use a number of Digital Machine sizes with occasion combine
Create a scale set utilizing occasion combine
Orchestration modes for Digital Machine Scale Units
