From 37e7dcfa2a0fa6942a3606139ca697bcc840d97a Mon Sep 17 00:00:00 2001 From: Vivek Kumar Chaubey Date: Thu, 7 Jun 2018 10:49:38 +0530 Subject: [PATCH] Add NetScaler 12.1 Azure ARM custom templates --- README.md | 62 +- templates/HA_pair/HA_1nic/mainTemplate.json | 387 +++++++++++ templates/HA_pair/HA_2nic/mainTemplate.json | 460 +++++++++++++ templates/HA_pair/HA_3nic/mainTemplate.json | 532 +++++++++++++++ .../mainTemplate.json | 545 +++++++++++++++ templates/HA_pair/README.md | 37 + templates/README.md | 4 + templates/express_single_nic/README.md | 9 +- .../express_single_nic/mainTemplate.json | 645 +++++++++--------- templates/standalone/README.md | 21 + .../standalone/VPX_3nic/mainTemplate.json | 439 ++++++++++++ .../mainTemplate.json | 452 ++++++++++++ 12 files changed, 3237 insertions(+), 356 deletions(-) create mode 100644 templates/HA_pair/HA_1nic/mainTemplate.json create mode 100644 templates/HA_pair/HA_2nic/mainTemplate.json create mode 100644 templates/HA_pair/HA_3nic/mainTemplate.json create mode 100644 templates/HA_pair/HA_3nic_backendAutoscale/mainTemplate.json create mode 100644 templates/HA_pair/README.md create mode 100644 templates/README.md create mode 100644 templates/standalone/README.md create mode 100644 templates/standalone/VPX_3nic/mainTemplate.json create mode 100644 templates/standalone/VPX_3nic_backendAutoscale/mainTemplate.json diff --git a/README.md b/README.md index 8e2cdf6..b145c6b 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,62 @@ -Netscaler Azure templates --------------------------------------- +# NetScaler Azure Templates ## Introduction -Welcome to the GitHub repository for Citrix Netscaler Azure templates. This is a repository for [Citrix NetScaler's](https://www.citrix.com/products/netscaler-adc/) templates for deploying Citrix NetScaler in Microsoft Azure Cloud Services. All of the templates in this repository have been developed by the NetScaler engineering team. +Welcome to the GitHub repository for NetScaler ARM(Azure Resource Manager) templates. This repository hosts [Citrix NetScaler ADC](https://www.citrix.com/products/netscaler-adc/) custom templates for deploying NetScaler ADC in Microsoft Azure Cloud Services. All of the templates in this repository have been developed and maintained by the Citrix NetScaler engineering team. -## Citrix NetScaler VPX -Citrix NetScaler VPX is a virtual application delivery controller that combines the latest cloud-native features with a simple user experience. The NetScaler optimizes the user experience ensuring that applications are always available by using advanced L4-7 load balancing, traffic management and proven application acceleration such as HTTP compression and caching. +## NetScaler ADC: Load Balancer, SSL VPN, WAF& SSO -## Citrix NetScaler VPX in Azure -Citrix NetScaler VPX offers are available as resources in the Azure portal. This repository is an extension to provide additional deployments supported by Citrix. +### NetScaler VPX Application Delivery Controller version 12.1 + +Citrix NetScaler is an all-in-one web Application Delivery Controller (ADC) that makes applications run faster, reduces web application ownership costs, optimizes the user experience, and makes sure that applications are always available. + +Citrix NetScaler offers many tools for application deployment. Some of the primary tools are: +* Application Acceleration and Application Security +* HTTP Compression and HTTP Caching +* Web Application Firewall (WAF) +* L4-7 Load Balancer +* Global Server Load Balancing (GSLB) +* SSL Acceleration +* Server Offloading +* Server Consolidation +* Content Switching and Content Caching +* High Availability +* Remote Access and Remote Monitoring +* Policy Engine with Multi-Tenancy +* Data Loss Prevention +* Session Persistence +* SSL VPN +* Single Sign-On + +As an undisputed leader of service and application delivery, Citrix NetScaler solutions are deployed in thousands of networks around the globe to optimize, secure and control the delivery of all enterprise and cloud services. Deployed directly in front of web and database servers, NetScaler provides an integrated, and easy-to-use platform. + +### NetScaler ADC version 12.1 High Availability (HA) Pair + +Citrix NetScaler High Availability (HA) Azure Resource Manager (ARM) template is designed to ensure easy and consistent way of deploying NetScaler pair in Active-Passive mode. In addition to benefits of standalone NetScaler ADC, HA Pair increases reliability and system availability with built in redundancy. This ARM template supports Bring Your Own License (BYOL) or Hourly based selection. Choice of selection is offered during template deployment. + +## NetScaler VPX in Azure +Standard Citrix NetScaler VPX offers are available as resources in the Azure portal. This repository is an extension to provide additional deployments supported by Citrix. ## About these templates Each template in this repository has co-located documentation describing the usage and architecture of the template. The templates attempt to codify recommended deployment architecture of the Citrix NetScaler VPX, or to introduce the user to the Citrix NetScaler or to demonstrate a particular feature / edition / option. Users can re-use / modify or enhance the templates to suit their particular production and testing needs. Most templates require sufficient subscriptions to portal.azure.com to create resource and deploy templates. +Citrix NetScaler VPX Azure Resource Manager (ARM) templates are designed to ensure easy and consistent way of deploying standalone NetScaler VPX. These template increases reliability and system availability with built in redundancy. These ARM template supports Bring Your Own License (BYOL) or Hourly based selection. Choice of selection is either mentioned in template desciption or offered during template deployment. + +## Template Links +#### [NetScaler VPX Express](templates/express_single_nic/) +#### [Standalone NetScaler VPX Templates](templates/standalone/) +#### [NetScaler High Availability(HA) Pair Templates](templates/HA_pair/) + ## Versioning -The master branch of the repository generally has the latest version of the template. Older released versions are tagged appropriately +The master branch of the repository generally has the latest version of the template. Older released versions are tagged appropriately as release with NetScaler release version. We additionally maintain dedicated branches hosting templates for supoprted NetScaler releases. These branches are named as `NetScaler` ## Support -For production issues with the templates, please contact Citrix Support through your normal support channels. If you have fixes / suggestions for improvements or requests, please raise an issue in this repository. +For production issues with the templates, please contact Citrix Support through your normal support channels. If you have fixes / suggestions for improvements or requests specific to ARM Templates, please raise an issue in this repository. ## Further reading -- VPX installation in Azure : https://docs.citrix.com/en-us/netscaler/12/deploying-vpx/deploy-vpx-on-azure.html -- Citrix NetScaler 12.0 Documention : https://docs.citrix.com/en-us/netscaler/12.html -- Citrix NetScaler Overview : https://www.citrix.com/products/netscaler-adc/resources/netscaler-vpx.html +- [Deploy a NetScaler VPX instance on Microsoft Azure](https://docs.citrix.com/en-us/netscaler/12-1/deploying-vpx/deploy-vpx-on-azure.html) +- [Citrix NetScaler 12.1 Product Documentation](https://docs.citrix.com/en-us/netscaler/12-1.html) +- [Citrix NetScaler Overview](https://www.citrix.com/products/netscaler-adc/resources/netscaler-vpx.html) ## Legal -Privacy Policy : http://www.citrix.com/about/legal/privacy.html - -Terms of use : [Citrix License](LICENSE.md) \ No newline at end of file +- [Citrix Privacy Policy](http://www.citrix.com/about/legal/privacy.html) +- [Citrix License](LICENSE.md) \ No newline at end of file diff --git a/templates/HA_pair/HA_1nic/mainTemplate.json b/templates/HA_pair/HA_1nic/mainTemplate.json new file mode 100644 index 0000000..ada4e79 --- /dev/null +++ b/templates/HA_pair/HA_1nic/mainTemplate.json @@ -0,0 +1,387 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "12.1.0.0", + "parameters": { + "adminUsername": { + "defaultValue": "nsroot", + "type": "String", + "metadata": { + "description": "Username for the Virtual Machines." + } + }, + "adminPassword": { + "type": "SecureString", + "metadata": { + "description": "Password for the Virtual Machines." + } + }, + "vmSize": { + "defaultValue": "Standard_DS3_v2", + "type": "String", + "allowedValues": [ + "Standard_DS3_v2", + "Standard_DS4_v2" + ], + "metadata": { + "description": "Size of Azure Virtual Machine." + } + }, + "vmSku": { + "defaultValue": "netscalerbyol", + "type": "String", + "allowedValues": ["netscalerbyol", + "netscaler10standard", + "netscaler10enterprise", + "netscaler10platinum", + "netscaler200standard", + "netscaler200enterprise", + "netscaler200platinum", + "netscaler1000standard", + "netscaler1000enterprise", + "netscaler1000platinum", + "netscaler3000standard", + "netscaler3000enterprise", + "netscaler3000platinum" + ], + + "metadata": { + "description": "SKU of NetScaler Image." + } + }, + "vnetName": { + "defaultValue": "vnet01", + "type": "String", + "metadata": { + "description": "Name of Virtual Network" + } + }, + "vnetResourceGroup": { + "defaultValue": "", + "type": "String", + "metadata": { + "description": "Resource Group name of existing Virtual Network. Leave empty if Resource Group is same as current deployment." + } + }, + "vnetNewOrExisting": { + "defaultValue": "new", + "allowedValues": [ + "new", + "existing" + ], + "type": "String" + }, + "snetName": { + "defaultValue": "subnet", + "type": "String", + "metadata": { + "description": "Name of Subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetAddressPrefix": { + "defaultValue": "10.11.0.0/24", + "type": "String", + "metadata": { + "description": "Value of subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "baseUrl": { + "defaultValue": "https://github.com/citrix/netscaler-azure-templates", + "type": "String", + "metadata": { + "artifactsBaseUrl": "", + "description": "The base URL for dependent assets" + } + } + }, + "variables": { + "vmN": "ns-vpx", + "nicN": "ns-vpx-nic", + "nsgN": "ns-vpx-nic-nsg", + "lbN": "alb", + "bePoolN": "bepool-11", + "probeN": "probe-11", + "ipConfN": "ipconf-11", + "avsN": "avl-set", + "alb-pipN": "alb-publicip", + "mgmt-pipN-suffix": "-mgmt-publicip", + "saN": "[concat('vpxha', uniqueString(resourceGroup().id))]", + "vnetRg": "[if(equals(parameters('vnetResourceGroup'), ''), resourceGroup().name,parameters('vnetResourceGroup'))]", + "vnetId": "[resourceId(variables('vnetRg'), 'Microsoft.Network/virtualNetworks', parameters('vnetName'))]", + "snetRef": "[concat(variables('vnetId'), '/subnets/', parameters('snetName'))]", + "lbId": "[resourceId( 'Microsoft.Network/loadBalancers', variables('lbN'))]", + "bePoolId": "[concat(variables('lbId'),'/backendAddressPools/', variables('bePoolN'))]", + "probeId": "[concat(variables('lbId'),'/probes/', variables('probeN'))]", + "ipConfId": "[concat(variables('lbId'),'/frontendIpConfigurations/', variables('ipConfN'))]" + }, + "resources": [{ + "type": "Microsoft.Network/loadBalancers", + "name": "[variables('lbN')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "frontendIPConfigurations": [{ + "name": "[variables('ipConfN')]", + "properties": { + "publicIPAddress": { + "id": "[resourceId( 'Microsoft.Network/publicIpAddresses', variables('alb-pipN'))]" + } + } + } + ], + "backendAddressPools": [{ + "name": "[variables('bePoolN')]" + } + ], + "probes": [{ + "name": "[variables('probeN')]", + "properties": { + "protocol": "tcp", + "port": 9000, + "intervalInSeconds": 5, + "numberOfProbes": 2 + } + } + ], + "loadBalancingRules": [{ + "name": "lbRule1", + "properties": { + "frontendIPConfiguration": { + "id": "[variables('ipConfId')]" + }, + "frontendPort": 80, + "backendPort": 80, + "enableFloatingIP": true, + "idleTimeoutInMinutes": 4, + "protocol": "Tcp", + "loadDistribution": "Default", + "backendAddressPool": { + "id": "[variables('bePoolId')]" + }, + "probe": { + "id": "[variables('probeId')]" + } + } + } + ] + }, + "dependsOn": [ + "[concat('Microsoft.Network/publicIpAddresses/', variables('alb-pipN'))]" + ] + }, { + "type": "Microsoft.Compute/availabilitySets", + "name": "[variables('avsN')]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "properties": { + "platformFaultDomainCount": "3", + "platformUpdateDomainCount": "20" + } + }, { + "type": "Microsoft.Compute/virtualMachines", + "name": "[concat(variables('vmN'), copyIndex())]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "vmcopy", + "count": 2 + }, + "plan": { + "name": "[parameters('vmSku')]", + "publisher": "citrix", + "product": "netscalervpx-121" + }, + "properties": { + "osProfile": { + "computerName": "[concat(variables('vmN'), copyIndex())]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]", + "customData": "[base64(concat('{\"username\":\"', parameters('adminUsername'), '\",\"ha_config\":{\"peer_node\":\"', reference(concat(variables('nicN'), sub(1, copyIndex()))).ipConfigurations[0].properties.privateIPAddress ,'\"},\"vpx_config\":{\"snip_11\":\"', reference(concat(variables('nicN'), copyIndex())).ipConfigurations[1].properties.privateIPAddress ,'\",\"pvt_ip_12\":\"', reference(concat(variables('nicN'), copyIndex())).ipConfigurations[2].properties.privateIPAddress ,'\",\"subnet_11\":\"', reference(variables('snetRef'), '2017-10-01', 'Full').properties.addressPrefix ,'\",\"subnet_12\":\"', reference(variables('snetRef'), '2017-10-01', 'Full').properties.addressPrefix, '\"}}'))]" + }, + "hardwareProfile": { + "vmSize": "[parameters('vmSize')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "citrix", + "offer": "netscalervpx-121", + "sku": "[parameters('vmSku')]", + "version": "latest" + }, + "osDisk": { + "createOption": "fromImage", + "vhd": { + "uri": "[concat(reference(variables('saN'), '2017-10-01').primaryEndpoints.blob, 'vhds/osdisk', copyIndex(), '.vhd')]" + }, + "name": "[concat(variables('vmN'), copyIndex())]" + }, + "dataDisks": [] + }, + "networkProfile": { + "networkInterfaces": [{ + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex()))]", + "properties": { + "primary": true + } + } + ] + }, + "availabilitySet": { + "id": "[resourceId('Microsoft.Compute/availabilitySets', variables('avsN'))]" + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId( 'Microsoft.Storage/storageAccounts', variables('saN')), '2017-10-01').primaryEndpoints['blob']]" + } + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex())]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()))]", + "[concat('Microsoft.Compute/availabilitySets/', variables('avsN'))]", + "[concat('Microsoft.Storage/storageAccounts/', variables('saN'))]" + ] + }, { + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('saN')]", + "apiVersion": "2017-10-01", + "kind": "Storage", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard_LRS" + }, + "properties": {} + }, { + "type": "Microsoft.Network/virtualNetworks", + "name": "[parameters('vnetName')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('snetAddressPrefix')]" + ] + }, + "subnets": [{ + "name": "[parameters('snetName')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix')]" + } + } + ] + }, + "condition": "[equals(parameters('vnetNewOrExisting'),'new')]" + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex())]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "nsip", + "properties": { + "primary": true, + "subnet": { + "id": "[variables('snetRef')]" + }, + "privateIPAllocationMethod": "Dynamic", + "publicIpAddress": { + "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix')))]" + } + } + }, { + "name": "vip", + "properties": { + "subnet": { + "id": "[variables('snetRef')]" + }, + "privateIPAllocationMethod": "Dynamic", + "loadBalancerBackendAddressPools": [{ + "id": "[variables('bePoolId')]" + } + ] + } + }, { + "name": "snip", + "properties": { + "subnet": { + "id": "[variables('snetRef')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex()))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/publicIpAddresses/', variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex())]", + "[concat('Microsoft.Network/loadBalancers/', variables('lbN'))]" + ] + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[variables('alb-pipN')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "ipcopy", + "count": 2 + }, + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex())]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + }, { + "name": "autoscale-daemon", + "properties": { + "priority": 1001, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "9001", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + } + ] +} diff --git a/templates/HA_pair/HA_2nic/mainTemplate.json b/templates/HA_pair/HA_2nic/mainTemplate.json new file mode 100644 index 0000000..fcc67ef --- /dev/null +++ b/templates/HA_pair/HA_2nic/mainTemplate.json @@ -0,0 +1,460 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "12.1.0.0", + "parameters": { + "adminUsername": { + "defaultValue": "nsroot", + "type": "String", + "metadata": { + "description": "Username for the Virtual Machines." + } + }, + "adminPassword": { + "type": "SecureString", + "metadata": { + "description": "Password for the Virtual Machines." + } + }, + "vmSize": { + "defaultValue": "Standard_DS3_v2", + "type": "String", + "allowedValues": [ + "Standard_DS3_v2", + "Standard_DS4_v2" + ], + "metadata": { + "description": "Size of Azure Virtual Machine." + } + }, + "vmSku": { + "defaultValue": "netscalerbyol", + "type": "String", + "allowedValues": [ + "netscalerbyol", + "netscaler10standard", + "netscaler10enterprise", + "netscaler10platinum", + "netscaler200standard", + "netscaler200enterprise", + "netscaler200platinum", + "netscaler1000standard", + "netscaler1000enterprise", + "netscaler1000platinum", + "netscaler3000standard", + "netscaler3000enterprise", + "netscaler3000platinum" + ], + "metadata": { + "description": "SKU of NetScaler Image." + } + }, + "vnetName": { + "defaultValue": "vnet01", + "type": "String", + "metadata": { + "description": "Name of Virtual Network" + } + }, + "vnetResourceGroup": { + "defaultValue": "", + "type": "String", + "metadata": { + "description": "Resource Group name of existing Virtual Network. Leave empty if Resource Group is same as current deployment." + } + }, + "vnetNewOrExisting": { + "defaultValue": "new", + "allowedValues": [ + "new", + "existing" + ], + "type": "String" + }, + "snetName-11": { + "defaultValue": "subnet_client", + "type": "String", + "metadata": { + "description": "Name of Management/Client Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-12": { + "defaultValue": "subnet_server", + "type": "String", + "metadata": { + "description": "Name of Server Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetAddressPrefix-11": { + "defaultValue": "10.11.1.0/24", + "type": "String", + "metadata": { + "description": "Value of Management/Client side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-12": { + "defaultValue": "10.11.2.0/24", + "type": "String", + "metadata": { + "description": "Value of Server Side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "baseUrl": { + "defaultValue": "https://github.com/citrix/netscaler-azure-templates", + "type": "String", + "metadata": { + "artifactsBaseUrl": "", + "description": "The base URL for dependent assets" + } + } + }, + "variables": { + "vmN": "ns-vpx", + "nicN": "ns-vpx-nic", + "nsgN": "ns-vpx-nic-nsg", + "lbN": "alb", + "bePoolN": "bepool-11", + "probeN": "probe-11", + "ipConfN": "ipconf-11", + "avsN": "avl-set", + "alb-pipN": "alb-publicip", + "mgmt-pipN-suffix": "-mgmt-publicip", + "saN": "[concat('vpxha', uniqueString(resourceGroup().id))]", + "vnetRg": "[if(equals(parameters('vnetResourceGroup'), ''), resourceGroup().name,parameters('vnetResourceGroup'))]", + "vnetId": "[resourceId(variables('vnetRg'), 'Microsoft.Network/virtualNetworks', parameters('vnetName'))]", + "snetRef-11": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-11'))]", + "snetRef-12": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-12'))]", + "lbId": "[resourceId( 'Microsoft.Network/loadBalancers', variables('lbN'))]", + "bePoolId": "[concat(variables('lbId'),'/backendAddressPools/', variables('bePoolN'))]", + "probeId": "[concat(variables('lbId'),'/probes/', variables('probeN'))]", + "ipConfId": "[concat(variables('lbId'),'/frontendIpConfigurations/', variables('ipConfN'))]" + }, + "resources": [{ + "type": "Microsoft.Network/loadBalancers", + "name": "[variables('lbN')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "frontendIPConfigurations": [{ + "name": "[variables('ipConfN')]", + "properties": { + "publicIPAddress": { + "id": "[resourceId( 'Microsoft.Network/publicIpAddresses', variables('alb-pipN'))]" + } + } + } + ], + "backendAddressPools": [{ + "name": "[variables('bePoolN')]" + } + ], + "probes": [{ + "name": "[variables('probeN')]", + "properties": { + "protocol": "tcp", + "port": 9000, + "intervalInSeconds": 5, + "numberOfProbes": 2 + } + } + ], + "loadBalancingRules": [{ + "name": "lbRule1", + "properties": { + "frontendIPConfiguration": { + "id": "[variables('ipConfId')]" + }, + "frontendPort": 80, + "backendPort": 80, + "enableFloatingIP": true, + "idleTimeoutInMinutes": 4, + "protocol": "Tcp", + "loadDistribution": "Default", + "backendAddressPool": { + "id": "[variables('bePoolId')]" + }, + "probe": { + "id": "[variables('probeId')]" + } + } + } + ] + }, + "dependsOn": [ + "[concat('Microsoft.Network/publicIpAddresses/', variables('alb-pipN'))]" + ] + }, { + "type": "Microsoft.Compute/availabilitySets", + "name": "[variables('avsN')]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "properties": { + "platformFaultDomainCount": "3", + "platformUpdateDomainCount": "20" + } + }, { + "type": "Microsoft.Compute/virtualMachines", + "name": "[concat(variables('vmN'), copyIndex())]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "vmcopy", + "count": 2 + }, + "plan": { + "name": "[parameters('vmSku')]", + "publisher": "citrix", + "product": "netscalervpx-121" + }, + "properties": { + "osProfile": { + "computerName": "[concat(variables('vmN'), copyIndex())]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]", + "customData": "[base64(concat('{\"username\":\"', parameters('adminUsername'), '\",\"ha_config\":{\"peer_node\":\"', reference(concat(variables('nicN'), sub(1, copyIndex()), '-11')).ipConfigurations[0].properties.privateIPAddress ,'\"},\"vpx_config\":{\"snip_11\":\"', reference(concat(variables('nicN'), copyIndex(), '-11')).ipConfigurations[1].properties.privateIPAddress ,'\",\"pvt_ip_12\":\"', reference(concat(variables('nicN'), copyIndex(), '-12')).ipConfigurations[0].properties.privateIPAddress ,'\",\"subnet_11\":\"', reference(variables('snetRef-11'), '2017-10-01', 'Full').properties.addressPrefix ,'\",\"subnet_12\":\"', reference(variables('snetRef-12'), '2017-10-01', 'Full').properties.addressPrefix, '\"}}'))]" + }, + "hardwareProfile": { + "vmSize": "[parameters('vmSize')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "citrix", + "offer": "netscalervpx-121", + "sku": "[parameters('vmSku')]", + "version": "latest" + }, + "osDisk": { + "createOption": "fromImage", + "vhd": { + "uri": "[concat(reference(variables('saN'), '2017-10-01').primaryEndpoints.blob, 'vhds/osdisk', copyIndex(), '.vhd')]" + }, + "name": "[concat(variables('vmN'), copyIndex())]" + }, + "dataDisks": [] + }, + "networkProfile": { + "networkInterfaces": [{ + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-11'))]", + "properties": { + "primary": true + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-12'))]", + "properties": { + "primary": false + } + } + ] + }, + "availabilitySet": { + "id": "[resourceId('Microsoft.Compute/availabilitySets', variables('avsN'))]" + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId( 'Microsoft.Storage/storageAccounts', variables('saN')), '2017-10-01').primaryEndpoints['blob']]" + } + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-11')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()), '-11')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-12')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()), '-12')]", + "[concat('Microsoft.Compute/availabilitySets/', variables('avsN'))]", + "[concat('Microsoft.Storage/storageAccounts/', variables('saN'))]" + ] + }, { + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('saN')]", + "apiVersion": "2017-10-01", + "kind": "Storage", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard_LRS" + }, + "properties": {} + }, { + "type": "Microsoft.Network/virtualNetworks", + "name": "[parameters('vnetName')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('snetAddressPrefix-11')]", + "[parameters('snetAddressPrefix-12')]" + ] + }, + "subnets": [{ + "name": "[parameters('snetName-11')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-11')]" + } + }, { + "name": "[parameters('snetName-12')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-12')]" + } + } + ] + }, + "condition": "[equals(parameters('vnetNewOrExisting'),'new')]" + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-11", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "nsip", + "properties": { + "primary": true, + "subnet": { + "id": "[variables('snetRef-11')]" + }, + "privateIPAllocationMethod": "Dynamic", + "publicIpAddress": { + "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix')))]" + } + } + }, { + "name": "vip", + "properties": { + "subnet": { + "id": "[variables('snetRef-11')]" + }, + "privateIPAllocationMethod": "Dynamic", + "loadBalancerBackendAddressPools": [{ + "id": "[variables('bePoolId')]" + } + ] + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-11'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/publicIpAddresses/', variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-11')]", + "[concat('Microsoft.Network/loadBalancers/', variables('lbN'))]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-12", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "snip", + "properties": { + "subnet": { + "id": "[variables('snetRef-12')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-12'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-12')]" + ] + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[variables('alb-pipN')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "ipcopy", + "count": 2 + }, + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-11", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + }, { + "name": "autoscale-daemon", + "properties": { + "priority": 1001, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "9001", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-12", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + } + ] +} diff --git a/templates/HA_pair/HA_3nic/mainTemplate.json b/templates/HA_pair/HA_3nic/mainTemplate.json new file mode 100644 index 0000000..fb58e3e --- /dev/null +++ b/templates/HA_pair/HA_3nic/mainTemplate.json @@ -0,0 +1,532 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "12.1.0.0", + "parameters": { + "adminUsername": { + "defaultValue": "nsroot", + "type": "String", + "metadata": { + "description": "Username for the Virtual Machines." + } + }, + "adminPassword": { + "type": "SecureString", + "metadata": { + "description": "Password for the Virtual Machines." + } + }, + "vmSize": { + "defaultValue": "Standard_DS3_v2", + "type": "String", + "allowedValues": [ + "Standard_DS3_v2", + "Standard_DS4_v2" + ], + "metadata": { + "description": "Size of Azure Virtual Machine." + } + }, + "vmSku": { + "defaultValue": "netscalerbyol", + "type": "String", + "allowedValues": ["netscalerbyol", + "netscaler10standard", + "netscaler10enterprise", + "netscaler10platinum", + "netscaler200standard", + "netscaler200enterprise", + "netscaler200platinum", + "netscaler1000standard", + "netscaler1000enterprise", + "netscaler1000platinum", + "netscaler3000standard", + "netscaler3000enterprise", + "netscaler3000platinum" + ], + + "metadata": { + "description": "SKU of NetScaler Image." + } + }, + "vnetName": { + "defaultValue": "vnet01", + "type": "String", + "metadata": { + "description": "Name of Virtual Network" + } + }, + "vnetResourceGroup": { + "defaultValue": "", + "type": "String", + "metadata": { + "description": "Resource Group name of existing Virtual Network. Leave empty if Resource Group is same as current deployment." + } + }, + "vnetNewOrExisting": { + "defaultValue": "new", + "allowedValues": [ + "new", + "existing" + ], + "type": "String" + }, + "snetName-01": { + "defaultValue": "subnet_mgmt", + "type": "String", + "metadata": { + "description": "Name of Management Subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-11": { + "defaultValue": "subnet_client", + "type": "String", + "metadata": { + "description": "Name of Client Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-12": { + "defaultValue": "subnet_server", + "type": "String", + "metadata": { + "description": "Name of Server Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetAddressPrefix-01": { + "defaultValue": "10.11.0.0/24", + "type": "String", + "metadata": { + "description": "Value of Management subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-11": { + "defaultValue": "10.11.1.0/24", + "type": "String", + "metadata": { + "description": "Value of Client side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-12": { + "defaultValue": "10.11.2.0/24", + "type": "String", + "metadata": { + "description": "Value of Server Side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "baseUrl": { + "defaultValue": "https://github.com/citrix/netscaler-azure-templates", + "type": "String", + "metadata": { + "artifactsBaseUrl": "", + "description": "The base URL for dependent assets" + } + } + }, + "variables": { + "vmN": "ns-vpx", + "nicN": "ns-vpx-nic", + "nsgN": "ns-vpx-nic-nsg", + "lbN": "alb", + "bePoolN": "bepool-11", + "probeN": "probe-11", + "ipConfN": "ipconf-11", + "avsN": "avl-set", + "alb-pipN": "alb-publicip", + "mgmt-pipN-suffix": "-mgmt-publicip", + "saN": "[concat('vpxha', uniqueString(resourceGroup().id))]", + "vnetRg": "[if(equals(parameters('vnetResourceGroup'), ''), resourceGroup().name,parameters('vnetResourceGroup'))]", + "vnetId": "[resourceId(variables('vnetRg'), 'Microsoft.Network/virtualNetworks', parameters('vnetName'))]", + "snetRef-01": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-01'))]", + "snetRef-11": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-11'))]", + "snetRef-12": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-12'))]", + "lbId": "[resourceId( 'Microsoft.Network/loadBalancers', variables('lbN'))]", + "bePoolId": "[concat(variables('lbId'),'/backendAddressPools/', variables('bePoolN'))]", + "probeId": "[concat(variables('lbId'),'/probes/', variables('probeN'))]", + "ipConfId": "[concat(variables('lbId'),'/frontendIpConfigurations/', variables('ipConfN'))]" + }, + "resources": [{ + "type": "Microsoft.Network/loadBalancers", + "name": "[variables('lbN')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "frontendIPConfigurations": [{ + "name": "[variables('ipConfN')]", + "properties": { + "publicIPAddress": { + "id": "[resourceId( 'Microsoft.Network/publicIpAddresses', variables('alb-pipN'))]" + } + } + } + ], + "backendAddressPools": [{ + "name": "[variables('bePoolN')]" + } + ], + "probes": [{ + "name": "[variables('probeN')]", + "properties": { + "protocol": "tcp", + "port": 9000, + "intervalInSeconds": 5, + "numberOfProbes": 2 + } + } + ], + "loadBalancingRules": [{ + "name": "lbRule1", + "properties": { + "frontendIPConfiguration": { + "id": "[variables('ipConfId')]" + }, + "frontendPort": 80, + "backendPort": 80, + "enableFloatingIP": true, + "idleTimeoutInMinutes": 4, + "protocol": "Tcp", + "loadDistribution": "Default", + "backendAddressPool": { + "id": "[variables('bePoolId')]" + }, + "probe": { + "id": "[variables('probeId')]" + } + } + } + ] + }, + "dependsOn": [ + "[concat('Microsoft.Network/publicIpAddresses/', variables('alb-pipN'))]" + ] + }, { + "type": "Microsoft.Compute/availabilitySets", + "name": "[variables('avsN')]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "properties": { + "platformFaultDomainCount": "3", + "platformUpdateDomainCount": "20" + } + }, { + "type": "Microsoft.Compute/virtualMachines", + "name": "[concat(variables('vmN'), copyIndex())]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "vmcopy", + "count": 2 + }, + "plan": { + "name": "[parameters('vmSku')]", + "publisher": "citrix", + "product": "netscalervpx-121" + }, + "properties": { + "osProfile": { + "computerName": "[concat(variables('vmN'), copyIndex())]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]", + "customData": "[base64(concat('{\"username\":\"', parameters('adminUsername'), '\",\"ha_config\":{\"peer_node\":\"', reference(concat(variables('nicN'), sub(1, copyIndex()), '-01')).ipConfigurations[0].properties.privateIPAddress ,'\"},\"vpx_config\":{\"snip_11\":\"', reference(concat(variables('nicN'), copyIndex(), '-11')).ipConfigurations[0].properties.privateIPAddress ,'\",\"pvt_ip_12\":\"', reference(concat(variables('nicN'), copyIndex(), '-12')).ipConfigurations[0].properties.privateIPAddress ,'\",\"subnet_11\":\"', reference(variables('snetRef-11'), '2017-10-01', 'Full').properties.addressPrefix ,'\",\"subnet_12\":\"', reference(variables('snetRef-12'), '2017-10-01', 'Full').properties.addressPrefix, '\"}}'))]" + }, + "hardwareProfile": { + "vmSize": "[parameters('vmSize')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "citrix", + "offer": "netscalervpx-121", + "sku": "[parameters('vmSku')]", + "version": "latest" + }, + "osDisk": { + "createOption": "fromImage", + "vhd": { + "uri": "[concat(reference(variables('saN'), '2017-10-01').primaryEndpoints.blob, 'vhds/osdisk', copyIndex(), '.vhd')]" + }, + "name": "[concat(variables('vmN'), copyIndex())]" + }, + "dataDisks": [] + }, + "networkProfile": { + "networkInterfaces": [{ + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-01'))]", + "properties": { + "primary": true + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-11'))]", + "properties": { + "primary": false + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-12'))]", + "properties": { + "primary": false + } + } + ] + }, + "availabilitySet": { + "id": "[resourceId('Microsoft.Compute/availabilitySets', variables('avsN'))]" + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId( 'Microsoft.Storage/storageAccounts', variables('saN')), '2017-10-01').primaryEndpoints['blob']]" + } + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-01')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()), '-01')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-11')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()), '-11')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-12')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()), '-12')]", + "[concat('Microsoft.Compute/availabilitySets/', variables('avsN'))]", + "[concat('Microsoft.Storage/storageAccounts/', variables('saN'))]" + ] + }, { + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('saN')]", + "apiVersion": "2017-10-01", + "kind": "Storage", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard_LRS" + }, + "properties": {} + }, { + "type": "Microsoft.Network/virtualNetworks", + "name": "[parameters('vnetName')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('snetAddressPrefix-01')]", + "[parameters('snetAddressPrefix-11')]", + "[parameters('snetAddressPrefix-12')]" + ] + }, + "subnets": [{ + "name": "[parameters('snetName-01')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-01')]" + } + }, { + "name": "[parameters('snetName-11')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-11')]" + } + }, { + "name": "[parameters('snetName-12')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-12')]" + } + } + ] + }, + "condition": "[equals(parameters('vnetNewOrExisting'),'new')]" + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-01')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-01", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-01')]" + }, + "privateIPAllocationMethod": "Dynamic", + "publicIpAddress": { + "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix')))]" + } + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-01'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/publicIpAddresses/', variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-01')]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-11", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-11')]" + }, + "privateIPAllocationMethod": "Dynamic", + "loadBalancerBackendAddressPools": [{ + "id": "[variables('bePoolId')]" + } + ] + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-11'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-11')]", + "[concat('Microsoft.Network/loadBalancers/', variables('lbN'))]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-12", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-12')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-12'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-12')]" + ] + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[variables('alb-pipN')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "ipcopy", + "count": 2 + }, + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-01')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-01", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + }, { + "name": "autoscale-daemon", + "properties": { + "priority": 1001, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "9001", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-11", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-12", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + } + ] +} diff --git a/templates/HA_pair/HA_3nic_backendAutoscale/mainTemplate.json b/templates/HA_pair/HA_3nic_backendAutoscale/mainTemplate.json new file mode 100644 index 0000000..f88eb97 --- /dev/null +++ b/templates/HA_pair/HA_3nic_backendAutoscale/mainTemplate.json @@ -0,0 +1,545 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "12.1.0.0", + "parameters": { + "adminUsername": { + "defaultValue": "nsroot", + "type": "String", + "metadata": { + "description": "Username for the Virtual Machines." + } + }, + "adminPassword": { + "type": "SecureString", + "metadata": { + "description": "Password for the Virtual Machines." + } + }, + "vmSize": { + "defaultValue": "Standard_DS3_v2", + "type": "String", + "allowedValues": [ + "Standard_DS3_v2", + "Standard_DS4_v2" + ], + "metadata": { + "description": "Size of Azure Virtual Machine." + } + }, + "vmSku": { + "defaultValue": "netscalerbyol", + "type": "String", + "allowedValues": ["netscalerbyol", + "netscaler10standard", + "netscaler10enterprise", + "netscaler10platinum", + "netscaler200standard", + "netscaler200enterprise", + "netscaler200platinum", + "netscaler1000standard", + "netscaler1000enterprise", + "netscaler1000platinum", + "netscaler3000standard", + "netscaler3000enterprise", + "netscaler3000platinum" + ], + + "metadata": { + "description": "SKU of NetScaler Image." + } + }, + "vnetName": { + "defaultValue": "vnet01", + "type": "String", + "metadata": { + "description": "Name of Virtual Network" + } + }, + "vnetResourceGroup": { + "defaultValue": "", + "type": "String", + "metadata": { + "description": "Resource Group name of existing Virtual Network. Leave empty if Resource Group is same as current deployment." + } + }, + "vnetNewOrExisting": { + "defaultValue": "new", + "allowedValues": [ + "new", + "existing" + ], + "type": "String" + }, + "snetName-01": { + "defaultValue": "subnet_mgmt", + "type": "String", + "metadata": { + "description": "Name of Management Subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-11": { + "defaultValue": "subnet_client", + "type": "String", + "metadata": { + "description": "Name of Client Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-12": { + "defaultValue": "subnet_server", + "type": "String", + "metadata": { + "description": "Name of Server Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetAddressPrefix-01": { + "defaultValue": "10.11.0.0/24", + "type": "String", + "metadata": { + "description": "Value of Management subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-11": { + "defaultValue": "10.11.1.0/24", + "type": "String", + "metadata": { + "description": "Value of Client side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-12": { + "defaultValue": "10.11.2.0/24", + "type": "String", + "metadata": { + "description": "Value of Server Side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "applicationID": { + "type": "String", + "metadata": { + "description": "Application Id of registered App in Azure Active Directory" + } + }, + "ApplicationSecretKey": { + "type": "SecureString", + "metadata": { + "description": "API Access Key/Password Value of registed App in Azure Active Directory" + } + }, + "baseUrl": { + "defaultValue": "https://github.com/citrix/netscaler-azure-templates", + "type": "String", + "metadata": { + "artifactsBaseUrl": "", + "description": "The base URL for dependent assets" + } + } + }, + "variables": { + "vmN": "ns-vpx", + "nicN": "ns-vpx-nic", + "nsgN": "ns-vpx-nic-nsg", + "lbN": "alb", + "bePoolN": "bepool-11", + "probeN": "probe-11", + "ipConfN": "ipconf-11", + "avsN": "avl-set", + "alb-pipN": "alb-publicip", + "mgmt-pipN-suffix": "-mgmt-publicip", + "saN": "[concat('vpxha', uniqueString(resourceGroup().id))]", + "tenantID": "[subscription().tenantId]", + "vnetRg": "[if(equals(parameters('vnetResourceGroup'), ''), resourceGroup().name,parameters('vnetResourceGroup'))]", + "vnetId": "[resourceId(variables('vnetRg'), 'Microsoft.Network/virtualNetworks', parameters('vnetName'))]", + "snetRef-01": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-01'))]", + "snetRef-11": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-11'))]", + "snetRef-12": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-12'))]", + "lbId": "[resourceId( 'Microsoft.Network/loadBalancers', variables('lbN'))]", + "bePoolId": "[concat(variables('lbId'),'/backendAddressPools/', variables('bePoolN'))]", + "probeId": "[concat(variables('lbId'),'/probes/', variables('probeN'))]", + "ipConfId": "[concat(variables('lbId'),'/frontendIpConfigurations/', variables('ipConfN'))]" + }, + "resources": [{ + "type": "Microsoft.Network/loadBalancers", + "name": "[variables('lbN')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "frontendIPConfigurations": [{ + "name": "[variables('ipConfN')]", + "properties": { + "publicIPAddress": { + "id": "[resourceId( 'Microsoft.Network/publicIpAddresses', variables('alb-pipN'))]" + } + } + } + ], + "backendAddressPools": [{ + "name": "[variables('bePoolN')]" + } + ], + "probes": [{ + "name": "[variables('probeN')]", + "properties": { + "protocol": "tcp", + "port": 9000, + "intervalInSeconds": 5, + "numberOfProbes": 2 + } + } + ], + "loadBalancingRules": [{ + "name": "lbRule1", + "properties": { + "frontendIPConfiguration": { + "id": "[variables('ipConfId')]" + }, + "frontendPort": 80, + "backendPort": 80, + "enableFloatingIP": true, + "idleTimeoutInMinutes": 4, + "protocol": "Tcp", + "loadDistribution": "Default", + "backendAddressPool": { + "id": "[variables('bePoolId')]" + }, + "probe": { + "id": "[variables('probeId')]" + } + } + } + ] + }, + "dependsOn": [ + "[concat('Microsoft.Network/publicIpAddresses/', variables('alb-pipN'))]" + ] + }, { + "type": "Microsoft.Compute/availabilitySets", + "name": "[variables('avsN')]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "properties": { + "platformFaultDomainCount": "3", + "platformUpdateDomainCount": "20" + } + }, { + "type": "Microsoft.Compute/virtualMachines", + "name": "[concat(variables('vmN'), copyIndex())]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "vmcopy", + "count": 2 + }, + "plan": { + "name": "[parameters('vmSku')]", + "publisher": "citrix", + "product": "netscalervpx-121" + }, + "properties": { + "osProfile": { + "computerName": "[concat(variables('vmN'), copyIndex())]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]", + "customData": "[base64(concat('{\"username\":\"', parameters('adminUsername'), '\",\"ha_config\":{\"peer_node\":\"', reference(concat(variables('nicN'), sub(1, copyIndex()), '-01')).ipConfigurations[0].properties.privateIPAddress ,'\"},\"azure_app_config\":{\"tenant_id\":\"', variables('tenantID') ,'\",\"app_id\":\"', parameters('applicationID') ,'\",\"secret_key\":\"', parameters('ApplicationSecretKey') ,'\"},\"vpx_config\":{\"snip_11\":\"', reference(concat(variables('nicN'), copyIndex(), '-11')).ipConfigurations[0].properties.privateIPAddress ,'\",\"pvt_ip_12\":\"', reference(concat(variables('nicN'), copyIndex(), '-12')).ipConfigurations[0].properties.privateIPAddress ,'\",\"subnet_11\":\"', reference(variables('snetRef-11'), '2017-10-01', 'Full').properties.addressPrefix ,'\",\"subnet_12\":\"', reference(variables('snetRef-12'), '2017-10-01', 'Full').properties.addressPrefix, '\"}}'))]" + }, + "hardwareProfile": { + "vmSize": "[parameters('vmSize')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "citrix", + "offer": "netscalervpx-121", + "sku": "[parameters('vmSku')]", + "version": "latest" + }, + "osDisk": { + "createOption": "fromImage", + "vhd": { + "uri": "[concat(reference(variables('saN'), '2017-10-01').primaryEndpoints.blob, 'vhds/osdisk', copyIndex(), '.vhd')]" + }, + "name": "[concat(variables('vmN'), copyIndex())]" + }, + "dataDisks": [] + }, + "networkProfile": { + "networkInterfaces": [{ + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-01'))]", + "properties": { + "primary": true + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-11'))]", + "properties": { + "primary": false + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-12'))]", + "properties": { + "primary": false + } + } + ] + }, + "availabilitySet": { + "id": "[resourceId('Microsoft.Compute/availabilitySets', variables('avsN'))]" + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId( 'Microsoft.Storage/storageAccounts', variables('saN')), '2017-10-01').primaryEndpoints['blob']]" + } + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-01')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()), '-01')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-11')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()), '-11')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-12')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), sub(1,copyIndex()), '-12')]", + "[concat('Microsoft.Compute/availabilitySets/', variables('avsN'))]", + "[concat('Microsoft.Storage/storageAccounts/', variables('saN'))]" + ] + }, { + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('saN')]", + "apiVersion": "2017-10-01", + "kind": "Storage", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard_LRS" + }, + "properties": {} + }, { + "type": "Microsoft.Network/virtualNetworks", + "name": "[parameters('vnetName')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('snetAddressPrefix-01')]", + "[parameters('snetAddressPrefix-11')]", + "[parameters('snetAddressPrefix-12')]" + ] + }, + "subnets": [{ + "name": "[parameters('snetName-01')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-01')]" + } + }, { + "name": "[parameters('snetName-11')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-11')]" + } + }, { + "name": "[parameters('snetName-12')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-12')]" + } + } + ] + }, + "condition": "[equals(parameters('vnetNewOrExisting'),'new')]" + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-01')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-01", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-01')]" + }, + "privateIPAllocationMethod": "Dynamic", + "publicIpAddress": { + "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix')))]" + } + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-01'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/publicIpAddresses/', variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-01')]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-11", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-11')]" + }, + "privateIPAllocationMethod": "Dynamic", + "loadBalancerBackendAddressPools": [{ + "id": "[variables('bePoolId')]" + } + ] + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-11'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-11')]", + "[concat('Microsoft.Network/loadBalancers/', variables('lbN'))]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-12", + "count": 2 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-12')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-12'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-12')]" + ] + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[variables('alb-pipN')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "ipcopy", + "count": 2 + }, + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-01')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-01", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + }, { + "name": "autoscale-daemon", + "properties": { + "priority": 1001, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "9001", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-11", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-12", + "count": 2 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + } + ] +} diff --git a/templates/HA_pair/README.md b/templates/HA_pair/README.md new file mode 100644 index 0000000..ca12366 --- /dev/null +++ b/templates/HA_pair/README.md @@ -0,0 +1,37 @@ +## NetScaler VPX High Availability(HA) Pair +You can deploy a pair of NetScaler virtual appliances with single/multiple NIC(s) in an active-passive high availability (HA) setup on Azure. Each NIC can contain multiple IP addresses. + +An active-passive deployment requires: +- An HA Independent Network Configuration (INC) configuration +- The Azure Load Balancer (ALB) in Direct Server Return (DSR) mode + +All traffic goes through the primary node. The secondary node remains in standby mode until the primary node fails. +NetScaler VPX Express is a free virtual application delivery controller (normal hourly Azure Virtual Machine rates apply). This Azure custom template deployment can be used for light production loads, testing and prototyping needs. + +### Azure Custom Template description +Citrix NetScaler High Availability (HA) Azure Resource Manager (ARM) templates are designed to ensure easy and consistent way of deploying NetScaler pair in Active-Passive mode. This template increases reliability and system availability with built in redundancy. This ARM template supports Bring Your Own License (BYOL) or Hourly based selection. Choice of selection is offered during template deployment. + +### Network architecture +For understanding architecture or manual deployment steps, refer +- [Configuring an HA Setup with Multiple IP Addresses and NICs](https://docs.citrix.com/en-us/netscaler/12-1/deploying-vpx/deploy-vpx-on-azure/configure-vpx-pair-ha-inc.html) +- [Configuring an HA Setup with a Single IP Address and a Single NIC](https://docs.citrix.com/en-us/netscaler/12-1/deploying-vpx/deploy-vpx-on-azure/configure-vpx-ha-mode-arm.html) +- [Add Azure autoscale settings](https://docs.citrix.com/en-us/netscaler/12-1/deploying-vpx/deploy-vpx-on-azure/Autoscale.html) + +### Quick Launch Link +--- +#### NetScaler High Availability(HA) Pair - 3 NICs +[![Create NetScaler High Availability(HA) Pair - 3 NICs](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcitrix%2Fnetscaler-azure-templates%2Fmaster%2Ftemplates%2FHA_pair%2FHA_3nic%2FmainTemplate.json) + +--- +#### NetScaler High Availability(HA) Pair with autoscale - 3 NICs +[![Create NetScaler High Availability(HA) Pair with autoscale - 3 NICs](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcitrix%2Fnetscaler-azure-templates%2Fmaster%2Ftemplates%2FHA_pair%2FHA_3nic_backendAutoscale%2FmainTemplate.json) + +--- +#### NetScaler High Availability(HA) Pair - 2 NICs +[![Create NetScaler High Availability(HA) Pair - 2 NICs](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcitrix%2Fnetscaler-azure-templates%2Fmaster%2Ftemplates%2FHA_pair%2FHA_2nic%2FmainTemplate.json) + +--- +#### NetScaler High Availability(HA) Pair - 1 NIC +[![Create NetScaler High Availability(HA) Pair - 1 NIC](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcitrix%2Fnetscaler-azure-templates%2Fmaster%2Ftemplates%2FHA_pair%2FHA_1nic%2FmainTemplate.json) + +--- diff --git a/templates/README.md b/templates/README.md new file mode 100644 index 0000000..a18e0d3 --- /dev/null +++ b/templates/README.md @@ -0,0 +1,4 @@ +## Links +#### [NetScaler VPX Express](./express_single_nic/) +#### [Standalone NetScaler VPX Templates](./standalone/) +#### [NetScaler High Availability(HA) Pair Templates](./HA_pair/) \ No newline at end of file diff --git a/templates/express_single_nic/README.md b/templates/express_single_nic/README.md index 628d7ed..58c27c8 100644 --- a/templates/express_single_nic/README.md +++ b/templates/express_single_nic/README.md @@ -6,15 +6,8 @@ NetScaler VPX Express is a free virtual application delivery controller (normal This template creates an instance of the VPX Express from the VPX Express SKU image utilising a single subnet within provided virtual network. This template also utilizes a custom script that initializes the VPX instance. Initial configuration performed by the custom script includes network interface configuration, VIP configuration and feature configuration. Further configuration can be performed by logging in to the GUI or via SSH. ## Network architecture -The Azure custom template deploys the VPX in a single-NIC mode. The standard NetScaler IP addresses: NSIP (management IP), VIP (where load balanced applications are accessed) and SNIP (the IP used to send traffic to backend instances) are all provisioned on the single NIC and are drawn from the (RFC1918) address space of the provided virtual network's subnet. The (RFC1918) NSIP is mapped to the Public IP of the VPX Instance and the RFC1918 VIP is mapped to another public IP. +The Azure custom template deploys the VPX in a single-NIC mode. The standard NetScaler IP addresses: NSIP (management IP), VIP (where load balanced applications are accessed) and SNIP (the IP used to send traffic to back-end instances) are all provisioned on the single NIC and are drawn from the (RFC1918) address space of the provided virtual network's subnet. The (RFC1918) NSIP is mapped to the Public IP of the VPX Instance and the RFC1918 VIP is mapped to another public IP. ## Quick Launch Link [![Create NetScaler VPX Express](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcitrix%2Fnetscaler-azure-templates%2Fmaster%2Ftemplates%2Fexpress_single_nic%2FmainTemplate.json) - - -## Additional Links: - -- VPX installation in Azure : https://docs.citrix.com/en-us/netscaler/12/deploying-vpx/deploy-vpx-on-azure.html -- NetScaler 12.0 Documentation : https://docs.citrix.com/en-us/netscaler/12.html -- NetScaler Overview : https://www.citrix.com/products/netscaler-adc/resources/netscaler-vpx.html \ No newline at end of file diff --git a/templates/express_single_nic/mainTemplate.json b/templates/express_single_nic/mainTemplate.json index 2357ec5..def76dc 100644 --- a/templates/express_single_nic/mainTemplate.json +++ b/templates/express_single_nic/mainTemplate.json @@ -1,333 +1,312 @@ -{ - "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "virtualMachineName": { - "defaultValue": "NetScaler-VPX-Express", - "type": "string", - "metadata": { - "description": "Name of the Virtual Machine." - } - }, - "virtualMachineSize": { - "defaultValue": "Standard_DS3_v2", - "type": "String", - "allowedValues": [ - "Standard_DS3_v2" - ], - "metadata": { - "description": "Size of Azure Virtual Machine." - } - }, - "adminUsername": { - "defaultValue": "nsroot", - "type": "String", - "metadata": { - "description": "Admin user name for the Virtual Machine." - } - }, - "adminPassword": { - "type": "SecureString", - "metadata": { - "description": "Admin password for the Virtual Machine." - } - }, - "virtualNetworkName": { - "defaultValue": "vnet01", - "type": "String", - "metadata": { - "description": "Name of Virtual Network" - } - }, - "vnetResourceGroup": { - "defaultValue": "", - "type": "String", - "metadata": { - "description": "Resource Group name of existing Virtual Network. Leave empty if Resource Group is same as current deployment." - } - }, - "vnetNewOrExisting": { - "defaultValue": "new", - "allowedValues": [ - "new", - "existing" - ], - "type": "String" - }, - "networkInterfaceName": { - "defaultValue": "NetScaler-VPX-Express-Nic", - "type": "string", - "metadata": { - "description": "Name of the Virtual Network Interface Card." - } - }, - "networkSecurityGroupName": { - "defaultValue": "NetScaler-VPX-Express-nsg", - "type": "string", - "metadata": { - "description": "Name of the Network Security Group." - } - }, - "diagnosticsStorageAccountName": { - "defaultValue": "", - "type": "string", - "metadata": { - "description": "Name of the diagnostics Storage Account. If left empty, an auto-generated name will be used." - } - }, - "addressPrefix": { - "defaultValue": "10.11.0.0/24", - "type": "String", - "metadata": { - "description": "Value of virtual network's Address range in CIDR form. Ignore this field if opting for existing Virtual Network." - } - }, - "subnetName": { - "defaultValue": "default_subnet", - "type": "string", - "metadata": { - "description": "Name of subnet. ensure subnet exists in case of existing Virtual Network." - } - }, - "subnetPrefix": { - "defaultValue": "10.11.0.0/24", - "type": "String", - "metadata": { - "description": "Value of default subnet address range in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." - } - }, - "baseUrl": { - "defaultValue": "https://github.com/citrix/netscaler-azure-templates", - "type": "String", - "metadata": { - "artifactsBaseUrl": "", - "description": "The base URL for dependent assets" - } - } - }, - "variables": { - "vnetRg": "[if(equals(parameters('vnetResourceGroup'), ''), resourceGroup().name,parameters('vnetResourceGroup'))]", - "vnetId": "[resourceId(variables('vnetRG'),'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", - "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]", - "nicId": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]", - "diagnosticsStorageAccountName": "[if(equals(parameters('diagnosticsStorageAccountName'), ''), concat('vpxstracct', uniqueString(resourceGroup().id)), parameters('diagnosticsStorageAccountName'))]" - }, - "resources": [{ - "type": "Microsoft.Compute/virtualMachines/extensions", - "name": "[concat(parameters('virtualMachineName'),'/', 'vpx-express')]", - "apiVersion": "2017-12-01", - "location": "[resourceGroup().location]", - "dependsOn": [ - "[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]" - ], - "properties": { - "publisher": "Microsoft.OSTCExtensions", - "type": "CustomScriptForLinux", - "typeHandlerVersion": "1.5", - "autoUpgradeMinorVersion": true, - "settings": { - "fileUris": ["https://nsmpscript.blob.core.windows.net/custom-script/express/custom_script.py"], - "enableInternalDNSCheck": "false" - }, - "protectedSettings": { - "commandToExecute": "[concat('/var/python/bin/python custom_script.py ', parameters('adminPassword'))]" - } - } - }, { - "name": "[parameters('virtualMachineName')]", - "type": "Microsoft.Compute/virtualMachines", - "apiVersion": "2017-12-01", - "location": "[resourceGroup().location]", - "dependsOn": [ - "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]", - "[concat('Microsoft.Network/publicIpAddresses/', parameters('virtualMachineName'), '-nsip')]", - "[concat('Microsoft.Storage/storageAccounts/', variables('diagnosticsStorageAccountName'))]" - ], - "properties": { - "osProfile": { - "computerName": "[parameters('virtualMachineName')]", - "adminUsername": "[parameters('adminUsername')]", - "adminPassword": "[parameters('adminPassword')]", - "customData": "[base64(concat('config=express;username=', parameters('adminUsername') ))]" - }, - "hardwareProfile": { - "vmSize": "[parameters('virtualMachineSize')]" - }, - "storageProfile": { - "imageReference": { - "publisher": "citrix", - "offer": "netscalervpx-120", - "sku": "netscalervpxexpress", - "version": "latest" - }, - "osDisk": { - "createOption": "fromImage", - "managedDisk": { - "storageAccountType": "Standard_LRS" - } - }, - "dataDisks": [] - }, - "networkProfile": { - "networkInterfaces": [{ - "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]" - } - ] - }, - "diagnosticsProfile": { - "bootDiagnostics": { - "enabled": true, - "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts', variables('diagnosticsStorageAccountName')), '2017-10-01').primaryEndpoints['blob']]" - } - } - }, - "plan": { - "name": "netscalervpxexpress", - "publisher": "citrix", - "product": "netscalervpx-120" - } - }, { - "name": "[variables('diagnosticsStorageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2017-10-01", - "kind": "Storage", - "location": "[resourceGroup().location]", - "sku": { - "name": "Standard_LRS" - }, - "properties": {} - }, { - "name": "[parameters('virtualNetworkName')]", - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2017-10-01", - "location": "[resourceGroup().location]", - "properties": { - "addressSpace": { - "addressPrefixes": [ - "[parameters('addressPrefix')]" - ] - }, - "subnets": [{ - "name": "[parameters('subnetName')]", - "properties": { - "addressPrefix": "[parameters('subnetPrefix')]" - } - } - ] - }, - "condition": "[equals(parameters('vnetNewOrExisting'),'new')]" - }, { - "name": "[parameters('networkInterfaceName')]", - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2017-10-01", - "location": "[resourceGroup().location]", - "dependsOn": [ - "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]", - "[concat('Microsoft.Network/publicIpAddresses/', parameters('virtualMachineName'), '-vip')]", - "[concat('Microsoft.Network/publicIpAddresses/', parameters('virtualMachineName'), '-nsip')]", - "[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]" - ], - "properties": { - "ipConfigurations": [{ - "name": "nsip", - "properties": { - "primary": true, - "subnet": { - "id": "[variables('subnetRef')]" - }, - "privateIPAllocationMethod": "Dynamic", - "publicIpAddress": { - "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(parameters('virtualMachineName'), '-nsip'))]" - } - } - }, { - "name": "vip", - "properties": { - "subnet": { - "id": "[variables('subnetRef')]" - }, - "privateIPAllocationMethod": "Dynamic", - "publicIpAddress": { - "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(parameters('virtualMachineName'), '-vip'))]" - } - } - }, { - "name": "snip", - "properties": { - "subnet": { - "id": "[variables('subnetRef')]" - }, - "privateIPAllocationMethod": "Dynamic" - } - } - ], - "networkSecurityGroup": { - "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]" - } - } - }, { - "name": "[concat(parameters('virtualMachineName'), '-vip')]", - "type": "Microsoft.Network/publicIpAddresses", - "apiVersion": "2017-10-01", - "location": "[resourceGroup().location]", - "properties": { - "publicIpAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, { - "name": "[concat(parameters('virtualMachineName'), '-nsip')]", - "type": "Microsoft.Network/publicIpAddresses", - "apiVersion": "2017-10-01", - "location": "[resourceGroup().location]", - "properties": { - "publicIpAllocationMethod": "Dynamic" - }, - "sku": { - "name": "Basic" - } - }, { - "name": "[parameters('networkSecurityGroupName')]", - "type": "Microsoft.Network/networkSecurityGroups", - "apiVersion": "2017-10-01", - "location": "[resourceGroup().location]", - "properties": { - "securityRules": [{ - "name": "ssh-rule", - "properties": { - "description": "Allow remote SSH", - "priority": 1000, - "protocol": "TCP", - "access": "Allow", - "direction": "Inbound", - "sourceAddressPrefix": "Internet", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "destinationPortRange": "22" - } - }, { - "name": "web-rule", - "properties": { - "description": "Allow Secure WEB", - "priority": 1001, - "protocol": "Tcp", - "access": "Allow", - "direction": "Inbound", - "sourceAddressPrefix": "Internet", - "sourcePortRange": "*", - "destinationAddressPrefix": "*", - "destinationPortRange": "443" - } - } - ] - } - } - ], - "outputs": { - "adminUsername": { - "type": "string", - "value": "[parameters('adminUsername')]" - } - } -} +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "12.1.0.0", + "parameters": { + "virtualMachineName": { + "defaultValue": "NetScaler-VPX-Express", + "type": "string", + "metadata": { + "description": "Name of the Virtual Machine." + } + }, + "virtualMachineSize": { + "defaultValue": "Standard_A2", + "type": "String", + "allowedValues": [ + "Standard_A2" + ], + "metadata": { + "description": "Size of Azure Virtual Machine." + } + }, + "adminUsername": { + "defaultValue": "nsroot", + "type": "String", + "metadata": { + "description": "Admin user name for the Virtual Machine." + } + }, + "adminPassword": { + "type": "SecureString", + "metadata": { + "description": "Admin password for the Virtual Machine." + } + }, + "virtualNetworkName": { + "defaultValue": "vnet01", + "type": "String", + "metadata": { + "description": "Name of Virtual Network" + } + }, + "vnetResourceGroup": { + "defaultValue": "", + "type": "String", + "metadata": { + "description": "Resource Group name of existing Virtual Network. Leave empty if Resource Group is same as current deployment." + } + }, + "vnetNewOrExisting": { + "defaultValue": "new", + "allowedValues": [ + "new", + "existing" + ], + "type": "String" + }, + "networkInterfaceName": { + "defaultValue": "NetScaler-VPX-Express-Nic", + "type": "string", + "metadata": { + "description": "Name of the Virtual Network Interface Card." + } + }, + "networkSecurityGroupName": { + "defaultValue": "NetScaler-VPX-Express-nsg", + "type": "string", + "metadata": { + "description": "Name of the Network Security Group." + } + }, + "diagnosticsStorageAccountName": { + "defaultValue": "", + "type": "string", + "metadata": { + "description": "Name of the diagnostics Storage Account. If left empty, an auto-generated name will be used." + } + }, + "addressPrefix": { + "defaultValue": "10.11.0.0/24", + "type": "String", + "metadata": { + "description": "Value of virtual network's Address range in CIDR form. Ignore this field if opting for existing Virtual Network." + } + }, + "subnetName": { + "defaultValue": "default_subnet", + "type": "string", + "metadata": { + "description": "Name of subnet. ensure subnet exists in case of existing Virtual Network." + } + }, + "subnetPrefix": { + "defaultValue": "10.11.0.0/24", + "type": "String", + "metadata": { + "description": "Value of default subnet address range in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "baseUrl": { + "defaultValue": "https://github.com/citrix/netscaler-azure-templates", + "type": "String", + "metadata": { + "artifactsBaseUrl": "", + "description": "The base URL for dependent assets" + } + } + }, + "variables": { + "vnetRg": "[if(equals(parameters('vnetResourceGroup'), ''), resourceGroup().name,parameters('vnetResourceGroup'))]", + "vnetId": "[resourceId(variables('vnetRG'),'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", + "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]", + "nicId": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]", + "diagnosticsStorageAccountName": "[if(equals(parameters('diagnosticsStorageAccountName'), ''), concat('vpxstracct', uniqueString(resourceGroup().id)), parameters('diagnosticsStorageAccountName'))]" + }, + "resources": [{ + "name": "[parameters('virtualMachineName')]", + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]", + "[concat('Microsoft.Network/publicIpAddresses/', parameters('virtualMachineName'), '-nsip')]", + "[concat('Microsoft.Storage/storageAccounts/', variables('diagnosticsStorageAccountName'))]" + ], + "properties": { + "osProfile": { + "computerName": "[parameters('virtualMachineName')]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]", + "customData": "[base64(concat( '{ \"username\": \"', parameters('adminUsername'), '\", \"vpx_config\": { \"pvt_ip_11\": \"', reference(variables('nicId')).ipConfigurations[1].properties.privateIPAddress ,'\", \"pvt_ip_12\": \"', reference(variables('nicId')).ipConfigurations[2].properties.privateIPAddress ,'\",\"subnet_11\": \"', reference(variables('subnetRef'), '2017-10-01', 'Full').properties.addressPrefix ,'\", \"subnet_12\": \"', reference(variables('subnetRef'), '2017-10-01', 'Full').properties.addressPrefix, '\", \"ns_features\": [\"LB\", \"CS\", \"SSL\", \"WL\"] }}' ))]" + }, + "hardwareProfile": { + "vmSize": "[parameters('virtualMachineSize')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "citrix", + "offer": "netscalervpx-121", + "sku": "netscalervpxexpress", + "version": "latest" + }, + "osDisk": { + "createOption": "fromImage", + "managedDisk": { + "storageAccountType": "Standard_LRS" + } + }, + "dataDisks": [] + }, + "networkProfile": { + "networkInterfaces": [{ + "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]" + } + ] + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts', variables('diagnosticsStorageAccountName')), '2017-10-01').primaryEndpoints['blob']]" + } + } + }, + "plan": { + "name": "netscalervpxexpress", + "publisher": "citrix", + "product": "netscalervpx-121" + } + }, { + "name": "[variables('diagnosticsStorageAccountName')]", + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2017-10-01", + "kind": "Storage", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard_LRS" + }, + "properties": {} + }, { + "name": "[parameters('virtualNetworkName')]", + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('addressPrefix')]" + ] + }, + "subnets": [{ + "name": "[parameters('subnetName')]", + "properties": { + "addressPrefix": "[parameters('subnetPrefix')]" + } + } + ] + }, + "condition": "[equals(parameters('vnetNewOrExisting'),'new')]" + }, { + "name": "[parameters('networkInterfaceName')]", + "type": "Microsoft.Network/networkInterfaces", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]", + "[concat('Microsoft.Network/publicIpAddresses/', parameters('virtualMachineName'), '-vip')]", + "[concat('Microsoft.Network/publicIpAddresses/', parameters('virtualMachineName'), '-nsip')]", + "[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]" + ], + "properties": { + "ipConfigurations": [{ + "name": "nsip", + "properties": { + "primary": true, + "subnet": { + "id": "[variables('subnetRef')]" + }, + "privateIPAllocationMethod": "Dynamic", + "publicIpAddress": { + "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(parameters('virtualMachineName'), '-nsip'))]" + } + } + }, { + "name": "vip", + "properties": { + "subnet": { + "id": "[variables('subnetRef')]" + }, + "privateIPAllocationMethod": "Dynamic", + "publicIpAddress": { + "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(parameters('virtualMachineName'), '-vip'))]" + } + } + }, { + "name": "snip", + "properties": { + "subnet": { + "id": "[variables('subnetRef')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]" + } + } + }, { + "name": "[concat(parameters('virtualMachineName'), '-vip')]", + "type": "Microsoft.Network/publicIpAddresses", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "publicIpAllocationMethod": "Dynamic" + }, + "sku": { + "name": "Basic" + } + }, { + "name": "[concat(parameters('virtualMachineName'), '-nsip')]", + "type": "Microsoft.Network/publicIpAddresses", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "publicIpAllocationMethod": "Dynamic" + }, + "sku": { + "name": "Basic" + } + }, { + "name": "[parameters('networkSecurityGroupName')]", + "type": "Microsoft.Network/networkSecurityGroups", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "securityRules": [{ + "name": "ssh-rule", + "properties": { + "description": "Allow remote SSH", + "priority": 1000, + "protocol": "TCP", + "access": "Allow", + "direction": "Inbound", + "sourceAddressPrefix": "Internet", + "sourcePortRange": "*", + "destinationAddressPrefix": "*", + "destinationPortRange": "22" + } + }, { + "name": "web-rule", + "properties": { + "description": "Allow Secure WEB", + "priority": 1001, + "protocol": "Tcp", + "access": "Allow", + "direction": "Inbound", + "sourceAddressPrefix": "Internet", + "sourcePortRange": "*", + "destinationAddressPrefix": "*", + "destinationPortRange": "443" + } + } + ] + } + } + ], + "outputs": { + "adminUsername": { + "type": "string", + "value": "[parameters('adminUsername')]" + } + } +} diff --git a/templates/standalone/README.md b/templates/standalone/README.md new file mode 100644 index 0000000..d33ee80 --- /dev/null +++ b/templates/standalone/README.md @@ -0,0 +1,21 @@ +## Standalone NetScaler VPX +A single NetScaler VPX instance can be provisioned in Azure Resource Manager (ARM) portal in a standalone mode by creating the virtual machine and configuring other resources. + +For understanding architecture or manual deployment steps, refer +- [Configuring a Standalone NetScaler Instance in ARM](https://docs.citrix.com/en-us/netscaler/12-1/deploying-vpx/deploy-vpx-on-azure/configure-vpx-standalone-arm.html) +- [Configuring Multiple IP Addresses for a Standalone NetScaler Instance](https://docs.citrix.com/en-us/netscaler/12-1/deploying-vpx/deploy-vpx-on-azure/configuring-multiple-ips-for-vpx-using-azure-resource-manager.html) + +### Quick Launch Link +--- +#### NetScaler VPX Express +Refer [templates/express_single_nic](../express_single_nic) + +--- +#### Standalone NetScaler VPX - 3 NICs +[![Standalone NetScaler VPX - 3 NICs ](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcitrix%2Fnetscaler-azure-templates%2Fmaster%2Ftemplates%2Fstandalone%2FVPX_3nic%2FmainTemplate.json) + +--- +#### Standalone NetScaler VPX with autoscale - 3 NICs +[![Standalone NetScaler VPX with autoscale - 3 NICs](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcitrix%2Fnetscaler-azure-templates%2Fmaster%2Ftemplates%2Fstandalone%2FVPX_3nic_backendAutoscale%2FmainTemplate.json) + +--- \ No newline at end of file diff --git a/templates/standalone/VPX_3nic/mainTemplate.json b/templates/standalone/VPX_3nic/mainTemplate.json new file mode 100644 index 0000000..2c998e5 --- /dev/null +++ b/templates/standalone/VPX_3nic/mainTemplate.json @@ -0,0 +1,439 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "adminUsername": { + "defaultValue": "nsroot", + "type": "String", + "metadata": { + "description": "Username for the Virtual Machines." + } + }, + "adminPassword": { + "type": "SecureString", + "metadata": { + "description": "Password for the Virtual Machines." + } + }, + "vmSize": { + "defaultValue": "Standard_DS3_v2", + "type": "String", + "allowedValues": [ + "Standard_DS3_v2", + "Standard_DS4_v2" + ], + "metadata": { + "description": "Size of Azure Virtual Machine." + } + }, + "vmSku": { + "defaultValue": "netscalerbyol", + "type": "String", + "allowedValues": ["netscalerbyol", + "netscaler10standard", + "netscaler10enterprise", + "netscaler10platinum", + "netscaler200standard", + "netscaler200enterprise", + "netscaler200platinum", + "netscaler1000standard", + "netscaler1000enterprise", + "netscaler1000platinum", + "netscaler3000standard", + "netscaler3000enterprise", + "netscaler3000platinum" + ], + + "metadata": { + "description": "SKU of NetScaler Image." + } + }, + "vnetName": { + "defaultValue": "vnet01", + "type": "String", + "metadata": { + "description": "Name of Virtual Network" + } + }, + "vnetResourceGroup": { + "defaultValue": "", + "type": "String", + "metadata": { + "description": "Resource Group name of existing Virtual Network. Leave empty if Resource Group is same as current deployment." + } + }, + "vnetNewOrExisting": { + "defaultValue": "new", + "allowedValues": [ + "new", + "existing" + ], + "type": "String" + }, + "snetName-01": { + "defaultValue": "subnet_mgmt", + "type": "String", + "metadata": { + "description": "Name of Management Subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-11": { + "defaultValue": "subnet_client", + "type": "String", + "metadata": { + "description": "Name of Client Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-12": { + "defaultValue": "subnet_server", + "type": "String", + "metadata": { + "description": "Name of Server Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetAddressPrefix-01": { + "defaultValue": "10.11.0.0/24", + "type": "String", + "metadata": { + "description": "Value of Management subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-11": { + "defaultValue": "10.11.1.0/24", + "type": "String", + "metadata": { + "description": "Value of Client side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-12": { + "defaultValue": "10.11.2.0/24", + "type": "String", + "metadata": { + "description": "Value of Server Side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "baseUrl": { + "defaultValue": "https://github.com/citrix/netscaler-azure-templates", + "type": "String", + "metadata": { + "artifactsBaseUrl": "", + "description": "The base URL for dependent assets" + } + } + }, + "variables": { + "vmN": "ns-vpx", + "nicN": "ns-vpx-nic", + "nsgN": "ns-vpx-nic-nsg", + "mgmt-pipN-suffix": "-mgmt-publicip", + "saN": "[concat('vpxha', uniqueString(resourceGroup().id))]", + "vnetRg": "[if(equals(parameters('vnetResourceGroup'), ''), resourceGroup().name,parameters('vnetResourceGroup'))]", + "vnetId": "[resourceId(variables('vnetRg'), 'Microsoft.Network/virtualNetworks', parameters('vnetName'))]", + "snetRef-01": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-01'))]", + "snetRef-11": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-11'))]", + "snetRef-12": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-12'))]" + }, + "resources": [{ + "type": "Microsoft.Compute/virtualMachines", + "name": "[concat(variables('vmN'), copyIndex())]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "vmcopy", + "count": 1 + }, + "plan": { + "name": "[parameters('vmSku')]", + "publisher": "citrix", + "product": "netscalervpx-121" + }, + "properties": { + "osProfile": { + "computerName": "[concat(variables('vmN'), copyIndex())]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]", + "customData": "[base64(concat('{\"username\":\"', parameters('adminUsername'), '\",\"vpx_config\":{\"pvt_ip_11\":\"', reference(concat(variables('nicN'), copyIndex(), '-11')).ipConfigurations[0].properties.privateIPAddress ,'\",\"pvt_ip_12\":\"', reference(concat(variables('nicN'), copyIndex(), '-12')).ipConfigurations[0].properties.privateIPAddress ,'\",\"subnet_11\":\"', reference(variables('snetRef-11'), '2017-10-01', 'Full').properties.addressPrefix ,'\",\"subnet_12\":\"', reference(variables('snetRef-12'), '2017-10-01', 'Full').properties.addressPrefix, '\"}}'))]" + }, + "hardwareProfile": { + "vmSize": "[parameters('vmSize')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "citrix", + "offer": "netscalervpx-121", + "sku": "[parameters('vmSku')]", + "version": "latest" + }, + "osDisk": { + "createOption": "fromImage", + "vhd": { + "uri": "[concat(reference(variables('saN'), '2017-10-01').primaryEndpoints.blob, 'vhds/osdisk', copyIndex(), '.vhd')]" + }, + "name": "[concat(variables('vmN'), copyIndex())]" + }, + "dataDisks": [] + }, + "networkProfile": { + "networkInterfaces": [{ + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-01'))]", + "properties": { + "primary": true + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-11'))]", + "properties": { + "primary": false + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-12'))]", + "properties": { + "primary": false + } + } + ] + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId( 'Microsoft.Storage/storageAccounts', variables('saN')), '2017-10-01').primaryEndpoints['blob']]" + } + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-01')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-11')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-12')]", + "[concat('Microsoft.Storage/storageAccounts/', variables('saN'))]" + ] + }, { + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('saN')]", + "apiVersion": "2017-10-01", + "kind": "Storage", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard_LRS" + }, + "properties": {} + }, { + "type": "Microsoft.Network/virtualNetworks", + "name": "[parameters('vnetName')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('snetAddressPrefix-01')]", + "[parameters('snetAddressPrefix-11')]", + "[parameters('snetAddressPrefix-12')]" + ] + }, + "subnets": [{ + "name": "[parameters('snetName-01')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-01')]" + } + }, { + "name": "[parameters('snetName-11')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-11')]" + } + }, { + "name": "[parameters('snetName-12')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-12')]" + } + } + ] + }, + "condition": "[equals(parameters('vnetNewOrExisting'),'new')]" + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-01')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-01", + "count": 1 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-01')]" + }, + "privateIPAllocationMethod": "Dynamic", + "publicIpAddress": { + "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix')))]" + } + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-01'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/publicIpAddresses/', variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-01')]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-11", + "count": 1 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-11')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-11'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-11')]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-12", + "count": 1 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-12')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-12'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-12')]" + ] + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "ipcopy", + "count": 1 + }, + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-01')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-01", + "count": 1 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + }, { + "name": "autoscale-daemon", + "properties": { + "priority": 1001, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "9001", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-11", + "count": 1 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-12", + "count": 1 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + } + ] +} diff --git a/templates/standalone/VPX_3nic_backendAutoscale/mainTemplate.json b/templates/standalone/VPX_3nic_backendAutoscale/mainTemplate.json new file mode 100644 index 0000000..2ec1397 --- /dev/null +++ b/templates/standalone/VPX_3nic_backendAutoscale/mainTemplate.json @@ -0,0 +1,452 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "adminUsername": { + "defaultValue": "nsroot", + "type": "String", + "metadata": { + "description": "Username for the Virtual Machines." + } + }, + "adminPassword": { + "type": "SecureString", + "metadata": { + "description": "Password for the Virtual Machines." + } + }, + "vmSize": { + "defaultValue": "Standard_DS3_v2", + "type": "String", + "allowedValues": [ + "Standard_DS3_v2", + "Standard_DS4_v2" + ], + "metadata": { + "description": "Size of Azure Virtual Machine." + } + }, + "vmSku": { + "defaultValue": "netscalerbyol", + "type": "String", + "allowedValues": ["netscalerbyol", + "netscaler10standard", + "netscaler10enterprise", + "netscaler10platinum", + "netscaler200standard", + "netscaler200enterprise", + "netscaler200platinum", + "netscaler1000standard", + "netscaler1000enterprise", + "netscaler1000platinum", + "netscaler3000standard", + "netscaler3000enterprise", + "netscaler3000platinum" + ], + + "metadata": { + "description": "SKU of NetScaler Image." + } + }, + "vnetName": { + "defaultValue": "vnet01", + "type": "String", + "metadata": { + "description": "Name of Virtual Network" + } + }, + "vnetResourceGroup": { + "defaultValue": "", + "type": "String", + "metadata": { + "description": "Resource Group name of existing Virtual Network. Leave empty if Resource Group is same as current deployment." + } + }, + "vnetNewOrExisting": { + "defaultValue": "new", + "allowedValues": [ + "new", + "existing" + ], + "type": "String" + }, + "snetName-01": { + "defaultValue": "subnet_mgmt", + "type": "String", + "metadata": { + "description": "Name of Management Subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-11": { + "defaultValue": "subnet_client", + "type": "String", + "metadata": { + "description": "Name of Client Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetName-12": { + "defaultValue": "subnet_server", + "type": "String", + "metadata": { + "description": "Name of Server Side subnet. Enter existing subnet name if opting for existing Virtual Network" + } + }, + "snetAddressPrefix-01": { + "defaultValue": "10.11.0.0/24", + "type": "String", + "metadata": { + "description": "Value of Management subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-11": { + "defaultValue": "10.11.1.0/24", + "type": "String", + "metadata": { + "description": "Value of Client side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "snetAddressPrefix-12": { + "defaultValue": "10.11.2.0/24", + "type": "String", + "metadata": { + "description": "Value of Server Side subnet in CIDR form. Ignore this field if opting for existing Virtual Network, Address prefix will be picked from existing Subnet." + } + }, + "applicationID": { + "type": "String", + "metadata": { + "description": "Application Id of registered App in Azure Active Directory" + } + }, + "ApplicationSecretKey": { + "type": "SecureString", + "metadata": { + "description": "API Access Key/Password Value of registed App in Azure Active Directory" + } + }, + "baseUrl": { + "defaultValue": "https://github.com/citrix/netscaler-azure-templates", + "type": "String", + "metadata": { + "artifactsBaseUrl": "", + "description": "The base URL for dependent assets" + } + } + }, + "variables": { + "vmN": "ns-vpx", + "nicN": "ns-vpx-nic", + "nsgN": "ns-vpx-nic-nsg", + "mgmt-pipN-suffix": "-mgmt-publicip", + "saN": "[concat('vpxha', uniqueString(resourceGroup().id))]", + "tenantID": "[subscription().tenantId]", + "vnetRg": "[if(equals(parameters('vnetResourceGroup'), ''), resourceGroup().name,parameters('vnetResourceGroup'))]", + "vnetId": "[resourceId(variables('vnetRg'), 'Microsoft.Network/virtualNetworks', parameters('vnetName'))]", + "snetRef-01": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-01'))]", + "snetRef-11": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-11'))]", + "snetRef-12": "[concat(variables('vnetId'), '/subnets/', parameters('snetName-12'))]" + }, + "resources": [{ + "type": "Microsoft.Compute/virtualMachines", + "name": "[concat(variables('vmN'), copyIndex())]", + "apiVersion": "2017-12-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "vmcopy", + "count": 1 + }, + "plan": { + "name": "[parameters('vmSku')]", + "publisher": "citrix", + "product": "netscalervpx-121" + }, + "properties": { + "osProfile": { + "computerName": "[concat(variables('vmN'), copyIndex())]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]", + "customData": "[base64(concat('{\"username\":\"', parameters('adminUsername'), '\",\"azure_app_config\":{\"tenant_id\":\"', variables('tenantID') ,'\",\"app_id\":\"', parameters('applicationID') ,'\",\"secret_key\":\"', parameters('ApplicationSecretKey') ,'\"},\"vpx_config\":{\"pvt_ip_11\":\"', reference(concat(variables('nicN'), copyIndex(), '-11')).ipConfigurations[0].properties.privateIPAddress ,'\",\"pvt_ip_12\":\"', reference(concat(variables('nicN'), copyIndex(), '-12')).ipConfigurations[0].properties.privateIPAddress ,'\",\"subnet_11\":\"', reference(variables('snetRef-11'), '2017-10-01', 'Full').properties.addressPrefix ,'\",\"subnet_12\":\"', reference(variables('snetRef-12'), '2017-10-01', 'Full').properties.addressPrefix, '\"}}'))]" + }, + "hardwareProfile": { + "vmSize": "[parameters('vmSize')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "citrix", + "offer": "netscalervpx-121", + "sku": "[parameters('vmSku')]", + "version": "latest" + }, + "osDisk": { + "createOption": "fromImage", + "vhd": { + "uri": "[concat(reference(variables('saN'), '2017-10-01').primaryEndpoints.blob, 'vhds/osdisk', copyIndex(), '.vhd')]" + }, + "name": "[concat(variables('vmN'), copyIndex())]" + }, + "dataDisks": [] + }, + "networkProfile": { + "networkInterfaces": [{ + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-01'))]", + "properties": { + "primary": true + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-11'))]", + "properties": { + "primary": false + } + }, { + "id": "[resourceId( 'Microsoft.Network/networkInterfaces', concat(variables('nicN'), copyIndex(), '-12'))]", + "properties": { + "primary": false + } + } + ] + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true, + "storageUri": "[reference(resourceId( 'Microsoft.Storage/storageAccounts', variables('saN')), '2017-10-01').primaryEndpoints['blob']]" + } + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-01')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-11')]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicN'), copyIndex(), '-12')]", + "[concat('Microsoft.Storage/storageAccounts/', variables('saN'))]" + ] + }, { + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('saN')]", + "apiVersion": "2017-10-01", + "kind": "Storage", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard_LRS" + }, + "properties": {} + }, { + "type": "Microsoft.Network/virtualNetworks", + "name": "[parameters('vnetName')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('snetAddressPrefix-01')]", + "[parameters('snetAddressPrefix-11')]", + "[parameters('snetAddressPrefix-12')]" + ] + }, + "subnets": [{ + "name": "[parameters('snetName-01')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-01')]" + } + }, { + "name": "[parameters('snetName-11')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-11')]" + } + }, { + "name": "[parameters('snetName-12')]", + "properties": { + "addressPrefix": "[parameters('snetAddressPrefix-12')]" + } + } + ] + }, + "condition": "[equals(parameters('vnetNewOrExisting'),'new')]" + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-01')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-01", + "count": 1 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-01')]" + }, + "privateIPAllocationMethod": "Dynamic", + "publicIpAddress": { + "id": "[resourceId('Microsoft.Network/publicIpAddresses', concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix')))]" + } + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-01'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/publicIpAddresses/', variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-01')]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-11", + "count": 1 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-11')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-11'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-11')]" + ] + }, { + "type": "Microsoft.Network/networkInterfaces", + "name": "[concat(variables('nicN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "niccopy-12", + "count": 1 + }, + "properties": { + "ipConfigurations": [{ + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[variables('snetRef-12')]" + }, + "privateIPAllocationMethod": "Dynamic" + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId( 'Microsoft.Network/networkSecurityGroups', concat(variables('nsgN'), copyIndex(), '-12'))]" + } + }, + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]", + "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgN'), copyIndex(), '-12')]" + ] + }, { + "type": "Microsoft.Network/publicIpAddresses", + "name": "[concat(variables('vmN'), copyIndex(), variables('mgmt-pipN-suffix'))]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "ipcopy", + "count": 1 + }, + "properties": { + "publicIpAllocationMethod": "Dynamic" + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-01')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-01", + "count": 1 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + }, { + "name": "autoscale-daemon", + "properties": { + "priority": 1001, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "9001", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-11')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-11", + "count": 1 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + }, { + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[concat(variables('nsgN'), copyIndex(), '-12')]", + "apiVersion": "2017-10-01", + "location": "[resourceGroup().location]", + "copy": { + "name": "nsgcopy-12", + "count": 1 + }, + "properties": { + "securityRules": [{ + "name": "default-allow-ssh", + "properties": { + "priority": 1000, + "sourceAddressPrefix": "*", + "protocol": "TCP", + "destinationPortRange": "22", + "access": "Allow", + "direction": "Inbound", + "sourcePortRange": "*", + "destinationAddressPrefix": "*" + } + } + ] + } + } + ] +}