168 строки
5.5 KiB
JSON
168 строки
5.5 KiB
JSON
{
|
|
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
|
|
"contentVersion": "1.0.0.0",
|
|
"parameters": {
|
|
"region": {
|
|
"type": "string"
|
|
},
|
|
"storageAccountPrefix": {
|
|
"type": "string"
|
|
},
|
|
"adminUsername": {
|
|
"type": "string"
|
|
},
|
|
"adminPassword": {
|
|
"type": "securestring"
|
|
},
|
|
"namespace": {
|
|
"type": "string"
|
|
},
|
|
"vmSize": {
|
|
"type": "string"
|
|
},
|
|
"osSettings": {
|
|
"type": "object"
|
|
},
|
|
"subnet": {
|
|
"type": "object"
|
|
},
|
|
"nodeCount": {
|
|
"type": "int"
|
|
},
|
|
"staticIps": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
"variables": {
|
|
"subnetRef": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('subnet').vnet), '/subnets/', parameters('subnet').name)]",
|
|
"storageAccountName": "[concat(parameters('storageAccountPrefix'), parameters('namespace'))]",
|
|
"vmName": "[concat(parameters('namespace'), 'vm')]"
|
|
},
|
|
"resources": [
|
|
{
|
|
"apiVersion": "2015-05-01-preview",
|
|
"type": "Microsoft.Compute/availabilitySets",
|
|
"name": "[concat(parameters('namespace'), 'set')]",
|
|
"location": "[parameters('region')]",
|
|
"properties": {
|
|
"platformFaultDomainCount": 3,
|
|
"platformUpdateDomainCount": 20
|
|
}
|
|
},
|
|
{
|
|
"type": "Microsoft.Storage/storageAccounts",
|
|
"name": "[variables('storageAccountName')]",
|
|
"apiVersion": "2015-05-01-preview",
|
|
"location": "[parameters('region')]",
|
|
"properties": {
|
|
"accountType": "Standard_LRS"
|
|
}
|
|
},
|
|
{
|
|
"apiVersion": "2015-05-01-preview",
|
|
"type": "Microsoft.Network/networkInterfaces",
|
|
"name": "[concat(parameters('namespace'), 'nic', copyindex())]",
|
|
"location": "[parameters('region')]",
|
|
"copy": {
|
|
"name": "[concat(parameters('namespace'), 'nicLoop')]",
|
|
"count": "[parameters('nodeCount')]"
|
|
},
|
|
"properties": {
|
|
"ipConfigurations": [
|
|
{
|
|
"name": "ipconfig1",
|
|
"properties": {
|
|
"privateIPAllocationMethod": "Static",
|
|
"privateIPAddress": "[concat(parameters('staticIps').base, copyindex(parameters('staticIps').start))]",
|
|
"subnet": {
|
|
"id": "[variables('subnetRef')]"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"apiVersion": "2015-05-01-preview",
|
|
"type": "Microsoft.Compute/virtualMachines",
|
|
"name": "[concat(parameters('namespace'), 'vm', copyindex())]",
|
|
"location": "[parameters('region')]",
|
|
"copy": {
|
|
"name": "[concat(parameters('namespace'), 'vmLoop')]",
|
|
"count": "[parameters('nodeCount')]"
|
|
},
|
|
"dependsOn": [
|
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('namespace'), 'nic', copyindex())]",
|
|
"[concat('Microsoft.Compute/availabilitySets/', parameters('namespace'), 'set')]",
|
|
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
|
|
],
|
|
"properties": {
|
|
"availabilitySet": {
|
|
"id": "[resourceId('Microsoft.Compute/availabilitySets', concat(parameters('namespace'), 'set'))]"
|
|
},
|
|
"hardwareProfile": {
|
|
"vmSize": "[parameters('vmSize')]"
|
|
},
|
|
"osProfile": {
|
|
"computername": "[concat(parameters('namespace'), 'vm', copyIndex())]",
|
|
"adminUsername": "[parameters('adminUsername')]",
|
|
"adminPassword": "[parameters('adminPassword')]"
|
|
},
|
|
"storageProfile": {
|
|
"imageReference": "[parameters('osSettings').imageReference]",
|
|
"osDisk": {
|
|
"name": "osdisk",
|
|
"vhd": {
|
|
"uri": "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net/vhds/', variables('vmName'), copyindex(), '-osdisk.vhd')]"
|
|
},
|
|
"caching": "ReadWrite",
|
|
"createOption": "FromImage"
|
|
},
|
|
"dataDisks": [
|
|
{
|
|
"name": "datadisk1",
|
|
"diskSizeGB": 1023,
|
|
"lun": 0,
|
|
"vhd": {
|
|
"Uri": "[concat('http://', variables('storageAccountName'),'.blob.core.windows.net/','vhds/', variables('vmName'), copyindex(), 'DataDisk1.vhd')]"
|
|
},
|
|
"caching": "None",
|
|
"createOption": "Empty"
|
|
}
|
|
]
|
|
},
|
|
"networkProfile": {
|
|
"networkInterfaces": [
|
|
{
|
|
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(parameters('namespace'), 'nic', copyindex()))]"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Microsoft.Compute/virtualMachines/extensions",
|
|
"name": "[concat(parameters('namespace'), 'vm', copyindex(), '/installdsenode')]",
|
|
"apiVersion": "2015-05-01-preview",
|
|
"location": "[parameters('region')]",
|
|
"copy": {
|
|
"name": "[concat(parameters('namespace'), 'vmLoop')]",
|
|
"count": "[parameters('nodeCount')]"
|
|
},
|
|
"dependsOn": [
|
|
"[concat('Microsoft.Compute/virtualMachines/', parameters('namespace'), 'vm', copyindex())]",
|
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('namespace'), 'nic', copyindex())]"
|
|
],
|
|
"properties": {
|
|
"publisher": "Microsoft.OSTCExtensions",
|
|
"type": "CustomScriptForLinux",
|
|
"typeHandlerVersion": "1.2",
|
|
"settings": {
|
|
"fileUris": "[parameters('osSettings').scripts]",
|
|
"commandToExecute": "bash dsenode.sh"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"outputs": {}
|
|
} |