@@ -36,6 +36,7 @@ function Test-SimpleNewVmss
36
36
Assert-AreEqual $vmssname $x.ResourceGroupName ;
37
37
Assert-AreEqual $vmssname $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].Name;
38
38
Assert-AreEqual $vmssname $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].IpConfigurations[0 ].Name;
39
+ Assert-False { $x.VirtualMachineProfile.AdditionalCapabilities.UltraSSDEnabled };
39
40
Assert-AreEqual " Standard_DS1_v2" $x.Sku.Name
40
41
Assert-AreEqual $username $x.VirtualMachineProfile.OsProfile.AdminUsername
41
42
Assert-AreEqual " 2016-Datacenter" $x.VirtualMachineProfile.StorageProfile.ImageReference.Sku
@@ -55,6 +56,103 @@ function Test-SimpleNewVmss
55
56
}
56
57
}
57
58
59
+ <#
60
+ . SYNOPSIS
61
+ Test Simple Paremeter Set for New Vm
62
+ #>
63
+ function Test-SimpleNewVmssFromSIGImage
64
+ {
65
+ # This test needs to be run form the following subscription in record mode :
66
+ # 9e223dbe-3399-4e19-88eb-0975f02ac87f
67
+ # The vm needs to be created in the one of the following regions :
68
+ # "South Central US", "East US 2" and "Central US"
69
+ # To see more information on the steps to create a new SIG image go here: https://aka.ms/AA37jbt
70
+ # Setup
71
+ $vmssname = Get-ResourceName
72
+
73
+ try
74
+ {
75
+ $lbName = $vmssname + " LoadBalancer"
76
+ $username = " admin01"
77
+ $password = Get-PasswordForVM | ConvertTo-SecureString - AsPlainText - Force
78
+ $cred = new-object - typename System.Management.Automation.PSCredential - argumentlist $username , $password
79
+ [string ]$domainNameLabel = " $vmssname$vmssname " .tolower();
80
+
81
+ # Common
82
+ $x = New-AzureRmVmss - Name $vmssname - Credential $cred - DomainNameLabel $domainNameLabel - LoadBalancerName $lbName - Location " East US 2" - VmSize " Standard_D2s_v3" - ImageName " /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/SIGTestGroupoDoNotDelete/providers/Microsoft.Compute/galleries/SIGTestGalleryDoNotDelete/images/SIGTestImageWindowsDoNotDelete"
83
+
84
+ Assert-AreEqual $vmssname $x.Name ;
85
+ Assert-AreEqual $vmssname $x.ResourceGroupName ;
86
+ Assert-AreEqual $vmssname $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].Name;
87
+ Assert-AreEqual $vmssname $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].IpConfigurations[0 ].Name;
88
+ Assert-False { $x.VirtualMachineProfile.AdditionalCapabilities.UltraSSDEnabled };
89
+ Assert-AreEqual " Standard_D2s_v3" $x.Sku.Name
90
+ Assert-AreEqual $username $x.VirtualMachineProfile.OsProfile.AdminUsername
91
+ Assert-AreEqual " /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/SIGTestGroupoDoNotDelete/providers/Microsoft.Compute/galleries/SIGTestGalleryDoNotDelete/images/SIGTestImageWindowsDoNotDelete" $x.VirtualMachineProfile.StorageProfile.ImageReference.Id
92
+ Assert-Null $x.VirtualMachineProfile.StorageProfile.ImageReference.Sku
93
+ Assert-NotNull $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].IpConfigurations[0 ].LoadBalancerBackendAddressPools;
94
+ Assert-NotNull $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].IpConfigurations[0 ].Subnet
95
+ Assert-False { $x.SinglePlacementGroup }
96
+ Assert-Null $x.Identity
97
+
98
+ $lb = Get-AzureRmLoadBalancer - Name $lbName - ResourceGroupName $vmssname
99
+ Assert-NotNull $lb
100
+ Assert-AreEqual $lbName $lb.Name
101
+ }
102
+ finally
103
+ {
104
+ # Cleanup
105
+ Clean - ResourceGroup $vmssname
106
+ }
107
+ }
108
+
109
+ <#
110
+ . SYNOPSIS
111
+ Test Simple Paremeter Set for New Vm
112
+ #>
113
+ function Test-SimpleNewVmssWithUltraSSD
114
+ {
115
+ # Setup
116
+ $vmssname = Get-ResourceName
117
+
118
+ try
119
+ {
120
+ $lbName = $vmssname + " LoadBalancer"
121
+ $username = " admin01"
122
+ $password = Get-PasswordForVM | ConvertTo-SecureString - AsPlainText - Force
123
+ $cred = new-object - typename System.Management.Automation.PSCredential - argumentlist $username , $password
124
+ [string ]$domainNameLabel = " $vmssname$vmssname " .tolower();
125
+
126
+ # Common
127
+ # As of now the ultrasd feature is only supported in east us 2 and in the size Standard_D2s_v3, on the features GA the restriction will be lifted
128
+ # Use the follwing command to figure out the one to use
129
+ # Get-AzureRmComputeResourceSku | where {$_.ResourceType -eq "disks" -and $_.Name -eq "UltraSSD_LRS" }
130
+ $x = New-AzureRmVmss - Name $vmssname - Credential $cred - DomainNameLabel $domainNameLabel - LoadBalancerName $lbName - Location " east us 2" - EnableUltraSSD - Zone 3 - VmSize " Standard_D2s_v3"
131
+
132
+ Assert-AreEqual $vmssname $x.Name ;
133
+ Assert-AreEqual $vmssname $x.ResourceGroupName ;
134
+ Assert-AreEqual $vmssname $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].Name;
135
+ Assert-AreEqual $vmssname $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].IpConfigurations[0 ].Name;
136
+ Assert-True { $x.VirtualMachineProfile.AdditionalCapabilities.UltraSSDEnabled };
137
+ Assert-AreEqual " Standard_D2s_v3" $x.Sku.Name
138
+ Assert-AreEqual $username $x.VirtualMachineProfile.OsProfile.AdminUsername
139
+ Assert-AreEqual " 2016-Datacenter" $x.VirtualMachineProfile.StorageProfile.ImageReference.Sku
140
+ Assert-NotNull $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].IpConfigurations[0 ].LoadBalancerBackendAddressPools;
141
+ Assert-NotNull $x.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations [0 ].IpConfigurations[0 ].Subnet
142
+ Assert-False { $x.SinglePlacementGroup }
143
+ Assert-Null $x.Identity
144
+
145
+ $lb = Get-AzureRmLoadBalancer - Name $lbName - ResourceGroupName $vmssname
146
+ Assert-NotNull $lb
147
+ Assert-AreEqual $lbName $lb.Name
148
+ }
149
+ finally
150
+ {
151
+ # Cleanup
152
+ Clean - ResourceGroup $vmssname
153
+ }
154
+ }
155
+
58
156
<#
59
157
. SYNOPSIS
60
158
Test Simple Paremeter Set for New Vm failure when custom load balancer exists
0 commit comments