Below ARM template I was trying to run to create 3 VMs in one Resource group. From the Azure portal errors I found out that template failing on VirtualNetwork creation.
"name": "[variables('virtualNetworkName')]",
"type": "Microsoft.Network/virtualNetworks"
What I need is simple expand ~900 identical VMs with private IPs in the same resource group. No DNS or join domain is required.
I found out that to create VM I need Virtual Network and Network security group.I think I don't need storage account for them or at least I somehow can use one storage account for all of them.
In the quickstart templates from Azure I didn't find such template.
Will appreciate your help to make it work.
virtualMachineSize:Basic_A0
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualMachineName": {
"type": "string",
"defaultValue": "uservm0010"
},
"virtualMachineSize": {
"type": "string"
},
"adminUsername": {
"type": "string",
"defaultValue": "user"
},
"adminPassword": {
"type": "securestring",
"value": null
}
},
"variables": {
"nicName": "myVMNic",
"addressPrefix": "10.0.0.0/16",
"subnetName": "Subnet",
"subnetPrefix": "10.0.0.0/24",
"vmName": "SimpleLinVM",
"virtualNetworkName": "MyVNET",
"subnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetName'))]"
},
"resources": [
{
"apiVersion": "2017-12-01",
"name": "[concat(variables('vmName'), padLeft(copyIndex(), 2, '0'))]",
"type": "Microsoft.Compute/virtualMachines",
"location": "[parameters('location')]",
"properties": {
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"hardwareProfile": {
"vmSize": "Basic_A0"
},
"storageProfile": {
"imageReference": {
"publisher": "credativ",
"offer": "Debian",
"sku": "9",
"version": "latest"
},
"dataDisks": []
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
}
]
}
}
},
{
"name": "[variables('virtualNetworkName')]",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2018-02-01",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]"
}
}
]
}
},
{
"name": "[variables('nicName')]",
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2016-09-01",
"location": "[parameters('location')]",
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"subnet": {
"id": "[variables('subnetRef')]"
},
"privateIPAllocationMethod": "Dynamic"
}
}
]
}
},
{"copy":{
"name": "[parameters('virtualMachineName')]",
"count": 3
}
}
]
}