Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
181 lines (180 sloc) 6.59 KB
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json# ",
"contentVersion": "1.0.0.0",
"parameters": {
"commonSettings": {
"type": "object",
"metadata": {
"Description": "Common settings object"
}
},
"networkSettings": {
"type": "object",
"metadata": {
"Description": "Network settings object"
}
},
"machineSettings": {
"type": "object",
"metadata": {
"Description": "Machine settings object"
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"Description": "Name of the storage account the VM is assigned to"
}
},
"nodeId": {
"type": "int",
"metadata": {
"Description": "Id of the node in the current cluster."
}
},
"vmSize": {
"type": "string",
"metadata": {
"Description": "Size of the VM"
}
},
"vmScripts": {
"type": "object",
"metadata": {
"Description": "Sripts to download and run on the VM"
}
},
"commandToExecute": {
"type": "string",
"metadata": {
"Description": "Command to run for the script extension."
}
}
},
"variables": {
"vmStorageAccountContainerName": "vhd",
"subnetRef": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('networkSettings').virtualNetworkName), '/subnets/', parameters('networkSettings').subnet.name)]"
},
"resources": [
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat('nic', parameters('nodeId'))]",
"location": "[parameters('commonSettings').region]",
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Static",
"privateIPAddress": "[concat(parameters('networkSettings').nodesIpPrefix, parameters('nodeId'))]",
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
]
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(parameters('machineSettings').machineNamePrefix, parameters('nodeId'))]",
"location": "[parameters('commonSettings').region]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', 'nic', parameters('nodeId'))]"
],
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets', parameters('commonSettings').availabilitySet)]"
},
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computerName": "[concat(parameters('machineSettings').machineNamePrefix, parameters('nodeId'))]",
"adminUsername": "[parameters('machineSettings').adminUsername]",
"adminPassword": "[parameters('machineSettings').adminPassword]"
},
"storageProfile": {
"imageReference": "[parameters('machineSettings').imageReference]",
"osDisk": {
"name": "osdisk",
"vhd": {
"uri": "[concat('http://', parameters('storageAccountName'), '.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/', parameters('machineSettings').machineNamePrefix, parameters('nodeId'),'os-disk.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
},
"dataDisks": [
{
"name": "datadisk0",
"diskSizeGB": "[parameters('machineSettings').dataDiskSize]",
"lun": 0,
"caching": "None",
"createOption": "Empty",
"vhd": {
"Uri": "[concat('http://', parameters('storageAccountName'), '.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/', parameters('machineSettings').machineNamePrefix, parameters('nodeId'),'dataDisk0' ,'.vhd')]"
}
},
{
"name": "datadisk1",
"diskSizeGB": "[parameters('machineSettings').dataDiskSize]",
"lun": 1,
"caching": "None",
"createOption": "Empty",
"vhd": {
"Uri": "[concat('http://', parameters('storageAccountName'), '.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/', parameters('machineSettings').machineNamePrefix, parameters('nodeId') ,'dataDisk1','.vhd')]"
}
},
{
"name": "datadisk2",
"diskSizeGB": "[parameters('machineSettings').dataDiskSize]",
"lun": 2,
"caching": "None",
"createOption": "Empty",
"vhd": {
"Uri": "[concat('http://', parameters('storageAccountName'), '.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/', parameters('machineSettings').machineNamePrefix, parameters('nodeId') ,'dataDisk2','.vhd')]"
}
},
{
"name": "datadisk3",
"diskSizeGB": "[parameters('machineSettings').dataDiskSize]",
"lun": 3,
"caching": "None",
"createOption": "Empty",
"vhd": {
"Uri": "[concat('http://', parameters('storageAccountName'), '.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/', parameters('machineSettings').machineNamePrefix, parameters('nodeId') ,'dataDisk3','.vhd')]"
}
}
]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat('nic', parameters('nodeId')))]"
}
]
}
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('machineSettings').machineNamePrefix, parameters('nodeId'), '/installcouchbase')]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('commonSettings').region]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('machineSettings').machineNamePrefix, parameters('nodeId'))]"
],
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.2",
"settings": {
"fileUris": "[parameters('vmScripts').scriptsToDownload]",
"commandToExecute": "[parameters('commandToExecute')]"
}
}
}
]
}
You can’t perform that action at this time.