-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-vms.ps1
44 lines (35 loc) · 1.96 KB
/
create-vms.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$subscriptionId = ""
$region = "northcentralus"
Login-AzureRmAccount -SubscriptionId $subscriptionId
$currentDate = Get-Date -Format yyyyMMdd.HHmmss
$deploymentLabel = "vmimage-$currentDate"
$creds = Get-Credential -Message "Enter admin username and password for VM."
$params = @{
VMName = "vm-containers-2";
adminUserName = $creds.UserName;
adminPassword = $creds.Password;
dnsNameForPublicIP = "mcolliervm002";
vmSize = "Standard_DS3_v2"
}
$myTags = @{}
$myTags.Add("alias", "mcollier")
$myTags.Add("deleteAfter", "04/30/2017")
<# -- Create a Windows Server 2016 with Container support --#>
<#
$resourceGroupName = "mcollier-stirtrek"
New-AzureRmResourceGroup -Name $resourceGroupName -Location $region -Tag $myTags
# similar to https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/windows-server-container-tools/containers-azure-template/azuredeploy.json, except using Managed Disk.
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName `
-Name $deploymentLabel `
-TemplateUri "https://raw.githubusercontent.com/mcollier/Virtualization-Documentation/live/windows-server-container-tools/containers-azure-template/azuredeploy.json" `
-TemplateParameterObject $params `
-Verbose
#>
<# -- Create a Windows Server 2016 without default Container support --#>
$resourceGroupName = "mcollier-stirtrek-2"
New-AzureRmResourceGroup -Name $resourceGroupName -Location $region -Tag $myTags
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName `
-Name $deploymentLabel `
-TemplateFile "C:\Projects\ContainersForWindowsDevs\vm-windowsserver2016\azuredeploy.json" `
-TemplateParameterObject $params `
-Verbose