-
Notifications
You must be signed in to change notification settings - Fork 6
/
VirtualMachines.json
158 lines (158 loc) · 4 KB
/
VirtualMachines.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string"
},
"resourceGroupLocation": {
"type": "string"
},
"availabilitySetName": {
"type": "string"
},
"vMSize": {
"type": "string"
},
"srvName": {
"type": "string"
},
"username": {
"type": "string"
},
"password": {
"type": "string"
},
"imageReferencePublisher": {
"type": "string"
},
"imageReferenceOffer": {
"type": "string"
},
"imageReferenceSku": {
"type": "string"
},
"storageName": {
"type": "string"
},
"vhdContainer": {
"type": "string"
},
"oSDiskName": {
"type": "string"
},
"nicName": {
"type": "string"
},
"isLoadBalancer": {
"type": "string",
"defaultValue": "No"
},
"webSrvNumbOfInstances": {
"type": "int",
"defaultValue": 1
},
"displayName": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"condition": "[not(equals(parameters('isLoadBalancer'), 'Yes'))]",
"name": "[parameters('name')]",
"type": "Microsoft.Compute/virtualMachines",
"location": "[parameters('resourceGroupLocation')]",
"apiVersion": "2015-06-15",
"tags": {
"displayName": "[parameters('displayName')]"
},
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',parameters('availabilitySetName'))]"
},
"hardwareProfile": {
"vmSize": "[parameters('vMSize')]"
},
"osProfile": {
"computerName": "[parameters('srvName')]",
"adminUsername": "[parameters('username')]",
"adminPassword": "[parameters('password')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[parameters('imageReferencePublisher')]",
"offer": "[parameters('imageReferenceOffer')]",
"sku": "[parameters('imageReferenceSku')]",
"version": "latest"
},
"osDisk": {
"name": "[parameters('oSDiskName')]",
"vhd": {
"uri": "[concat('http://', parameters('storageName'), '.blob.core.windows.net/', parameters('vhdContainer'), '/', parameters('oSDiskName'), '.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
}
]
}
}
},
{
"condition": "[equals(parameters('isLoadBalancer'), 'Yes')]",
"name": "[concat(parameters('name'), copyindex())]",
"type": "Microsoft.Compute/virtualMachines",
"location": "[parameters('resourceGroupLocation')]",
"apiVersion": "2015-06-15",
"copy": {
"name": "webSrvMachineLoop",
"count": "[parameters('webSrvNumbOfInstances')]"
},
"tags": {
"displayName": "[parameters('displayName')]"
},
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',parameters('availabilitySetName'))]"
},
"hardwareProfile": {
"vmSize": "[parameters('vMSize')]"
},
"osProfile": {
"computerName": "[concat(parameters('srvName'),copyindex())]",
"adminUsername": "[parameters('username')]",
"adminPassword": "[parameters('password')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[parameters('imageReferencePublisher')]",
"offer": "[parameters('imageReferenceOffer')]",
"sku": "[parameters('imageReferenceSku')]",
"version": "latest"
},
"osDisk": {
"name": "[parameters('oSDiskName')]",
"vhd": {
"uri": "[concat('http://', parameters('storageName'), '.blob.core.windows.net/', parameters('vhdContainer'), '/', parameters('oSDiskName'), copyindex(), '.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', concat(parameters('nicName'), copyindex()))]"
}
]
}
}
}
]
}