azure-vm-agents-plugin/src/main/resources/customImageTemplate.json

102 lines
4.4 KiB
JSON

{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
},
"variables": {
"virtualNetworkName": "",
"subnetName": "",
"storageAccountName": "[concat('jnk',uniqueString(resourceGroup().id))]",
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"publicIPAddressType": "Dynamic",
"storageAccountContainerName": "[uniqueString(resourceGroup().id, deployment().name)]",
"storageAccountType": "Standard_LRS"
},
"resources": [
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[concat(variables('vmName'), copyIndex(), 'IPName')]",
"location": "[variables('location')]",
"copy": {
"name": "vmcopy",
"count": "[parameters('count')]"
},
"properties": {
"publicIPAllocationMethod": "[variables('publicIPAddressType')]",
"dnsSettings": {
"domainNameLabel": "[concat(variables('vmName'), copyIndex())]"
}
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat(variables('vmName'), copyIndex(), 'NIC')]",
"location": "[variables('location')]",
"copy": {
"name": "vmcopy",
"count": "[parameters('count')]"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('vmName'), copyIndex(), 'IPName')]"
],
"properties": {
"ipConfigurations": [{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('vmName'), copyIndex(), 'IPName'))]"
},
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}]
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(variables('vmName'), copyIndex())]",
"location": "[variables('location')]",
"copy": {
"name": "vmcopy",
"count": "[parameters('count')]"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('vmName'), copyIndex(), 'NIC')]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[variables('vmSize')]"
},
"osProfile": {
"computername": "[concat(variables('vmName'), copyIndex())]",
"adminUsername": "[variables('adminUsername')]",
"adminPassword": "[variables('adminPassword')]"
},
"storageProfile": {
"osDisk": {
"name": "[concat(variables('vmName'), copyIndex())]",
"osType": "[variables('osType')]",
"caching": "ReadWrite",
"image": {
"uri": "[variables('image')]"
},
"createOption": "FromImage",
"vhd": {
"uri": "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net/',variables('storageAccountContainerName'),'/', variables('vmName'), copyIndex(), 'OSDisk.vhd')]"
}
}
},
"networkProfile": {
"networkInterfaces": [{
"id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('vmName'), copyIndex(), 'NIC'))]"
}]
}
}
}]
}