Skip to content

Commit

Permalink
FIX-TEMPLATE: 201-vmss-scale-existing (#9143)
Browse files Browse the repository at this point in the history
* initial commit

* initial commit

* initial commit

* staged change

* initial commit

* initial commit

* initial commit

* 201-vmss-linux-nat-zones

* initial commit

* initial commit

* fixing scaling

* removing dependency

* switching to resourceIds

* changing to resourceIds

* typo

Co-authored-by: olga-spektra <ssi_okuzina@qbsol.com>
  • Loading branch information
olga-spektra and olga-spektra committed May 6, 2021
1 parent 47d9380 commit a9c3ac2
Show file tree
Hide file tree
Showing 5 changed files with 318 additions and 239 deletions.
85 changes: 61 additions & 24 deletions 201-vmss-scale-existing/azuredeploy.json
@@ -1,37 +1,74 @@
{
"$schema":"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion":"1.0.0.0",
"parameters":{
"existingVMSSName":{
"type":"string",
"metadata":{
"description":"Name of existing VM Scale Set"
}
},
"newCapacity":{
"type":"int",
"metadata":{
"description":"Number of desired VM instances"
}
},
"vmSku": {
"parameters": {
"namingInfix": {
"type": "string",
"defaultValue": "Standard_D1_v2",
"metadata": {
"description": "Size of VMs in the VM Scale Set."
"description": "Naming infix of existing VM Scale Set."
}
}
},
"resources":[
{
"type":"Microsoft.Compute/virtualMachineScaleSets",
"apiVersion":"2017-03-30",
"name":"[parameters('existingVMSSName')]",
"location":"[resourceGroup().location]",
"sku":{
"name":"[parameters('vmSku')]",
"tier":"Standard",
"capacity":"[parameters('newCapacity')]"
"type": "Microsoft.Insights/autoscaleSettings",
"apiVersion": "2015-04-01",
"name": "autoscalewad",
"location": "[resourceGroup().location]",
"properties": {
"name": "autoscalewad",
"targetResourceUri": "[resourceId('Microsoft.Compute/virtualMachineScaleSets/', parameters('namingInfix'))]",
"enabled": true,
"profiles": [
{
"name": "Profile1",
"capacity": {
"minimum": "1",
"maximum": "10",
"default": "1"
},
"rules": [
{
"metricTrigger": {
"metricName": "Percentage CPU",
"metricNamespace": "",
"metricResourceUri": "[resourceId('Microsoft.Compute/virtualMachineScaleSets/', parameters('namingInfix'))]",
"timeGrain": "PT1M",
"statistic": "Average",
"timeWindow": "PT5M",
"timeAggregation": "Average",
"operator": "GreaterThan",
"threshold": 60
},
"scaleAction": {
"direction": "Increase",
"type": "ChangeCount",
"value": "3",
"cooldown": "PT1M"
}
},
{
"metricTrigger": {
"metricName": "Percentage CPU",
"metricNamespace": "",
"metricResourceUri": "[resourceId('Microsoft.Compute/virtualMachineScaleSets/', parameters('namingInfix'))]",
"timeGrain": "PT1M",
"statistic": "Average",
"timeWindow": "PT5M",
"timeAggregation": "Average",
"operator": "LessThan",
"threshold": 30
},
"scaleAction": {
"direction": "Decrease",
"type": "ChangeCount",
"value": "1",
"cooldown": "PT5M"
}
}
]
}
]
}
}
]
Expand Down
7 changes: 2 additions & 5 deletions 201-vmss-scale-existing/azuredeploy.parameters.json
Expand Up @@ -2,11 +2,8 @@
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"existingVMSSName": {
"value": "GET-PREREQ-existingVmssName"
},
"newCapacity": {
"value": 3
"namingInfix": {
"value": "GET-PREREQ-namingInfix"
}
}
}
4 changes: 4 additions & 0 deletions 201-vmss-scale-existing/prereqs/.settings.json
@@ -0,0 +1,4 @@
{
"comment": "If prereqs need to be deployed to the same resourceGroup as the rest of the sample set the PrereqResourceGroupNameSuffix property to an empty string - otherwise you can omit this file",
"PrereqResourceGroupNameSuffix": ""
}

0 comments on commit a9c3ac2

Please sign in to comment.