File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
src/Compute/Compute.Test/ScenarioTests Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,13 @@ public void TestSimpleNewVmssPpg()
110
110
TestRunner . RunTestScript ( "Test-SimpleNewVmssPpg" ) ;
111
111
}
112
112
113
+ [ Fact ]
114
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
115
+ public void TestSimpleNewVmssHostGroup ( )
116
+ {
117
+ TestRunner . RunTestScript ( "Test-SimpleNewVmssHostGroup" ) ;
118
+ }
119
+
113
120
[ Fact ]
114
121
[ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
115
122
public void TestSimpleNewVmssBilling ( )
Original file line number Diff line number Diff line change @@ -405,6 +405,47 @@ function Test-SimpleNewVmssPpg
405
405
}
406
406
}
407
407
408
+ <#
409
+ . SYNOPSIS
410
+ Test Simple Paremeter Set With HostGroup (automatic placement)
411
+ #>
412
+ function Test-SimpleNewVmssHostGroup
413
+ {
414
+ # Setup
415
+ $rgname = Get-ResourceName
416
+
417
+ try
418
+ {
419
+ $vmssname = " MyVmss"
420
+ $username = " admin01"
421
+ $password = Get-PasswordForVM | ConvertTo-SecureString - AsPlainText - Force
422
+ $cred = new-object - typename System.Management.Automation.PSCredential - argumentlist $username , $password
423
+
424
+ # Common
425
+ $loc = " EastUS2EUAP"
426
+ $rg = New-AzResourceGroup - Name $rgname - Location $loc
427
+
428
+ # Creating a host group
429
+ $hostGroupName = $rgname + ' hostgroup'
430
+ New-AzHostGroup - ResourceGroupName $rgname - Name $hostGroupName - Location $loc - PlatformFaultDomain 1 - Zone " 1" - Tag @ {key1 = " val1" };
431
+
432
+ $hostGroup = Get-AzHostGroup - ResourceGroupName $rgname - Name $hostGroupName ;
433
+
434
+ # Creating a host for the hostgroup
435
+ $hostName = $rgname + ' host'
436
+ New-AzHost - ResourceGroupName $rgname - HostGroupName $hostGroupName - Name $hostName - Location $loc - Sku " ESv3-Type1" - Tag @ {key1 = " val2" };
437
+
438
+ $vmss = New-AzVmss - Name $vmssname - ResourceGroup $rgname - Credential $cred - HostGroupId $hostGroup.Id
439
+
440
+ Assert-AreEqual $vmss.HostGroupId $hostGroup.Id
441
+ }
442
+ finally
443
+ {
444
+ # Cleanup
445
+ Clean - ResourceGroup $rgname
446
+ }
447
+ }
448
+
408
449
<#
409
450
. SYNOPSIS
410
451
Test Simple Paremeter Set for New Vmss with eviction policy, priority, and max price.
You can’t perform that action at this time.
0 commit comments