2015-04-25 02:13:24 +03:00
|
|
|
{
|
|
|
|
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
|
|
|
|
"contentVersion": "1.0.0.0",
|
|
|
|
"parameters": {
|
|
|
|
"dnsNamePrefix": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"region": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"scriptsUri": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2015-04-26 06:46:50 +03:00
|
|
|
"nodeTemplateUri": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2015-04-25 02:13:24 +03:00
|
|
|
"storageAccount" : {
|
|
|
|
"type": "object"
|
|
|
|
},
|
2015-04-26 06:46:50 +03:00
|
|
|
"vmSize": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2015-04-25 02:13:24 +03:00
|
|
|
"vmCount": {
|
|
|
|
"type": "int"
|
|
|
|
},
|
|
|
|
"vmSpec": {
|
|
|
|
"type": "object"
|
|
|
|
},
|
|
|
|
"networkSpec": {
|
|
|
|
"type": "object"
|
|
|
|
},
|
|
|
|
"clusterSpec": {
|
|
|
|
"type": "object"
|
2015-04-26 06:46:50 +03:00
|
|
|
},
|
|
|
|
"nodeTemplateUri": {
|
|
|
|
"type": "string"
|
2015-04-25 02:13:24 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"variables": {
|
|
|
|
"vmName": "[concat(parameters('dnsNamePrefix'), '-wn-')]",
|
2015-04-26 06:46:50 +03:00
|
|
|
"storageAccountName": "[concat(parameters('storageAccount').prefix, 'wn')]"
|
2015-04-25 02:13:24 +03:00
|
|
|
},
|
|
|
|
"resources": [
|
|
|
|
{
|
|
|
|
"type": "Microsoft.Storage/storageAccounts",
|
|
|
|
"name": "[concat(variables('storageAccountName'), copyIndex(1))]",
|
|
|
|
"apiVersion": "2015-05-01-preview",
|
|
|
|
"location": "[parameters('region')]",
|
|
|
|
"copy": {
|
|
|
|
"name": "storageAccountLoop",
|
|
|
|
"count": "[parameters('vmCount')]"
|
|
|
|
},
|
|
|
|
"properties": {
|
|
|
|
"accountType": "[parameters('storageAccount').type]"
|
|
|
|
}
|
|
|
|
},
|
2015-04-26 06:46:50 +03:00
|
|
|
|
2015-04-25 02:13:24 +03:00
|
|
|
{
|
|
|
|
"name": "[concat(variables('vmName'), copyIndex(1))]",
|
2015-04-26 06:46:50 +03:00
|
|
|
"type": "Microsoft.Resources/deployments",
|
|
|
|
"apiVersion": "2015-01-01",
|
2015-04-25 02:13:24 +03:00
|
|
|
"copy": {
|
|
|
|
"name": "nameNodeNicLoop",
|
|
|
|
"count": "[parameters('vmCount')]"
|
|
|
|
},
|
|
|
|
"dependsOn": [
|
|
|
|
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'), copyIndex(1))]"
|
|
|
|
],
|
|
|
|
"properties": {
|
2015-04-26 06:46:50 +03:00
|
|
|
"mode": "Incremental",
|
|
|
|
"templateLink": {
|
|
|
|
"uri": "[parameters('nodeTemplateUri')]",
|
|
|
|
"contentVersion": "1.0.0.0"
|
2015-04-25 02:13:24 +03:00
|
|
|
},
|
2015-04-26 06:46:50 +03:00
|
|
|
"parameters": {
|
|
|
|
"vmName": {
|
|
|
|
"value": "[concat(variables('vmName'), copyIndex(1))]"
|
2015-04-25 02:13:24 +03:00
|
|
|
},
|
2015-04-26 06:46:50 +03:00
|
|
|
"region": {
|
|
|
|
"value": "[parameters('region')]"
|
2015-04-25 02:13:24 +03:00
|
|
|
},
|
2015-04-26 06:46:50 +03:00
|
|
|
"availabilitySet": {
|
|
|
|
"value": "[parameters('vmSpec').workerNodeASName]"
|
|
|
|
},
|
|
|
|
"storageAccountName" : {
|
|
|
|
"value": "[concat(variables('storageAccountName'), copyIndex(1))]"
|
|
|
|
},
|
|
|
|
"subnetResourceId": {
|
|
|
|
"value": "[concat(resourceId('Microsoft.Network/virtualNetworks',parameters('networkSpec').virtualNetworkName), '/subnets/', parameters('networkSpec').virtualNetworkSubnetName)]"
|
|
|
|
},
|
|
|
|
"dnsName": {
|
|
|
|
"value": "[concat(parameters('dnsNamePrefix'), '-wn-', copyIndex(1))]"
|
|
|
|
},
|
|
|
|
"ipAddress": {
|
|
|
|
"value": "[concat(parameters('networkSpec').privateIPPrefix, copyIndex(parameters('networkSpec').dataNodeAddressStart))]"
|
|
|
|
},
|
|
|
|
"vmSize": {
|
|
|
|
"value": "[parameters('vmSize')]"
|
|
|
|
},
|
|
|
|
"vmSpec": {
|
|
|
|
"value": "[parameters('vmSpec')]"
|
|
|
|
}
|
2015-04-25 02:13:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "Microsoft.Compute/virtualMachines/extensions",
|
|
|
|
"name": "[concat(variables('vmName'), copyIndex(1), '/prepareDisks')]",
|
|
|
|
"apiVersion": "2015-05-01-preview",
|
|
|
|
"location": "[parameters('region')]",
|
|
|
|
"copy": {
|
|
|
|
"name": "nameNodeNicLoop",
|
|
|
|
"count": "[parameters('vmCount')]"
|
|
|
|
},
|
|
|
|
"dependsOn": [
|
2015-04-26 06:46:50 +03:00
|
|
|
"[concat('Microsoft.Resources/deployments/', variables('vmName'), copyIndex(1))]"
|
2015-04-25 02:13:24 +03:00
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"publisher": "Microsoft.OSTCExtensions",
|
|
|
|
"type": "CustomScriptForLinux",
|
|
|
|
"typeHandlerVersion": "1.2",
|
|
|
|
"settings": {
|
|
|
|
"fileUris": [
|
|
|
|
"[concat(parameters('scriptsUri'), '/scripts/initialize-node.sh')]",
|
2015-04-26 23:33:19 +03:00
|
|
|
"[concat(parameters('scriptsUri'), '/scripts/mountDisk.sh')]",
|
2015-04-25 02:13:24 +03:00
|
|
|
"[concat(parameters('scriptsUri'), '/scripts/vm-bootstrap.py')]"
|
|
|
|
],
|
2015-04-26 06:46:50 +03:00
|
|
|
"commandToExecute": "[concat('sh initialize-node.sh \"', parameters('networkSpec').privateIPPrefix, '\" \"', parameters('dnsNamePrefix'), '\" \"', reference(concat(variables('vmName'), copyIndex(1))).outputs.fqdn.value ,'\" ', parameters('clusterSpec').nameNodeCount, ' ', parameters('clusterSpec').dataNodeCount)]"
|
2015-04-25 02:13:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|