Skip to content

Commit b7bfe17

Browse files
Add hyperscale elastic pool read scale (#17744)
* Added support for HS EP read scale units * Added tests for update and create EP with replica count * Fixed bug in updating replica count for HS EP * Added aditional tests for HS EP read scale * Added help files for add and set elastic pool cmlets * Added session recordings for HS EP tests * Updated ChangeLog.md with changes information * Fixed default read scale value from 1 to null as in standalone * Updated Session Records from tests Co-authored-by: Christian Valencia <[email protected]>
1 parent b4bf76a commit b7bfe17

14 files changed

+7308
-15
lines changed

src/Sql/Sql.Test/ScenarioTests/ElasticPoolCrudTests.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ public void TestElasticPoolCreateWithMaintenanceConfigurationId()
6666
RunPowerShellTest("Test-CreateElasticPoolWithMaintenanceConfigurationId");
6767
}
6868

69+
[Fact]
70+
[Trait(Category.AcceptanceType, Category.CheckIn)]
71+
public void TestHyperscaleElasticPoolCreate()
72+
{
73+
RunPowerShellTest("Test-CreateHyperscaleElasticPool");
74+
}
75+
76+
[Fact]
77+
[Trait(Category.AcceptanceType, Category.CheckIn)]
78+
public void TestHyperscaleElasticPoolCreateWithReplica()
79+
{
80+
RunPowerShellTest("Test-CreateHyperscaleElasticPoolWithReplica");
81+
}
82+
6983
[Fact]
7084
[Trait(Category.AcceptanceType, Category.CheckIn)]
7185
public void TestElasticPoolUpdate()
@@ -101,6 +115,20 @@ public void TestElasticPoolUpdateWithMaintenanceConfigurationId()
101115
RunPowerShellTest("Test-UpdateElasticPoolWithMaintenanceConfigurationId");
102116
}
103117

118+
[Fact]
119+
[Trait(Category.AcceptanceType, Category.CheckIn)]
120+
public void TestHyperscaleElasticPoolUpdateReplicaCount()
121+
{
122+
RunPowerShellTest("Test-UpdateHyperscaleElasticPoolReplicaCount");
123+
}
124+
125+
[Fact]
126+
[Trait(Category.AcceptanceType, Category.CheckIn)]
127+
public void TestMoveDatabaseOutHyperscaleElasticPool()
128+
{
129+
RunPowerShellTest("Test-MoveDatabaseOutHyperscaleElasticPool");
130+
}
131+
104132
[Fact]
105133
[Trait(Category.AcceptanceType, Category.CheckIn)]
106134
public void TestElasticPoolGet()
@@ -122,6 +150,13 @@ public void TestElasticPoolGetWithMaintenanceConfigurationId()
122150
RunPowerShellTest("Test-GetElasticPoolWithMaintenanceConfigurationId");
123151
}
124152

153+
[Fact]
154+
[Trait(Category.AcceptanceType, Category.CheckIn)]
155+
public void TestHyperscaleElasticPoolGet()
156+
{
157+
RunPowerShellTest("Test-GetHyperscaleElasticPool");
158+
}
159+
125160
[Fact]
126161
[Trait(Category.AcceptanceType, Category.CheckIn)]
127162
public void TestElasticPoolRemove()

src/Sql/Sql.Test/ScenarioTests/ElasticPoolCrudTests.ps1

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,67 @@ function Test-CreateElasticPoolWithMaintenanceConfigurationId
217217
}
218218
}
219219

220+
<#
221+
.SYNOPSIS
222+
Tests creating a Hyperscale elastic pool
223+
#>
224+
function Test-CreateHyperscaleElasticPool
225+
{
226+
# Setup
227+
$location = "north europe"
228+
$rg = "PowershellTestsNE"
229+
$server = "hs-ep-powershelltests"
230+
231+
try
232+
{
233+
## Create Hyperscale pool with 2 high availability replicas
234+
$poolName = Get-ElasticPoolName
235+
$job = New-AzSqlElasticPool -ServerName $server -ResourceGroupName $rg `
236+
-ElasticPoolName $poolName -VCore 4 -Edition Hyperscale -ComputeGeneration Gen5 -AsJob
237+
$job | Wait-Job
238+
$ep1 = $job.Output
239+
240+
Assert-NotNull $ep1
241+
Assert-AreEqual Hyperscale $ep1.Edition
242+
Assert-AreEqual 4 $ep1.Capacity
243+
Assert-AreEqual 1 $ep1.HighAvailabilityReplicaCount #Default number of high availability replicas
244+
}
245+
finally
246+
{
247+
Remove-AzSqlElasticPool -ElasticPoolName $poolName -ResourceGroupName $rg -ServerName $server
248+
}
249+
}
250+
251+
<#
252+
.SYNOPSIS
253+
Tests creating a Hyperscale elastic pool with 2 high availability replicas
254+
#>
255+
function Test-CreateHyperscaleElasticPoolWithReplica
256+
{
257+
# Setup
258+
$location = "north europe"
259+
$rg = "PowershellTestsNE"
260+
$server = "hs-ep-powershelltests"
261+
262+
try
263+
{
264+
## Create Hyperscale pool with 2 high availability replicas
265+
$poolName = Get-ElasticPoolName
266+
$job = New-AzSqlElasticPool -ServerName $server -ResourceGroupName $rg `
267+
-ElasticPoolName $poolName -VCore 4 -Edition Hyperscale -ComputeGeneration Gen5 -HighAvailabilityReplicaCount 2 -AsJob
268+
$job | Wait-Job
269+
$ep1 = $job.Output
270+
271+
Assert-NotNull $ep1
272+
Assert-AreEqual Hyperscale $ep1.Edition
273+
Assert-AreEqual 2 $ep1.HighAvailabilityReplicaCount
274+
}
275+
finally
276+
{
277+
Remove-AzSqlElasticPool -ElasticPoolName $poolName -ResourceGroupName $rg -ServerName $server
278+
}
279+
}
280+
220281
<#
221282
.SYNOPSIS
222283
Tests updating an elastic pool
@@ -445,6 +506,89 @@ function Test-UpdateElasticPoolWithMaintenanceConfigurationId
445506
}
446507
}
447508

509+
<#
510+
.SYNOPSIS
511+
Tests updating a Hyperscale elastic pool's number of high availability replicas
512+
#>
513+
function Test-UpdateHyperscaleElasticPoolReplicaCount
514+
{
515+
# Setup
516+
$location = "north europe"
517+
$rg = "PowershellTestsNE"
518+
$server = "hs-ep-powershelltests"
519+
520+
try
521+
{
522+
# Create elastic pool without specifying HighAvailabilityReplicaCount
523+
$poolName = Get-ElasticPoolName
524+
$ep1 = New-AzSqlElasticPool -ServerName $server -ResourceGroupName $rg `
525+
-ElasticPoolName $poolName -VCore 4 -Edition Hyperscale -ComputeGeneration Gen5
526+
527+
Assert-NotNull $ep1
528+
Assert-AreEqual Hyperscale $ep1.Edition
529+
Assert-AreEqual 4 $ep1.Capacity
530+
Assert-AreEqual 1 $ep1.HighAvailabilityReplicaCount
531+
532+
# Alter pool's HighAvailabilityReplicaCount
533+
$sep1 = Set-AzSqlElasticPool -ResourceGroupName $ep1.ResourceGroupName -ServerName $ep1.ServerName -ElasticPoolName $ep1.ElasticPoolName `
534+
-HighAvailabilityReplicaCount 2
535+
536+
Assert-AreEqual $sep1.ElasticPoolName $poolName
537+
Assert-AreEqual Hyperscale $sep1.Edition
538+
Assert-AreEqual 4 $sep1.Capacity
539+
Assert-AreEqual 2 $sep1.HighAvailabilityReplicaCount
540+
}
541+
finally
542+
{
543+
Remove-AzSqlElasticPool -ElasticPoolName $poolName -ResourceGroupName $rg -ServerName $server
544+
}
545+
}
546+
547+
<#
548+
.SYNOPSIS
549+
Tests moving a database out of a Hyperscale elastic pool
550+
#>
551+
function Test-MoveDatabaseOutHyperscaleElasticPool
552+
{
553+
# Setup
554+
$location = "north europe"
555+
$rg = "PowershellTestsNE"
556+
$server = "hs-ep-powershelltests"
557+
558+
try
559+
{
560+
# Create Hyperscale elastic pool
561+
$poolName = Get-ElasticPoolName
562+
$ep1 = New-AzSqlElasticPool -ServerName $server -ResourceGroupName $rg `
563+
-ElasticPoolName $poolName -VCore 4 -Edition Hyperscale -ComputeGeneration Gen5 -HighAvailabilityReplicaCount 2
564+
565+
Assert-NotNull $ep1
566+
Assert-AreEqual Hyperscale $ep1.Edition
567+
Assert-AreEqual 4 $ep1.Capacity
568+
Assert-AreEqual 2 $ep1.HighAvailabilityReplicaCount
569+
570+
# Create database inside pool
571+
$databaseName = Get-DatabaseName
572+
$db = New-AzSqlDatabase -ResourceGroupName $rg -ServerName $server -DatabaseName $databaseName -ElasticPoolName $poolName
573+
574+
Assert-NotNull $db
575+
Assert-AreEqual Hyperscale $db.Edition
576+
Assert-AreEqual 2 $db.HighAvailabilityReplicaCount
577+
578+
#Move database out of elastic pool
579+
$db = Set-AzSqlDatabase -ResourceGroupName $rg -ServerName $server -DatabaseName $databaseName -Edition "Hyperscale" -Vcore 4 -ComputeGeneration "Gen5"
580+
Assert-NotNull $db
581+
Assert-AreEqual Hyperscale $db.Edition
582+
Assert-AreEqual 4 $db.Capacity
583+
Assert-AreEqual 2 $db.HighAvailabilityReplicaCount
584+
}
585+
finally
586+
{
587+
Remove-AzSqlDatabase -ResourceGroupName $rg -ServerName $server -DatabaseName $databaseName
588+
Remove-AzSqlElasticPool -ElasticPoolName $poolName -ResourceGroupName $rg -ServerName $server
589+
}
590+
}
591+
448592
<#
449593
.SYNOPSIS
450594
Tests getting an elastic pool
@@ -577,6 +721,38 @@ function Test-GetElasticPoolWithMaintenanceConfigurationId
577721
}
578722
}
579723

724+
<#
725+
.SYNOPSIS
726+
Tests getting a hyperscale elastic pool
727+
#>
728+
function Test-GetHyperscaleElasticPool
729+
{
730+
# Setup
731+
$location = "north europe"
732+
$rg = "PowershellTestsNE"
733+
$server = "hs-ep-powershelltests"
734+
735+
try
736+
{
737+
# Create Hyperscale elastic pool
738+
$poolName = Get-ElasticPoolName
739+
New-AzSqlElasticPool -ServerName $server -ResourceGroupName $rg `
740+
-ElasticPoolName $poolName -VCore 4 -Edition Hyperscale -ComputeGeneration Gen5 -HighAvailabilityReplicaCount 2
741+
742+
# Get Hyperscale elastic pool
743+
$ep1 = Get-AzSqlElasticPool -ServerName $server -ResourceGroupName $rg -ElasticPoolName $poolName
744+
745+
Assert-NotNull $ep1
746+
Assert-AreEqual Hyperscale $ep1.Edition
747+
Assert-AreEqual 4 $ep1.Capacity
748+
Assert-AreEqual 2 $ep1.HighAvailabilityReplicaCount
749+
}
750+
finally
751+
{
752+
Remove-AzSqlElasticPool -ElasticPoolName $poolName -ResourceGroupName $rg -ServerName $server
753+
}
754+
}
755+
580756
<#
581757
.SYNOPSIS
582758
Tests removing an elastic pool

0 commit comments

Comments
 (0)