Learn how to use Occasion Combine with Azure Digital Machine Scale Units


When a Digital Machine Scale Set must scale out, it usually makes use of a single VM measurement (also called SKU). While that’s easy, it may well additionally turn into a constraint. For instance the size out is likely to be restricted if that particular measurement has restricted regional capability, quota stress, or a worth profile that’s not best 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 appropriate VM sizes in a single scale set. When scaling out, Azure can select out of your checklist 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 size set to a single measurement comparable to Standard_D2s_v5, you set the size set SKU title to Combine and outline the true VM sizes within the skuProfile.

At provisioning time, Azure makes use of the skuProfile.vmSizes checklist and the chosen allocation technique to determine which VM measurement to deploy.

The high-level mannequin seems to be 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 should utilize this in case your workload can run on a couple of VM measurement 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 utility can run appropriately on a number of comparable VM sizes.
  • You need scale-out to have a couple of capability choice in a area.
  • You run Spot VMs and need Azure to favor lower-priced capability when out there.
  • You’ve gotten reservations for particular sizes, or wish to favor VM sizes with higher savings-plan economics, and wish predictable precedence.
  • You need one scale set as a substitute of a number of separate scale units for equal employee capability.

It’s often finest for stateless or horizontally scalable workloads, comparable to internet entrance ends, API tiers, queue employees, batch employees, and different scale-out companies the place every occasion performs the identical position.

Keep away from utilizing Occasion Combine as a solution 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 more durable. Greatest follow is to make use of sizes with comparable vCPU and reminiscence for balanced load distribution and comparable VM varieties for constant efficiency.

Earlier than you deploy, verify these necessities:

Requirement Element
Orchestration mode Occasion Combine is offered 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 appropriate safety profile.
Native disk configuration The chosen sizes will need to have a constant native disk configuration.
Quota You could have already got quota for the VM sizes you embrace. Occasion Combine doesn’t request quota for you.
Unsupported situations Occasion Combine at the moment doesn’t assist Standby Swimming pools, Azure Devoted Host, Proximity Placement Teams, on-demand capability reservations, or diffDiskSettings on the OS disk.

Microsoft Study at the moment states that each one public Azure areas assist Occasion Combine. VM measurement availability and quota nonetheless differ by area and subscription, so you need to verify the precise sizes you propose to make use of earlier than deploying.

Occasion Combine helps three allocation methods.

Technique Greatest for Conduct
LowestPrice Value-sensitive and fault-tolerant workloads, particularly Spot Azure prefers the lowest-priced VM sizes within the checklist whereas contemplating out there capability. It deploys as most of the lowest-priced VMs as capability permits earlier than transferring 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 attainable worth Azure prioritizes VM sizes which have the very best probability of accessible capability within the goal area. Value will not be 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 greater precedence. This technique is at the moment documented as preview.

Rank notice: Use rank solely with Prioritized. Ranks are non-compulsory with Prioritized; when specified, decrease numbers have greater precedence, and rank values could 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 have reservations for particular sizes, or wish to favor VM sizes with higher savings-plan economics, use Prioritized and rank these reservation-backed or most popular sizes first.

The instructions beneath are Bash-specific. Use Azure Cloud Shell in Bash mode or one other Bash surroundings 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 the event you plan to connect with the Linux situations.

Examine your Azure CLI model:

az model --query '"azure-cli"' --output tsv

Sign up 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 the event you do not feel like sharing a datacenter rack with drop bears and the occasional kangaroo. Preserve the VM sizes within the examples appropriate in the event you change areas or households.

Earlier than creating the size set, verify 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’ll use these D-series sizes:

  • Standard_D2s_v5
  • Standard_D2as_v5
  • Standard_D2s_v4

Within the az vm list-skus output, verify the Restrictions column. If a measurement is restricted in your area or subscription, select one other appropriate measurement or deploy in a special area.

Occasion Combine doesn’t routinely request quota. If one measurement within the combine lacks quota, Azure can attempt one other measurement from the checklist 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 simply too low, both request a quota enhance or select sizes which have out there 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 size 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 size set makes use of Occasion Combine, the size set SKU title is Combine, and the allowed VM sizes are saved in skuProfile.vmSizes.

Don’t count on each VM measurement within the checklist to look instantly. Azure might deploy all preliminary situations utilizing the identical VM measurement if that satisfies the chosen allocation technique and capability is offered. The purpose of Occasion Combine is to present Azure extra eligible decisions throughout provisioning and scaling.

View the whole 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 checklist for full occasion particulars and filter by the size set useful resource ID:

VMSS_ID=$(az vmss present 
  --resource-group "$RG" 
  --name "$VMSS" 
  --query id 
  --output tsv)

az vm checklist 
  --resource-group "$RG" 
  --query "[?virtualMachineScaleSet.id=='$VMSS_ID'].{Identify: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 checklist 
  --resource-group "$RG" 
  --query "[?virtualMachineScaleSet.id=='$VMSS_ID'].{Identify:title, VMSize:hardwareProfile.vmSize, ProvisioningState:provisioningState}" 
  --output desk

You may even see one VM measurement or a number of VM sizes. The end result depends upon allocation technique, quota, regional capability, and the sizes in your skuProfile.

Occasion Combine doesn’t require autoscale, however it turns into particularly helpful when a workload scales out below demand. Autoscale asks the size set so as to add situations; Occasion Combine provides 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 larger than 70 p.c for 5 minutes:

az monitor autoscale rule create 
  --resource-group "$RG" 
  --autoscale-name "vmss-autoscale" 
  --condition "Proportion CPU > 70 avg 5m" 
  --scale out 2

Create a scale-in rule that removes one occasion when common CPU is lower than 30 p.c for 5 minutes:

az monitor autoscale rule create 
  --resource-group "$RG" 
  --autoscale-name "vmss-autoscale" 
  --condition "Proportion CPU 

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 current Occasion Combine configuration. The vital element is that updating --skuprofile-vmsizes replaces the total checklist. It doesn’t add or take away a single measurement incrementally.

For instance, this command replaces the combination 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 measurement, specify the total checklist of sizes you wish to maintain. If you wish to add a measurement, specify the total current checklist plus the brand new measurement.

Confirm the brand new checklist:

az vmss present 
  --resource-group "$RG" 
  --name "$VMSS" 
  --query "skuProfile.vmSizes[].title" 
  --output tsv

You can even replace the allocation technique.

For instance, this modifications 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, current VMs usually are not instantly reshaped. The brand new technique takes impact after the size set scales in or out.

For those who change from Prioritized to a different allocation technique, Microsoft Study notes that you should first nullify the precedence ranks related to the VM sizes.

You may allow Occasion Combine on a separate current scale set if it makes use of Versatile orchestration mode, doesn’t already use Occasion Combine, and the chosen VM sizes are appropriate. Don’t run this process towards the $VMSS scale set created earlier, as a result of that scale set is already Occasion Combine-enabled.

The required settings are:

  • Set sku.title to Combine.
  • Set sku.tier explicitly to null except you’ve confirmed it’s already null or absent.
  • Present at the least one VM measurement in skuProfile.vmSizes.
  • Present an allocation technique, or let Azure use the default lowest-price technique.

Set a separate variable for the present 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, current VM situations usually are not essentially modified instantly. The configuration is used for subsequent scale actions.

For those who favor the Azure portal:

  1. Go to Digital machine scale units.
  2. Choose Create.
  3. On the Fundamentals tab, select the subscription, useful resource group, scale set title, area, picture, and administrator settings.
  4. Set Orchestration mode to Versatile.
  5. Within the Measurement part, select Choose as much as 5 sizes.
  6. Choose as much as 5 appropriate VM sizes.
  7. Select the Allocation technique.
  8. For those who select Prioritized (preview), a Rank measurement part seems beneath Allocation technique. Choose Rank precedence to open the prioritization blade and order the VM sizes based mostly in your most popular precedence.
  9. Full the remaining tabs for networking, administration, well being, scaling, and superior settings.
  10. Choose Evaluation + create, then create the size set.

After deployment, open the size set and verify the Overview blade. Within the Properties part, verify Measurement for the configured VM sizes and Administration for the allocation technique.

For internet, API, and employee tiers, select sizes with comparable vCPU and reminiscence. This makes autoscale conduct simpler to purpose about and helps load distribution stay balanced.

Occasion Combine can use one other listed measurement if one measurement lacks quota, however 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 while you want an outlined cut 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 measurement. In case your scale set will use Spot capability, select Spot-supported sizes for the combination.

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 will not be legitimate. Use CapacityOptimized, Prioritized, or LowestPrice for the allocation technique.
SkuProfileVMSizesCannotBeNullOrEmpty No VM sizes have been offered. Add at the least one VM measurement to skuProfile.vmSizes.
SkuProfileHasTooManyVMSizesInRequest Greater than 5 VM sizes have been specified. Cut back the checklist to not more than 5 VM sizes.
SkuProfileVMSizesCannotHaveDuplicates The identical VM measurement seems greater than as soon as. Take away duplicate VM sizes.
SkuNameMustBeMixIfSkuProfileIsSpecified A skuProfile was offered, however sku.title will not be Combine. Set sku.title to Combine.
SkuTierMustNotBeSetIfSkuProfileIsSpecified sku.tier is about 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 provides your operations group a sensible solution to make scale units extra versatile. By defining a number of appropriate VM sizes and choosing the suitable allocation technique, you’ll be able to enhance scale-out success, give Azure extra capability decisions, and higher align VM allocation with price or reservation targets.

For many manufacturing workloads, begin with comparable VM sizes, confirm regional availability and quota, use Versatile orchestration mode, and check scale-out conduct earlier than counting on the configuration in a important surroundings.

Use a number of Digital Machine sizes with occasion combine

Create a scale set utilizing occasion combine

Orchestration modes for Digital Machine Scale Units

Replace occasion combine settings on an current scale set

Occasion Combine FAQ and troubleshooting

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles