Skip to content

Commit

Permalink
Add property "priorityMixPolicy" to VMSS Specification for version 20…
Browse files Browse the repository at this point in the history
…22-08-01 (#20079)

* added priorityMixPolicy property to VMSS specification and an example of creating a vmss with the property included

* added correct api version to create example

* removed maximum value for basePriorityCount in VMSS spec

* Updated create example to remove properties that previously would've caused creation failure with Flexible orchestration

Co-authored-by: Alec Lawlor <aleclawlor@microsoft.com>
  • Loading branch information
aleclawlor and Alec Lawlor authored Aug 31, 2022
1 parent ed6a89b commit b2bd153
Show file tree
Hide file tree
Showing 2 changed files with 260 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
{
"parameters": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "myResourceGroup",
"vmScaleSetName": "{vmss-name}",
"api-version": "2022-08-01",
"parameters": {
"sku": {
"tier": "Standard",
"capacity": 10,
"name": "Standard_A8m_v2"
},
"location": "westus",
"properties": {
"singlePlacementGroup": false,
"virtualMachineProfile": {
"storageProfile": {
"imageReference": {
"sku": "2016-Datacenter",
"publisher": "MicrosoftWindowsServer",
"version": "latest",
"offer": "WindowsServer"
},
"osDisk": {
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"createOption": "FromImage"
}
},
"osProfile": {
"computerNamePrefix": "{vmss-name}",
"adminUsername": "{your-username}",
"adminPassword": "{your-password}"
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"primary": true,
"enableIPForwarding": true,
"ipConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"subnet": {
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
}
}
}
]
}
}
]
},
"priority": "Spot",
"evictionPolicy": "Deallocate",
"billingProfile": {
"maxPrice": -1
}
},
"orchestrationMode": "Flexible",
"priorityMixPolicy": {
"baseRegularPriorityCount": 4,
"regularPriorityPercentageAboveBase": 50
}
}
}
},
"responses": {
"200": {
"body": {
"sku": {
"tier": "Standard",
"capacity": 10,
"name": "Standard_A8m_v2"
},
"name": "{vmss-name}",
"properties": {
"singlePlacementGroup": false,
"uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
"virtualMachineProfile": {
"storageProfile": {
"imageReference": {
"sku": "2016-Datacenter",
"publisher": "MicrosoftWindowsServer",
"version": "latest",
"offer": "WindowsServer"
},
"osDisk": {
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"createOption": "FromImage"
}
},
"osProfile": {
"computerNamePrefix": "{vmss-name}",
"adminUsername": "{your-username}",
"secrets": [],
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true
}
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"dnsSettings": {
"dnsServers": []
},
"primary": true,
"enableIPForwarding": true,
"ipConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"subnet": {
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
},
"privateIPAddressVersion": "IPv4"
}
}
],
"enableAcceleratedNetworking": false
}
}
]
},
"priority": "Spot",
"evictionPolicy": "Deallocate",
"billingProfile": {
"maxPrice": -1
}
},
"orchestrationMode": "Flexible",
"priorityMixPolicy": {
"baseRegularPriorityCount": 4,
"regularPriorityPercentageAboveBase": 50
},
"provisioningState": "Creating"
},
"location": "westus",
"type": "Microsoft.Compute/virtualMachineScaleSets",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
},
"201": {
"body": {
"sku": {
"tier": "Standard",
"capacity": 10,
"name": "Standard_A8m_v2"
},
"name": "{vmss-name}",
"properties": {
"singlePlacementGroup": false,
"uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
"virtualMachineProfile": {
"storageProfile": {
"imageReference": {
"sku": "2016-Datacenter",
"publisher": "MicrosoftWindowsServer",
"version": "latest",
"offer": "WindowsServer"
},
"osDisk": {
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"createOption": "FromImage"
}
},
"osProfile": {
"computerNamePrefix": "{vmss-name}",
"adminUsername": "{your-username}",
"secrets": [],
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true
}
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"dnsSettings": {
"dnsServers": []
},
"primary": true,
"enableIPForwarding": true,
"ipConfigurations": [
{
"name": "{vmss-name}",
"properties": {
"subnet": {
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
},
"privateIPAddressVersion": "IPv4"
}
}
],
"enableAcceleratedNetworking": false
}
}
]
},
"priority": "Spot",
"evictionPolicy": "Deallocate",
"billingProfile": {
"maxPrice": -1
}
},
"orchestrationMode": "Flexible",
"priorityMixPolicy": {
"baseRegularPriorityCount": 4,
"regularPriorityPercentageAboveBase": 50
},
"provisioningState": "Creating"
},
"location": "westus",
"type": "Microsoft.Compute/virtualMachineScaleSets",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@
"Create a scale set with spot restore policy": {
"$ref": "./examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json"
},
"Create a scale set with priority mix policy": {
"$ref": "./examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json"
},
"Create a VMSS with an extension with protectedSettingsFromKeyVault": {
"$ref": "./examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json"
},
Expand Down Expand Up @@ -3627,6 +3630,25 @@
},
"description": "Specifies the Spot-Try-Restore properties for the virtual machine scale set. <br><br> With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on capacity availability and pricing constraint."
},
"PriorityMixPolicy": {
"type": "object",
"properties": {
"baseRegularPriorityCount": {
"type": "integer",
"format": "int32",
"minimum": 0,
"description": "The base number of regular priority VMs that will be created in this scale set as it scales out."
},
"regularPriorityPercentageAboveBase": {
"type": "integer",
"format": "int32",
"minimum": 0,
"maximum": 100,
"description": "The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular priority."
}
},
"description": "Specifies the target splits for Spot and Regular priority VMs within a scale set with flexible orchestration mode. <br><br>With this property the customer is able to specify the base number of regular priority VMs created as the VMSS flex instance scales out and the split between Spot and Regular priority VMs after this base target has been reached."
},
"OrchestrationMode": {
"type": "string",
"description": "Specifies the orchestration mode for the virtual machine scale set.",
Expand Down Expand Up @@ -4800,6 +4822,10 @@
"$ref": "#/definitions/SpotRestorePolicy",
"description": "Specifies the Spot Restore properties for the virtual machine scale set."
},
"priorityMixPolicy": {
"$ref": "#/definitions/PriorityMixPolicy",
"description": "Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance."
},
"timeCreated": {
"readOnly": true,
"type": "string",
Expand Down

0 comments on commit b2bd153

Please sign in to comment.