btrfs/azuredeploy.json

raw link view readme
1
2 {
3 "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
4 "contentVersion": "1.0.0.0",
5 "parameters": {
6 "admin-username": {
7 "type": "string"
8 },
9 "ssh-public-key": {
10 "type": "string"
11 }
12 },
13 "variables": {
14 "ssh-keypath": "[concat('/home/', parameters('admin-username'), '/.ssh/authorized_keys')]",
15 "unique-prefix": "[concat(replace(resourceGroup().name,'-',''), substring(uniquestring(resourceGroup().name), 0, 5))]",
16 "storage-name": "[variables('unique-prefix')]",
17 "vnet-name": "[concat(resourceGroup().name, '-vnet')]",
18 "ip-prefix": "[concat(resourceGroup().name, '-ip-')]",
19 "nsg-prefix": "[concat(resourceGroup().name, '-nsg-')]",
20 "vm-prefix": "[concat(resourceGroup().name, '-vm-')]",
21 "nic-prefix": "[concat(resourceGroup().name, '-nic-')]",
22 "names": [
23 "alpha",
24 "beta",
25 "gamma",
26 "delta",
27 "epsilon",
28 "zeta",
29 "eta",
30 "theta",
31 "iota",
32 "kappa",
33 "lambda",
34 "mu",
35 "nu",
36 "xi",
37 "omicron",
38 "pi",
39 "rho",
40 "sigma",
41 "tau",
42 "upsilon",
43 "phi",
44 "chi",
45 "psi",
46 "omega"
47 ],
48 "vm-size": "Standard_DS2_v2",
49 "vnet-address-space": "10.16.0.0/12",
50 "vnet-subnet01-octet": 17
51 },
52 "resources": [
53 {
54 "comments": "",
55 "type": "Microsoft.Network/publicIPAddresses",
56 "name": "[concat(variables('ip-prefix'), variables('names')[0])]",
57 "apiVersion": "2017-03-01",
58 "location": "[resourceGroup().location]",
59 "properties": {
60 "publicIPAllocationMethod": "Dynamic",
61 "idleTimeoutInMinutes": 4,
62 "dnsSettings": {
63 "domainNameLabel": "[concat(variables('unique-prefix'), '-', variables('names')[0])]"
64 }
65 },
66 "resources": [],
67 "dependsOn": []
68 },
69 {
70 "comments": "",
71 "type": "Microsoft.Compute/virtualMachines",
72 "name": "[concat(variables('vm-prefix'), variables('names')[0])]",
73 "apiVersion": "2016-04-30-preview",
74 "location": "[resourceGroup().location]",
75 "properties": {
76 "hardwareProfile": {
77 "vmSize": "[variables('vm-size')]"
78 },
79 "storageProfile": {
80 "imageReference": {
81 "publisher": "OpenLogic",
82 "offer": "CentOS",
83 "sku": "7.2",
84 "version": "latest"
85 },
86 "osDisk": {
87 "name": "[concat(variables('vm-prefix'), variables('names')[0], '-boot')]",
88 "createOption": "FromImage",
89 "vhd": {
90 "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storage-name')), '2015-06-15').primaryEndpoints.blob, 'vhds/', variables('names')[0], '-boot.vhd')]"
91 },
92 "caching": "ReadWrite"
93 },
94 "dataDisks": [
95 {
96 "name": "[concat(concat(variables('vm-prefix'), variables('names')[0]), '-disk01')]",
97 "diskSizeGB": 127,
98 "lun": 0,
99 "vhd": {
100 "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storage-name')), '2015-06-15').primaryEndpoints.blob, 'vhds/data01-', variables('names')[0], '-01.vhd')]"
101 },
102 "createOption": "Empty"
103 },
104 {
105 "name": "[concat(concat(variables('vm-prefix'), variables('names')[0]), '-disk02')]",
106 "diskSizeGB": 127,
107 "lun": 1,
108 "vhd": {
109 "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storage-name')), '2015-06-15').primaryEndpoints.blob, 'vhds/data', variables('names')[0], '-02.vhd')]"
110 },
111 "createOption": "Empty"
112 },
113 {
114 "name": "[concat(concat(variables('vm-prefix'), variables('names')[0]), '-disk03')]",
115 "diskSizeGB": 127,
116 "lun": 2,
117 "vhd": {
118 "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storage-name')), '2015-06-15').primaryEndpoints.blob, 'vhds/data', variables('names')[0], '-03.vhd')]"
119 },
120 "createOption": "Empty"
121 },
122 {
123 "name": "[concat(concat(variables('vm-prefix'), variables('names')[0]), '-disk04')]",
124 "diskSizeGB": 127,
125 "lun": 43,
126 "vhd": {
127 "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storage-name')), '2015-06-15').primaryEndpoints.blob, 'vhds/data', variables('names')[0], '-04.vhd')]"
128 },
129 "createOption": "Empty"
130 }
131 ]
132 },
133 "osProfile": {
134 "computerName": "[concat(variables('vm-prefix'), variables('names')[0])]",
135 "adminUsername": "[parameters('admin-username')]",
136 "linuxConfiguration": {
137 "disablePasswordAuthentication": true,
138 "ssh": {
139 "publicKeys": [
140 {
141 "path": "[variables('ssh-keypath')]",
142 "keyData": "[parameters('ssh-public-key')]"
143 }
144 ]
145 }
146 }
147 },
148 "networkProfile": {
149 "networkInterfaces": [
150 {
151 "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nic-prefix'), variables('names')[0]))]"
152 }
153 ]
154 }
155 },
156 "resources": [],
157 "dependsOn": [
158 "[resourceId('Microsoft.Storage/storageAccounts', variables('storage-name'))]",
159 "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nic-prefix'), variables('names')[0]))]"
160 ]
161 },
162 {
163 "type": "Microsoft.Compute/virtualMachines/extensions",
164 "name": "[concat(variables('vm-prefix'), variables('names')[0], '/script')]",
165 "apiVersion": "2015-05-01-preview",
166 "location": "[resourceGroup().location]",
167 "dependsOn": [
168 "[concat(variables('vm-prefix'), variables('names')[0])]"
169 ],
170 "properties": {
171 "publisher": "Microsoft.Azure.Extensions",
172 "type": "CustomScript",
173 "typeHandlerVersion": "2.0",
174 "autoUpgradeMinorVersion": true,
175 "settings": {
176 "fileUris": [
177 "https://linux.azure.david.betz.space/raw/btrfs/install.sh"
178 ],
179 "commandToExecute": "sh install.sh"
180 }
181 }
182 },
183 {
184 "comments": "",
185 "type": "Microsoft.Network/networkInterfaces",
186 "name": "[concat(variables('nic-prefix'), variables('names')[0])]",
187 "apiVersion": "2017-03-01",
188 "location": "[resourceGroup().location]",
189 "properties": {
190 "ipConfigurations": [
191 {
192 "name": "ifconfig1",
193 "properties": {
194 "privateIPAllocationMethod": "Dynamic",
195 "publicIPAddress": {
196 "id": "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('ip-prefix'), variables('names')[0]))]"
197 },
198 "subnet": {
199 "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('vnet-name')), '/subnets/subnet01')]"
200 }
201 }
202 }
203 ],
204 "dnsSettings": {
205 "dnsServers": []
206 },
207 "enableIPForwarding": false,
208 "networkSecurityGroup": {
209 "id": "[resourceId('Microsoft.Network/networkSecurityGroups', concat(variables('nsg-prefix'), variables('names')[0]))]"
210 }
211 },
212 "resources": [],
213 "dependsOn": [
214 "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('ip-prefix'), variables('names')[0]))]",
215 "[resourceId('Microsoft.Network/virtualNetworks', variables('vnet-name'))]",
216 "[resourceId('Microsoft.Network/networkSecurityGroups', concat(variables('nsg-prefix'), variables('names')[0]))]"
217 ]
218 },
219 {
220 "comments": "",
221 "type": "Microsoft.Network/virtualNetworks",
222 "name": "[variables('vnet-name')]",
223 "apiVersion": "2017-03-01",
224 "location": "[resourceGroup().location]",
225 "properties": {
226 "addressSpace": {
227 "addressPrefixes": [
228 "[variables('vnet-address-space')]"
229 ]
230 },
231 "subnets": [
232 {
233 "name": "subnet01",
234 "properties": {
235 "addressPrefix": "[concat('10.', variables('vnet-subnet01-octet'), '.0.0/16')]"
236 }
237 }
238 ]
239 },
240 "resources": [],
241 "dependsOn": []
242 },
243 {
244 "comments": "",
245 "type": "Microsoft.Network/networkSecurityGroups",
246 "name": "[concat(variables('nsg-prefix'), variables('names')[0])]",
247 "apiVersion": "2017-03-01",
248 "location": "[resourceGroup().location]",
249 "properties": {
250 "securityRules": [
251 {
252 "name": "default-allow-ssh",
253 "properties": {
254 "protocol": "Tcp",
255 "sourcePortRange": "*",
256 "destinationPortRange": "22",
257 "sourceAddressPrefix": "*",
258 "destinationAddressPrefix": "*",
259 "access": "Allow",
260 "priority": 1000,
261 "direction": "Inbound"
262 }
263 }
264 ]
265 },
266 "resources": [],
267 "dependsOn": []
268 },
269 {
270 "comments": "",
271 "type": "Microsoft.Storage/storageAccounts",
272 "sku": {
273 "name": "Standard_LRS",
274 "tier": "Standard"
275 },
276 "kind": "Storage",
277 "name": "[variables('storage-name')]",
278 "apiVersion": "2016-01-01",
279 "location": "[resourceGroup().location]",
280 "tags": {},
281 "properties": {},
282 "resources": [],
283 "dependsOn": []
284 }
285 ],
286 "outputs": {
287 "sshCommand": {
288 "type": "string",
289 "value": "[concat('ssh ', variables('unique-prefix'), '-', variables('names')[0], '.', resourceGroup().location, '.cloudapp.azure.com')]"
290 }
291 }
292 }
293
294
295
296