From 509c3d564ebbebd50d086312e6a2e1dfc899cdee Mon Sep 17 00:00:00 2001 From: Guy Bowerman Date: Wed, 26 Jul 2017 11:49:23 -0700 Subject: [PATCH] Add template to create a Windows scale set in existing VNet --- 201-vmss-win-existing-vnet/README.md | 21 ++++ 201-vmss-win-existing-vnet/azuredeploy.json | 111 ++++++++++++++++++ .../azuredeploy.parameters.json | 27 +++++ 201-vmss-win-existing-vnet/metadata.json | 7 ++ 4 files changed, 166 insertions(+) create mode 100644 201-vmss-win-existing-vnet/README.md create mode 100644 201-vmss-win-existing-vnet/azuredeploy.json create mode 100644 201-vmss-win-existing-vnet/azuredeploy.parameters.json create mode 100644 201-vmss-win-existing-vnet/metadata.json diff --git a/201-vmss-win-existing-vnet/README.md b/201-vmss-win-existing-vnet/README.md new file mode 100644 index 000000000000..eded48fd2097 --- /dev/null +++ b/201-vmss-win-existing-vnet/README.md @@ -0,0 +1,21 @@ +# Deploy a VM Scale Set into an existing vnet and subnet + + + + + + + + +This template deploys a Windows 2016-Datacenter based VM Scale Set into an existing resource group, vnet and subnet. + +This is a bare-bones scale set deployment into an existing subnet that does not create any additional resources. To connect to the VMs in this scale set, look at the private IP addresses of the scale set VMs, and connect from existing resources in the VNet. If you need to connect to these VMs externally, your existing VNet will need a load balancer/gateway or jumpbox resource to connect into. + +PARAMETER RESTRICTIONS +====================== + +vmssName must be 3-61 characters in length. It should also be unique across the VNet. + +instanceCount must be 100 or less. + +Do not deploy this scale set into a new resource group - it will only work in an existing resource group which contains a VNet and subnet. diff --git a/201-vmss-win-existing-vnet/azuredeploy.json b/201-vmss-win-existing-vnet/azuredeploy.json new file mode 100644 index 000000000000..3cda593da642 --- /dev/null +++ b/201-vmss-win-existing-vnet/azuredeploy.json @@ -0,0 +1,111 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", + "contentVersion": "1.0.0.0", + "parameters": { + "vmSku": { + "type": "string", + "defaultValue": "Standard_D1_v2", + "metadata": { + "description": "Size of VMs in the VM Scale Set." + } + }, + "vmssName": { + "type": "string", + "metadata": { + "description": "Unique name for the scale set. Must be 3-61 characters in length and unique across the VNet." + }, + "maxLength": 61 + }, + "instanceCount": { + "type": "int", + "metadata": { + "description": "Number of VM instances (100 or less)." + }, + "defaultValue": 2, + "maxValue": 100 + }, + "adminUsername": { + "type": "string", + "metadata": { + "description": "Admin username on all VMs." + } + }, + "adminPassword": { + "type": "securestring", + "metadata": { + "description": "Admin password on all VMs." + } + }, + "existingVnetName": { + "type": "string", + "metadata": { + "description": "vName of the existing virtual network to deploy the scale set into." + } + }, + "existingSubnetName": { + "type": "string", + "metadata": { + "description": "Name of the existing subnet to deploy the scale set into." + } + } + }, + "variables": { + }, + "resources": [ + { + "type": "Microsoft.Compute/virtualMachineScaleSets", + "name": "[parameters('vmssName')]", + "location": "[resourceGroup().location]", + "apiVersion": "2017-03-30", + "sku": { + "name": "[parameters('vmSku')]", + "capacity": "[parameters('instanceCount')]" + }, + "properties": { + "overprovision": "false", + "upgradePolicy": { + "mode": "Manual" + }, + "virtualMachineProfile": { + "storageProfile": { + "osDisk": { + "createOption": "FromImage", + "caching": "ReadWrite" + }, + "imageReference": { + "publisher": "MicrosoftWindowsServer", + "offer": "WindowsServer", + "sku": "2016-Datacenter", + "version": "latest" + } + }, + "osProfile": { + "computerNamePrefix": "[parameters('vmssName')]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]" + }, + "networkProfile": { + "networkInterfaceConfigurations": [ + { + "name": "nic", + "properties": { + "primary": true, + "ipConfigurations": [ + { + "name": "ipconfig", + "properties": { + "subnet": { + "id": "[resourceId(resourceGroup().name, 'Microsoft.Network/virtualNetworks/subnets', parameters('existingVnetName'), parameters('existingSubNetName'))]" + } + } + } + ] + } + } + ] + } + } + } + } + ] +} \ No newline at end of file diff --git a/201-vmss-win-existing-vnet/azuredeploy.parameters.json b/201-vmss-win-existing-vnet/azuredeploy.parameters.json new file mode 100644 index 000000000000..ea2919ebd9bc --- /dev/null +++ b/201-vmss-win-existing-vnet/azuredeploy.parameters.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "vmSku": { + "value": "Standard_D1_v2" + }, + "vmssName": { + "value": "GEN-UNIQUE" + }, + "instanceCount": { + "value": 2 + }, + "adminUsername": { + "value": "azureuser" + }, + "adminPassword": { + "value": "GEN-PASSWORD" + }, + "existingVnetName": { + "value": "vnet" + }, + "existingSubnetName": { + "value": "subnet" + } + } +} diff --git a/201-vmss-win-existing-vnet/metadata.json b/201-vmss-win-existing-vnet/metadata.json new file mode 100644 index 000000000000..78f7852efd7a --- /dev/null +++ b/201-vmss-win-existing-vnet/metadata.json @@ -0,0 +1,7 @@ +{ + "itemDisplayName": "Deploy a Scale Set into an existing vnet", + "description": "This template deploys a Windows 2016 Datacenter VM Scale Set into an exsisting resource group, vnet and subnet.", + "summary": "This template deploys a VM Scale Set into an exsisting vnet.", + "githubUsername": "gbowerman", + "dateUpdated": "2017-07-26" +}