Merge branch 'master' of https://github.com/Azure/AzureStack-QuickStart-Templates
This commit is contained in:
Коммит
624b6449b5
|
@ -0,0 +1,39 @@
|
|||
# Create a SQL Server 2014 Always On Availability Group with PowerShell DSC Extension
|
||||
|
||||
This template will create a SQL Server 2014 Stand alone server using the PowerShell DSC Extension it creates the following resources:
|
||||
|
||||
+ A Virtual Network
|
||||
+ Two Storage Accounts
|
||||
+ One external and one internal load balancer
|
||||
+ One VM configured as Domain Controllers for a new forest with a single domain
|
||||
+ One VM configured as Sql Server 2014 stand alone.
|
||||
|
||||
The external load balancer creates an RDP NAT rule to allow connectivity to the first VM created, in order to access other VMs in the deployment this VM should be used as a jumpbox.
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
+ The images used to create this deployment are
|
||||
+ AD - Latest Windows Server 2012 R2 Image
|
||||
+ SQL Server - Latest Windows Server 2012 R2 Image
|
||||
|
||||
+ The image configuration is defined in variables - details below - but the scripts that configure this deployment have only been tested with these versions and may not work on other images.
|
||||
|
||||
## Deploying from PowerShell
|
||||
|
||||
For details on how to install and configure Azure Powershell see [here].(https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/)
|
||||
|
||||
Launch a PowerShell console
|
||||
|
||||
Ensure that you are in Resource Manager Mode
|
||||
|
||||
```PowerShell
|
||||
|
||||
Switch-AzureMode AzureResourceManager
|
||||
|
||||
```
|
||||
Change working folder to the folder containing this template
|
||||
|
||||
```PowerShell
|
||||
|
||||
New-AzureResourceGroup -Name "<new resourcegroup name>" -Location "<new resourcegroup location>" -TemplateParameterFile .\azuredeploy.azurestack.parameters.json -TemplateFile .\azuredeploy.json
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"newStorageAccountNamePrefix": {
|
||||
"value": "sqlhcz"
|
||||
},
|
||||
|
||||
"vmNamePrefix": {
|
||||
"value": "vmhcz"
|
||||
},
|
||||
|
||||
"domainName": {
|
||||
"value": "contoso.com"
|
||||
},
|
||||
|
||||
"dnsPrefix": {
|
||||
"value": "vmhcz"
|
||||
},
|
||||
"location": {
|
||||
"value": "local"
|
||||
},
|
||||
"adminPassword": {
|
||||
"value": "!!123abcA"
|
||||
},
|
||||
"sqlServerServiceAccountPassword": {
|
||||
"value": "!!123abcA"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,534 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"newStorageAccountNamePrefix": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The prefix of the new storage account created to store the VMs disks, three different storage accounts will be created using this string as a prefix for the name"
|
||||
}
|
||||
},
|
||||
|
||||
"storageAccountType": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"Standard_LRS",
|
||||
"Standard_GRS",
|
||||
"Standard_RAGRS",
|
||||
"Premium_LRS"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "The type of the Storage Account created"
|
||||
},
|
||||
"defaultValue": "Standard_LRS"
|
||||
},
|
||||
|
||||
"storageDomain": {
|
||||
"type": "string",
|
||||
"defaultValue": "azurestack.local",
|
||||
"metadata": {
|
||||
"description": "The address of Primary AD"
|
||||
}
|
||||
},
|
||||
|
||||
"vmNamePrefix": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The Prefix for the Vms"
|
||||
}
|
||||
},
|
||||
|
||||
"adVMSize": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"Standard_D1",
|
||||
"Standard_A1",
|
||||
"Standard_DS1",
|
||||
"Standard_D2",
|
||||
"Standard_DS2",
|
||||
"Standard_D3",
|
||||
"Standard_DS3",
|
||||
"Standard_D4",
|
||||
"Standard_DS4",
|
||||
"Standard_D11",
|
||||
"Standard_DS11",
|
||||
"Standard_D12",
|
||||
"Standard_DS12",
|
||||
"Standard_D13",
|
||||
"Standard_DS13",
|
||||
"Standard_D14",
|
||||
"Standard_DS14"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "The size of the AD VMs Created"
|
||||
},
|
||||
"defaultValue": "Standard_A1"
|
||||
},
|
||||
|
||||
"sqlVMSize": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"Standard_D1",
|
||||
"Standard_A1",
|
||||
"Standard_DS1",
|
||||
"Standard_D2",
|
||||
"Standard_DS2",
|
||||
"Standard_D3",
|
||||
"Standard_A3",
|
||||
"Standard_DS3",
|
||||
"Standard_D4",
|
||||
"Standard_DS4",
|
||||
"Standard_D11",
|
||||
"Standard_DS11",
|
||||
"Standard_D12",
|
||||
"Standard_DS12",
|
||||
"Standard_D13",
|
||||
"Standard_DS13",
|
||||
"Standard_D14",
|
||||
"Standard_DS14"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "The size of the AD VMs Created"
|
||||
},
|
||||
"defaultValue": "Standard_A3"
|
||||
},
|
||||
|
||||
"dnsPrefix": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The DNS Prefix for the Public IP Address"
|
||||
}
|
||||
},
|
||||
|
||||
"domainName": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The domain name"
|
||||
}
|
||||
},
|
||||
|
||||
"sqlServerServiceAccountUserName": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The SQL Server Service account name"
|
||||
},
|
||||
"defaultValue": "sqlservice"
|
||||
},
|
||||
|
||||
"sqlServerServiceAccountPassword": {
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "The SQL Server Service account password"
|
||||
}
|
||||
},
|
||||
|
||||
"vmNetworkSubnet": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The address range of the subnet static IPs are allocated from in the new VNET"
|
||||
},
|
||||
"defaultValue": "10.0.0.0/24"
|
||||
},
|
||||
"virtualNetworkAddressRange": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The address range of the new VNET in CIDR format"
|
||||
},
|
||||
"defaultValue": "10.0.0.0/16"
|
||||
},
|
||||
|
||||
"sqlSubnet": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The address range of the SQL subnet created in the new VNET"
|
||||
},
|
||||
"defaultValue": "10.0.1.0/24"
|
||||
},
|
||||
"primaryAdIpAddress": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The address of Primary AD"
|
||||
},
|
||||
"defaultValue": "10.0.0.4"
|
||||
},
|
||||
|
||||
"adminUsername": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The name of the Administrator of the new VMs and Domain"
|
||||
},
|
||||
"defaultValue": "sqlAdministrator"
|
||||
},
|
||||
|
||||
"adminPassword": {
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "The password for the Administrator account of the new VMs and Domain"
|
||||
}
|
||||
},
|
||||
|
||||
"assetLocation": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The location of resources that the script is dependent on such as linked templates and DSC modules"
|
||||
},
|
||||
"defaultValue": "https://raw.githubusercontent.com/Azure/AzureStack-QuickStart-Templates/master/sql-2014-non-ha"
|
||||
},
|
||||
|
||||
"adAssetLocation": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The location of resources that the script is dependent on such as linked templates and DSC modules"
|
||||
},
|
||||
"defaultValue": "https://raw.githubusercontent.com/Azure/AzureStack-QuickStart-Templates/master/ad-non-ha"
|
||||
},
|
||||
|
||||
"location": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"West US",
|
||||
"East US",
|
||||
"East US 2",
|
||||
"Central US",
|
||||
"South Central US",
|
||||
"North Central US",
|
||||
"North Europe",
|
||||
"West Europe",
|
||||
"East Asia",
|
||||
"Southeast Asia",
|
||||
"Japan East",
|
||||
"Japan West",
|
||||
"Southeast Asia",
|
||||
"local"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "The region to deploy the resources into"
|
||||
}
|
||||
},
|
||||
|
||||
"sqlLBIPAddress": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The address of secondary AD"
|
||||
},
|
||||
"defaultValue": "10.0.0.6"
|
||||
}
|
||||
},
|
||||
|
||||
"variables": {
|
||||
"staticSubnetName": "ADStaticSubnet",
|
||||
"subnets": [
|
||||
{
|
||||
"name": "[variables('staticSubnetName')]",
|
||||
"properties": {
|
||||
"addressPrefix": "[parameters('vmNetworkSubnet')]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('sqlSubnetName')]",
|
||||
"properties": {
|
||||
"addressPrefix": "[parameters('sqlSubnet')]"
|
||||
}
|
||||
}
|
||||
],
|
||||
"virtualNetworkName": "WorkloadVNET",
|
||||
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
|
||||
"staticSubnetRef": "[concat(variables('vnetID'),'/subnets/',variables('staticSubnetName'))]",
|
||||
"adTemplateURL": "[concat(parameters('adAssetLocation'),'/adVmTemplate.json')]",
|
||||
|
||||
|
||||
"adStorageName": "[concat(parameters('newStorageAccountNamePrefix'),'adsa')]",
|
||||
"adVmDepoyment": "DeployAdVms",
|
||||
"adVmDepoymentId": "[concat('Microsoft.Resources/deployments/', variables('adVmDepoyment'))]",
|
||||
"deployPrimaryAdTemplateURL": "[concat(parameters('adAssetLocation'),'/deployPrimaryAD.json')]",
|
||||
"deployPrimaryAd": "deployPrimaryAd",
|
||||
"deployPrimaryAdId": "[concat('Microsoft.Resources/deployments/', variables('deployPrimaryAd'))]",
|
||||
|
||||
"sqlSubnetName": "sqlSubnet",
|
||||
"sqlSubnetRef": "[concat(variables('vnetID'),'/subnets/',variables('sqlSubnetName'))]",
|
||||
"sqlStorageName": "[concat(parameters('newStorageAccountNamePrefix'),'sqlsa')]",
|
||||
"sqlClusterTemplateURL": "[concat(parameters('assetLocation'),'/sqlVmTemplate.json')]",
|
||||
"deploySqlClusterVms": "deploySqlClusterVms",
|
||||
"deploySqlClusterVmsId": "[concat('Microsoft.Resources/deployments/', variables('deploySqlClusterVms'))]",
|
||||
|
||||
"adVmNamePrefix": "[concat(parameters('vmNamePrefix'),'-AD-')]",
|
||||
"adPDCVMName": "[concat(variables('adVmNamePrefix'),'0')]",
|
||||
"vnetwithDNSTemplateUri": "[concat(parameters('adAssetLocation'),'/vnet-with-dns-server.json')]",
|
||||
"updateVNetDNS1": "updateVNetDNS1",
|
||||
"updateVNetDNS1Id": "[concat('Microsoft.Resources/deployments/', variables('updateVNetDNS1'))]",
|
||||
|
||||
"sqlClusterVmNamePrefix": "[concat(parameters('vmNamePrefix'),'-sql-')]",
|
||||
|
||||
"updateSQLCNic1": "updateSQLCNic1",
|
||||
"updateSQLCNic1Id": "[concat('Microsoft.Resources/deployments/', variables('updateSQLCNic1'))]",
|
||||
"sqlNicName1": "SqlMachine-Nic-0",
|
||||
"nicTemplateURL": "[concat(parameters('adAssetLocation'),'/nic.json')]",
|
||||
|
||||
"deploySqlStandalone": "deploySqlStandalone",
|
||||
"deploySqlStandaloneTemplateUrl" : "[concat(parameters('assetLocation'),'/deploySqlStandalone.json')]",
|
||||
"sqlLBName": "sqlLoadBalancer",
|
||||
|
||||
"publicLBName": "ADPublicLoadBalancer",
|
||||
"publicIPAddressName": "lbPublikIP",
|
||||
"lbFE": "ADLBFE",
|
||||
"lbBE": "ADLBBE",
|
||||
"rpdNAT": "ADRDPNAT",
|
||||
"publiclbID": "[resourceId('Microsoft.Network/loadBalancers',variables('publicLBName'))]",
|
||||
"publiclbFEConfigID": "[concat(variables('publiclbID'),'/frontendIPConfigurations/',variables('lbFE'))]",
|
||||
"rdpPort": 3389,
|
||||
"publicBEAddressPoolID": "[concat(variables('publiclbID'),'/backendAddressPools/',variables('lbBE'))]",
|
||||
"adRDPNATRuleID": "[concat(variables('publiclbID'),'/inboundNatRules/',variables('rpdNAT'))]"
|
||||
|
||||
},
|
||||
|
||||
"resources": [
|
||||
{
|
||||
"name": "[variables('virtualNetworkName')]",
|
||||
"type": "Microsoft.Network/virtualNetworks",
|
||||
"location": "[parameters('location')]",
|
||||
"apiVersion": "2015-05-01-preview",
|
||||
"properties": {
|
||||
"addressSpace": {
|
||||
"addressPrefixes": [
|
||||
"[parameters('virtualNetworkAddressRange')]"
|
||||
]
|
||||
},
|
||||
"subnets": "[variables('subnets')]"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"apiVersion": "2015-05-01-preview",
|
||||
"type": "Microsoft.Network/publicIPAddresses",
|
||||
"name": "[variables('publicIPAddressName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"dependsOn": [
|
||||
"[variables('virtualNetworkName')]"
|
||||
],
|
||||
"properties": {
|
||||
"publicIPAllocationMethod": "Dynamic",
|
||||
"dnsSettings": {
|
||||
"domainNameLabel": "[parameters('dnsPrefix')]"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"apiVersion": "2015-05-01-preview",
|
||||
"name": "[variables('publiclbName')]",
|
||||
"type": "Microsoft.Network/loadBalancers",
|
||||
"location": "[parameters('location')]",
|
||||
"dependsOn": [
|
||||
"[variables('virtualNetworkName')]"
|
||||
],
|
||||
"properties": {
|
||||
"frontendIPConfigurations": [
|
||||
{
|
||||
"name": "[variables('lbFE')]",
|
||||
"properties": {
|
||||
"publicIPAddress": {
|
||||
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"backendAddressPools": [
|
||||
{
|
||||
"name": "[variables('lbBE')]"
|
||||
}
|
||||
],
|
||||
"inboundNatRules": [
|
||||
{
|
||||
"name": "[variables('rpdNAT')]",
|
||||
"properties": {
|
||||
"frontendIPConfiguration": {
|
||||
"id": "[variables('publiclbFEConfigID')]"
|
||||
},
|
||||
"protocol": "tcp",
|
||||
"frontendPort": "[variables('rdpPort')]",
|
||||
"backendPort": 3389,
|
||||
"enableFloatingIP": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "[variables('adVmDepoyment')]",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"apiVersion": "2015-01-01",
|
||||
"dependsOn": [
|
||||
"[variables('publiclbName')]"
|
||||
],
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"templateLink": {
|
||||
"uri": "[variables('adTemplateURL')]",
|
||||
"contentVersion": "1.0.0.0"
|
||||
},
|
||||
"parameters": {
|
||||
"location": { "value": "[parameters('location')]" },
|
||||
"adminUsername": { "value": "[parameters('adminUsername')]" },
|
||||
"adminPassword": { "value": "[parameters('adminPassword')]" },
|
||||
"publicBEAddressPoolID": { "value": "[variables('publicBEAddressPoolID')]" },
|
||||
"adRDPNATRuleID": { "value": "[variables('adRDPNATRuleID')]" },
|
||||
"storageAccount": { "value": "[variables('adStorageName')]" },
|
||||
"subnetResourceId": { "value": "[variables('staticSubnetRef')]" },
|
||||
"primaryAdIpAddress": { "value": "[parameters('primaryAdIpAddress')]" },
|
||||
"storageAccountType": { "value": "[parameters('storageAccountType')]" },
|
||||
"vmNamePrefix": { "value": "[variables('adVmNamePrefix')]" },
|
||||
"storageDomain": { "value": "[parameters('storageDomain')]" },
|
||||
"vmSize": { "value": "[parameters('adVMSize')]" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('deploySqlClusterVms')]",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"apiVersion": "2015-01-01",
|
||||
"dependsOn": [
|
||||
"[variables('virtualNetworkName')]"
|
||||
],
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"templateLink": {
|
||||
"uri": "[variables('sqlClusterTemplateURL')]",
|
||||
"contentVersion": "1.0.0.0"
|
||||
},
|
||||
"parameters": {
|
||||
"location": { "value": "[parameters('location')]" },
|
||||
"adminUsername": { "value": "[parameters('adminUsername')]" },
|
||||
"adminPassword": { "value": "[parameters('adminPassword')]" },
|
||||
"storageAccount": { "value": "[variables('SqlStorageName')]" },
|
||||
"nicSubnetUri": { "value": "[variables('sqlSubnetRef')]" },
|
||||
"lbSubnetUri": { "value": "[variables('staticSubnetRef')]" },
|
||||
"vmNamePrefix": { "value": "[variables('sqlClusterVmNamePrefix')]" },
|
||||
"sqlLBIPAddress": { "value": "[parameters('sqlLBIPAddress')]" },
|
||||
"storageAccountType": { "value": "[parameters('storageAccountType')]" },
|
||||
"storageDomain": { "value": "[parameters('storageDomain')]" },
|
||||
"vmSize": { "value": "[parameters('sqlVMSize')]" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('deployPrimaryAd')]",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"apiVersion": "2015-01-01",
|
||||
"dependsOn": [
|
||||
"[variables('adVmDepoymentId')]"
|
||||
],
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"templateLink": {
|
||||
"uri": "[variables('deployPrimaryAdTemplateURL')]",
|
||||
"contentVersion": "1.0.0.0"
|
||||
},
|
||||
"parameters": {
|
||||
"primaryADName": { "value": "[variables('adPDCVMName')]" },
|
||||
"domainName": { "value": "[parameters('domainName')]" },
|
||||
"location": { "value": "[parameters('location')]" },
|
||||
"adminUsername": { "value": "[parameters('adminUsername')]" },
|
||||
"adminPassword": { "value": "[parameters('adminPassword')]" },
|
||||
"assetLocation": { "value": "[parameters('adAssetLocation')]" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('updateVNetDNS1')]",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"apiVersion": "2015-01-01",
|
||||
"dependsOn": [
|
||||
"[variables('deployPrimaryAdId')]"
|
||||
],
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"templateLink": {
|
||||
"uri": "[variables('vnetwithDNSTemplateUri')]",
|
||||
"contentVersion": "1.0.0.0"
|
||||
},
|
||||
"parameters": {
|
||||
"location": { "value": "[parameters('location')]" },
|
||||
"virtualNetworkName": { "value": "[variables('virtualNetworkName')]" },
|
||||
"virtualNetworkAddressRange": { "value": "[parameters('virtualNetworkAddressRange')]" },
|
||||
"subnets": { "value": "[variables('subnets')]" },
|
||||
"dnsServerAddress": { "value": [ "[parameters('primaryAdIpAddress')]" ] }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "[variables('updateSQLCNic1')]",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"apiVersion": "2015-01-01",
|
||||
"dependsOn": [
|
||||
"[variables('updateVNetDNS1Id')]",
|
||||
"[variables('deploySqlClusterVmsId')]"
|
||||
],
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"templateLink": {
|
||||
"uri": "[variables('nicTemplateURL')]",
|
||||
"contentVersion": "1.0.0.0"
|
||||
},
|
||||
"parameters": {
|
||||
"location": {
|
||||
"value": "[parameters('location')]"
|
||||
},
|
||||
"nicName": {
|
||||
"value": "[variables('sqlNicName1')]"
|
||||
},
|
||||
"ipConfigurations": {
|
||||
"value": [
|
||||
{
|
||||
"name": "ipconfig1",
|
||||
"properties": {
|
||||
"privateIPAllocationMethod": "Dynamic",
|
||||
"subnet": {
|
||||
"id": "[variables('sqlSubnetRef')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dnsServers": {
|
||||
"value": [ "[parameters('primaryAdIpAddress')]" ]
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"name": "[variables('deploySqlStandalone')]",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"apiVersion": "2015-01-01",
|
||||
"dependsOn": [
|
||||
"[variables('updateSQLCNic1Id')]"
|
||||
],
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"templateLink": {
|
||||
"uri": "[variables('deploySqlStandaloneTemplateUrl')]",
|
||||
"contentVersion": "1.0.0.0"
|
||||
},
|
||||
"parameters": {
|
||||
"sqlVMNamePrefix": { "value": "[variables('sqlClusterVmNamePrefix')]" },
|
||||
"domainName": { "value": "[parameters('domainName')]" },
|
||||
"sqlLBName": { "value": "[variables('sqlLBName')]" },
|
||||
"sqlLBIPAddress": { "value": "[parameters('sqlLBIPAddress')]" },
|
||||
"dnsServerName": { "value": "[variables('adPDCVMName')]" },
|
||||
"location": { "value": "[parameters('location')]" },
|
||||
"sqlServerServiceAccountUserName": { "value": "[parameters('sqlServerServiceAccountUserName')]" },
|
||||
"sqlServerServiceAccountPassword": { "value": "[parameters('sqlServerServiceAccountPassword')]" },
|
||||
"adminUsername": { "value": "[parameters('adminUsername')]" },
|
||||
"adminPassword": { "value": "[parameters('adminPassword')]" },
|
||||
"assetLocation": { "value": "[parameters('assetLocation')]" }
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
"outputs": {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"newStorageAccountNamePrefix": {
|
||||
"value": "sqlhcz"
|
||||
},
|
||||
|
||||
"vmNamePrefix": {
|
||||
"value": "vmhcz"
|
||||
},
|
||||
|
||||
"domainName": {
|
||||
"value": "contoso.com"
|
||||
},
|
||||
|
||||
"dnsPrefix": {
|
||||
"value": "vmhcz"
|
||||
},
|
||||
"location": {
|
||||
"value": "West US"
|
||||
},
|
||||
"adminPassword": {
|
||||
"value": "!!123abcA"
|
||||
},
|
||||
"sqlServerServiceAccountPassword": {
|
||||
"value": "!!123abcA"
|
||||
},
|
||||
"storageDomain": {
|
||||
"value": "core.windows.net"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,140 @@
|
|||
{
|
||||
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"sqlVMNamePrefix": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The prefix of VM name for Sql Cluster"
|
||||
}
|
||||
},
|
||||
|
||||
"domainName": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The domain name"
|
||||
}
|
||||
},
|
||||
|
||||
"sqlLBName": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "the load balancer name for SQL Cluster"
|
||||
}
|
||||
},
|
||||
|
||||
"sqlLBIPAddress": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The VM name of Sql Witness server"
|
||||
}
|
||||
},
|
||||
|
||||
"dnsServerName": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The Dns Server Name"
|
||||
}
|
||||
},
|
||||
|
||||
"location": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"West US",
|
||||
"East US",
|
||||
"East US 2",
|
||||
"Central US",
|
||||
"South Central US",
|
||||
"North Central US",
|
||||
"North Europe",
|
||||
"West Europe",
|
||||
"East Asia",
|
||||
"Southeast Asia",
|
||||
"Japan East",
|
||||
"Japan West",
|
||||
"Southeast Asia"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "The region to deploy the resources into"
|
||||
}
|
||||
},
|
||||
|
||||
"sqlServerServiceAccountUserName": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The SQL Server Service account name"
|
||||
},
|
||||
"defaultValue": "sqlservice"
|
||||
},
|
||||
|
||||
"sqlServerServiceAccountPassword":{
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "The SQL Server Service account password"
|
||||
}
|
||||
},
|
||||
|
||||
"adminUsername": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The name of the Administrator of the new VMs and Domain"
|
||||
}
|
||||
},
|
||||
|
||||
"adminPassword": {
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "The password for the Administrator account of the new VMs and Domain"
|
||||
}
|
||||
},
|
||||
|
||||
"assetLocation": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The location of resources that the script is dependent on such as linked templates and DSC modules"
|
||||
}
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"deploySqlStandaloneModulesURL":"[concat(parameters('assetLocation'),'/deploySqlStandalone.ps1.zip')]",
|
||||
"deploySqlStandaloneConfigurationFunction": "deploySqlStandalone.ps1\\deploySqlStandalone"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Compute/virtualMachines/extensions",
|
||||
"name": "[concat(parameters('sqlVMNamePrefix'),'0/sqlAOPrepare')]",
|
||||
"apiVersion": "2015-06-15",
|
||||
"location": "[parameters('location')]",
|
||||
"dependsOn": [
|
||||
],
|
||||
"properties": {
|
||||
"publisher": "Microsoft.Powershell",
|
||||
"type": "DSC",
|
||||
"typeHandlerVersion": "2.8",
|
||||
"settings": {
|
||||
"modulesUrl": "[variables('deploySqlStandaloneModulesURL')]",
|
||||
"configurationFunction": "[variables('deploySqlStandaloneConfigurationFunction')]",
|
||||
"properties": {
|
||||
"domainName": "[parameters('domainName')]",
|
||||
"adminCreds": {
|
||||
"userName": "[parameters('adminUserName')]",
|
||||
"password": "PrivateSettingsRef:adminPassword"
|
||||
},
|
||||
"sqlServiceCreds": {
|
||||
"userName": "[parameters('sqlServerServiceAccountUserName')]",
|
||||
"password": "PrivateSettingsRef:sqlServerServiceAccountPassword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"protectedSettings": {
|
||||
"items": {
|
||||
"adminPassword": "[parameters('adminPassword')]",
|
||||
"sqlServerServiceAccountPassword": "[parameters('sqlServerServiceAccountPassword')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
}
|
||||
}
|
Двоичный файл не отображается.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"itemDisplayName": "Deploys a SQL Server 2014 Always On Availability Group using DSC",
|
||||
"description": "This template creates five new Azure VMs, with a public IP address, NAT'd RDP port, external and internal load balancer and VNet, it configures two VMs to be AD DCs for a new Forest and Domain, and creates a Windows
|
||||
Cluster with the other three VMs, two VMs in the cluster are running SQL Server 2014 and are configured with an availability group and an availability group listener, the other VM is a File Share Witness for the cluster ",
|
||||
"summary": "This template creates 5 Azure VMs with Active Directory and SQL Server Always On",
|
||||
"githubUsername": "simongdavies",
|
||||
"dateUpdated": "2015-06-03"
|
||||
}
|
|
@ -0,0 +1,311 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"vmNamePrefix": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The Prefix of the VM Name"
|
||||
},
|
||||
"defaultValue": "SqlVM"
|
||||
},
|
||||
|
||||
"windowsImagePublisher": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The Publisher of Windows Image"
|
||||
},
|
||||
"defaultValue": "MicrosoftSQLServer"
|
||||
},
|
||||
"windowsImageOffer": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The offer of Windows Image"
|
||||
},
|
||||
"defaultValue": "SQL2014-WS2012R2"
|
||||
},
|
||||
"windowsImageSKU": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The SKU Name of Windows Image"
|
||||
},
|
||||
"defaultValue": "Enterprise"
|
||||
},
|
||||
|
||||
"windowsImageVersion": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The Version of Windows Image"
|
||||
},
|
||||
"defaultValue": "latest"
|
||||
},
|
||||
|
||||
"storageAccount": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The Storage Account Name"
|
||||
}
|
||||
},
|
||||
|
||||
"storageDomain": {
|
||||
"type": "string",
|
||||
"defaultValue": "azurestack.local",
|
||||
"metadata": {
|
||||
"description": "The address of Primary AD"
|
||||
}
|
||||
},
|
||||
|
||||
"storageAccountType": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"Standard_LRS",
|
||||
"Standard_GRS",
|
||||
"Standard_RAGRS",
|
||||
"Premium_LRS"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "The type of the Storage Account created"
|
||||
},
|
||||
"defaultValue": "Standard_LRS"
|
||||
},
|
||||
"adminUsername": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The name of the Administrator of the new VMs and Domain"
|
||||
},
|
||||
"defaultValue": "sqlAdministrator"
|
||||
},
|
||||
"adminPassword": {
|
||||
"type": "securestring",
|
||||
"metadata": {
|
||||
"description": "The password for the Administrator account of the new VMs and Domain"
|
||||
}
|
||||
},
|
||||
|
||||
"location": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"West US",
|
||||
"East US",
|
||||
"East US 2",
|
||||
"Central US",
|
||||
"South Central US",
|
||||
"North Central US",
|
||||
"North Europe",
|
||||
"West Europe",
|
||||
"East Asia",
|
||||
"Southeast Asia",
|
||||
"Japan East",
|
||||
"Japan West",
|
||||
"Southeast Asia",
|
||||
"local"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "The region to deploy the resources into"
|
||||
}
|
||||
},
|
||||
|
||||
"vmSize": {
|
||||
"type": "string",
|
||||
"allowedValues": [
|
||||
"Standard_D1",
|
||||
"Standard_DS1",
|
||||
"Standard_D2",
|
||||
"Standard_DS2",
|
||||
"Standard_D3",
|
||||
"Standard_A3",
|
||||
"Standard_DS3",
|
||||
"Standard_D4",
|
||||
"Standard_DS4",
|
||||
"Standard_D11",
|
||||
"Standard_DS11",
|
||||
"Standard_D12",
|
||||
"Standard_DS12",
|
||||
"Standard_D13",
|
||||
"Standard_DS13",
|
||||
"Standard_D14",
|
||||
"Standard_DS14"
|
||||
],
|
||||
"metadata": {
|
||||
"description": "The size of the AD VMs Created"
|
||||
},
|
||||
"defaultValue": "Standard_D1"
|
||||
},
|
||||
"nicSubnetUri": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "the reference to the subnet of nics"
|
||||
}
|
||||
},
|
||||
|
||||
"lbSubnetUri": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "the reference to the subnet for load balancer"
|
||||
}
|
||||
},
|
||||
|
||||
"sqlDiskSize": {
|
||||
"type": "int",
|
||||
"metadata": {
|
||||
"description": "The address of Primary AD"
|
||||
},
|
||||
"defaultValue": 1000
|
||||
},
|
||||
|
||||
"sqlLBIPAddress": {
|
||||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "The address of secondary AD"
|
||||
},
|
||||
"defaultValue" : "10.0.0.200"
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"publicLBName": "sqlLoadBalancer",
|
||||
"sqlAOListener":"SQLAlwaysOnEndPointListener",
|
||||
"publicIPAddressName": "sqlPublicIp",
|
||||
"lbFE": "SqlLBFE",
|
||||
"lbBE": "SqlLBBE",
|
||||
"sqlNicName": "SqlMachine-Nic-",
|
||||
"vmContainerName": "vhds",
|
||||
"sqllbID":"[resourceId('Microsoft.Network/loadBalancers',variables('publicLBName'))]",
|
||||
"sqllbFEConfigID": "[concat(variables('sqllbID'),'/frontendIPConfigurations/',variables('lbFE'))]",
|
||||
"sqlBEAddressPoolID": "[concat(variables('sqllbID'),'/backendAddressPools/',variables('lbBE'))]",
|
||||
"sqlAOProbe":"SQLAlwaysOnEndPointProbe",
|
||||
"sqllbProbeID":"[concat(variables('sqllbID'),'/probes/',variables('sqlAOProbe'))]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Storage/storageAccounts",
|
||||
"name": "[concat(parameters('storageAccount'), '0')]",
|
||||
"apiVersion": "2015-05-01-preview",
|
||||
"location": "[parameters('location')]",
|
||||
"properties": {
|
||||
"accountType": "[parameters('storageAccountType')]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2015-05-01-preview",
|
||||
"name": "[variables('publicLBName')]",
|
||||
"type": "Microsoft.Network/loadBalancers",
|
||||
"location": "[parameters('location')]",
|
||||
"dependsOn": [
|
||||
],
|
||||
"properties": {
|
||||
"frontendIPConfigurations": [
|
||||
{
|
||||
"name": "[variables('lbFE')]",
|
||||
"properties": {
|
||||
"privateIPAllocationMethod": "Static",
|
||||
"privateIPAddress" :"[parameters('sqlLBIPAddress')]",
|
||||
"subnet": {
|
||||
"id": "[parameters('lbSubnetUri')]"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"backendAddressPools": [
|
||||
{
|
||||
"name": "[variables('lbBE')]"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "[concat(variables('sqlNicName'), '0')]",
|
||||
"type": "Microsoft.Network/networkInterfaces",
|
||||
"location": "[parameters('location')]",
|
||||
"apiVersion": "2015-05-01-preview",
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Network/loadBalancers/',variables('publicLBName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"ipConfigurations": [
|
||||
{
|
||||
"name": "ipconfig1",
|
||||
"properties": {
|
||||
"privateIPAllocationMethod": "Dynamic",
|
||||
"subnet": {
|
||||
"id": "[parameters('nicSubnetUri')]"
|
||||
},
|
||||
"loadBalancerBackendAddressPools": [
|
||||
{
|
||||
"id":"[variables('sqlBEAddressPoolID')]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2015-06-15",
|
||||
"type": "Microsoft.Compute/virtualMachines",
|
||||
"name": "[concat(parameters('vmNamePrefix'), '0')]",
|
||||
"location": "[parameters('location')]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Storage/storageAccounts',concat(parameters('storageAccount'), '0'))]",
|
||||
"[resourceId('Microsoft.Network/networkInterfaces',concat(variables('sqlNicName'), '0'))]"
|
||||
],
|
||||
"properties": {
|
||||
"hardwareProfile": {
|
||||
"vmSize": "[parameters('vmSize')]"
|
||||
},
|
||||
"osProfile": {
|
||||
"computerName": "[concat(parameters('vmNamePrefix'), '0')]",
|
||||
"adminUsername": "[parameters('adminUsername')]",
|
||||
"adminPassword": "[parameters('adminPassword')]"
|
||||
},
|
||||
"storageProfile": {
|
||||
"imageReference": {
|
||||
"publisher": "[parameters('windowsImagePublisher')]",
|
||||
"offer": "[parameters('windowsImageOffer')]",
|
||||
"sku": "[parameters('windowsImageSKU')]",
|
||||
"version": "[parameters('windowsImageVersion')]"
|
||||
},
|
||||
"osDisk": {
|
||||
"name": "osdisk",
|
||||
"vhd": {
|
||||
"uri": "[concat('http://',parameters('storageAccount'),'0', '.blob.' ,parameters('storageDomain'), '/',variables('vmContainerName'),'/', parameters('vmNamePrefix'), '0','-osdisk.vhd')]"
|
||||
},
|
||||
"caching": "ReadWrite",
|
||||
"createOption": "FromImage"
|
||||
},
|
||||
"dataDisks": [
|
||||
{
|
||||
"vhd": {
|
||||
"uri":"[concat('http://',parameters('storageAccount'),'0', '.blob.' ,parameters('storageDomain'), '/',variables('vmContainerName'),'/', parameters('vmNamePrefix'), '0','data-1.vhd')]"
|
||||
},
|
||||
"name":"[concat(parameters('vmNamePrefix'), '0','data-1.vhd')]",
|
||||
"caching" : "None",
|
||||
"createOption": "empty",
|
||||
"diskSizeGB": "[parameters('sqlDiskSize')]",
|
||||
"lun": 0
|
||||
},
|
||||
{
|
||||
"vhd": {
|
||||
"uri":"[concat('http://',parameters('storageAccount'), '0', '.blob.' ,parameters('storageDomain'), '/',variables('vmContainerName'),'/', parameters('vmNamePrefix'), '0','log-1.vhd')]"
|
||||
},
|
||||
"name":"[concat(parameters('vmNamePrefix'), '0','log-1.vhd')]",
|
||||
"caching" : "None",
|
||||
"createOption": "empty",
|
||||
"diskSizeGB": "[parameters('sqlDiskSize')]",
|
||||
"lun": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"networkProfile": {
|
||||
"networkInterfaces": [
|
||||
{
|
||||
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('sqlNicName'), '0'))]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче