Skip to content

Commit 9f11b61

Browse files
author
BradleyBartlett
committed
Merge branch 'vnext' of https://github.com/Azure/AzureStack-Tools into vnext
2 parents c11b7a0 + 70fbbc6 commit 9f11b61

File tree

8 files changed

+138
-42
lines changed

8 files changed

+138
-42
lines changed

CanaryValidator/Canary.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ while ($runCount -le $NumberOfIterations)
222222
Get-AzSStorageSubsystem -Location $ResourceLocation
223223
}
224224

225-
Invoke-Usecase -Name 'GetAzureStackStorageShare' -Description "List all storage file shares" -UsecaseBlock `
225+
Invoke-Usecase -Name 'GetAzureStackInfrastructureShare' -Description "List all storage file shares" -UsecaseBlock `
226226
{
227-
Get-AzsStorageShare -Location $ResourceLocation
227+
Get-AzsInfrastructureShare -Location $ResourceLocation
228228
}
229229

230230
Invoke-Usecase -Name 'GetAzureStackScaleUnit' -Description "List Azure Stack scale units in specified Region" -UsecaseBlock `

CanaryValidator/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Set-Location -Path ".\AzureStack-Tools-master\CanaryValidator" -PassThru
1717
```powershell
1818
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
1919
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
20-
# Install-Module -Name AzureStack -RequiredVersion 1.2.9 -Scope CurrentUser
20+
# Install-Module -Name AzureStack -RequiredVersion 1.2.10 -Scope CurrentUser
2121
$TenantAdminCreds = New-Object System.Management.Automation.PSCredential "<Tenant Admin username>", (ConvertTo-SecureString "<Tenant Admin password>" -AsPlainText -Force)
2222
$ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Service Admin username>", (ConvertTo-SecureString "<Service Admin password>" -AsPlainText -Force)
2323
.\Canary.Tests.ps1 -TenantID "<TenantID from Azure Active Directory>" -AdminArmEndpoint "<Administrative ARM endpoint>" -ServiceAdminCredentials $ServiceAdminCreds -TenantArmEndpoint "<Tenant ARM endpoint>" -TenantAdminCredentials $TenantAdminCreds
@@ -29,7 +29,7 @@ $ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Ser
2929
# Download the WS2016 ISO image from: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016, and place it on your local machine
3030
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
3131
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
32-
# Install-Module -Name AzureStack -RequiredVersion 1.2.9 -Scope CurrentUser
32+
# Install-Module -Name AzureStack -RequiredVersion 1.2.10 -Scope CurrentUser
3333
$TenantAdminCreds = New-Object System.Management.Automation.PSCredential "<Tenant Admin username>", (ConvertTo-SecureString "<Tenant Admin password>" -AsPlainText -Force)
3434
$ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Service Admin username>", (ConvertTo-SecureString "<Service Admin password>" -AsPlainText -Force)
3535
.\Canary.Tests.ps1 -TenantID "<TenantID from Azure Active Directory>" -AdminArmEndpoint "<Administrative ARM endpoint>" -ServiceAdminCredentials $ServiceAdminCreds -TenantArmEndpoint "<Tenant ARM endpoint>" -TenantAdminCredentials $TenantAdminCreds -WindowsISOPath "<path where the WS2016 ISO is present>"
@@ -40,7 +40,7 @@ $ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Ser
4040
```powershell
4141
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
4242
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
43-
# Install-Module -Name AzureStack -RequiredVersion 1.2.9 -Scope CurrentUser
43+
# Install-Module -Name AzureStack -RequiredVersion 1.2.10 -Scope CurrentUser
4444
$ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Service Admin username>", (ConvertTo-SecureString "<Service Admin password>" -AsPlainText -Force)
4545
.\Canary.Tests.ps1 -TenantID "<TenantID from Azure Active Directory>" -AdminArmEndpoint "<Administrative ARM endpoint>" -ServiceAdminCredentials $ServiceAdminCreds
4646
```
@@ -50,7 +50,7 @@ $ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Ser
5050
```powershell
5151
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
5252
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
53-
# Install-Module -Name AzureStack -RequiredVersion 1.2.9 -Scope CurrentUser
53+
# Install-Module -Name AzureStack -RequiredVersion 1.2.10 -Scope CurrentUser
5454
.\Canary.Tests.ps1 -ListAvailable
5555
5656
Sample output:
@@ -136,7 +136,7 @@ List of scenarios in Canary:
136136
```powershell
137137
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
138138
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
139-
# Install-Module -Name AzureStack -RequiredVersion 1.2.9 -Scope CurrentUser
139+
# Install-Module -Name AzureStack -RequiredVersion 1.2.10 -Scope CurrentUser
140140
# A new paramter called ExclusionList has been added which is a string array. Pass in the list of usecases you don't want to execute to this parameter.
141141
$ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Service Admin username>", (ConvertTo-SecureString "<Service Admin password>" -AsPlainText -Force)
142142
.\Canary.Tests.ps1 -TenantID "<TenantID from Azure Active Directory>" -AdminArmEndpoint "<Administrative ARM endpoint>" -ServiceAdminCredentials $ServiceAdminCreds -ExclusionList "ListFabricResourceProviderInfo","ListUpdateResourceProviderInfo"

Identity/AzureStack.Identity.psm1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function Get-AzsDirectoryTenantidentifier {
2626
return $(Invoke-RestMethod $("{0}/.well-known/openid-configuration" -f $authority.TrimEnd('/'))).issuer.TrimEnd('/').Split('/')[-1]
2727
}
2828

29-
Export-ModuleMember -Function 'Get-AzsDirectoryTenantidentifier'
3029

3130
<#
3231
.Synopsis
@@ -316,7 +315,7 @@ function Register-AzsGuestDirectoryTenant {
316315
}
317316
}
318317

319-
Export-ModuleMember -Function 'Publish-AzsApplicationsToARM'
318+
320319

321320
<#
322321
.Synopsis
@@ -451,8 +450,8 @@ function Register-AzsWithMyDirectoryTenant {
451450
}
452451

453452
Export-ModuleMember -Function @(
454-
"Register-AzureStackWithMyDirectoryTenant",
455-
"Register-GuestDirectoryTenantToAzureStack",
456-
"Get-DirectoryTenantIdentifier",
453+
"Register-AzsWithMyDirectoryTenant",
454+
"Register-AzsGuestDirectoryTenant",
455+
"Get-AzsDirectoryTenantidentifier",
457456
"New-AzsADGraphServicePrincipal"
458457
)

Identity/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $adminARMEndpoint = "https://adminmanagement.<region>.<domain>"
5757
$azureStackDirectoryTenant = "<homeDirectoryTenant>.onmicrosoft.com" # this is the primary tenant Azure Stack is registered to
5858
$guestDirectoryTenantToBeOnboarded = "<guestDirectoryTenant>.onmicrosoft.com" # this is the new tenant that needs to be onboarded to Azure Stack
5959
$location = "local"
60-
Register-GuestDirectoryTenantToAzureStack -AdminResourceManagerEndpoint $adminARMEndpoint `
60+
Register-AzsGuestDirectoryTenant -AdminResourceManagerEndpoint $adminARMEndpoint `
6161
-DirectoryTenantName $azureStackDirectoryTenant `
6262
-GuestDirectoryTenantName $guestDirectoryTenantToBeOnboarded `
6363
-Location $location
@@ -82,6 +82,6 @@ Execute the following cmdlet as the administrator of the directory that needs to
8282
$tenantARMEndpoint = "https://management.<region>.<domain>"
8383
$guestDirectoryTenantName = "<guestDirectoryTenant>.onmicrosoft.com" # this is the new tenant that needs to be onboarded to Azure Stack
8484
85-
Register-AzureStackWithMyDirectoryTenant -TenantResourceManagerEndpoint $tenantARMEndpoint `
85+
Register-AzsWithMyDirectoryTenant -TenantResourceManagerEndpoint $tenantARMEndpoint `
8686
-DirectoryTenantName $guestDirectoryTenantName
8787
```

Infrastructure/AzureStack.Infra.psm1

Lines changed: 106 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Export-ModuleMember -Function Get-AzsInfrastructureRoleInstance
118118
.SYNOPSIS
119119
List File Shares
120120
#>
121-
function Get-AzsStorageShare {
121+
function Get-AzsInfrastructureShare {
122122
Param(
123123
[Parameter(Mandatory = $false)]
124124
[string] $Location
@@ -130,7 +130,7 @@ function Get-AzsStorageShare {
130130
$shares
131131
}
132132

133-
Export-ModuleMember -Function Get-AzsStorageShare
133+
Export-ModuleMember -Function Get-AzsInfrastructureShare
134134

135135
<#
136136
.SYNOPSIS
@@ -389,7 +389,7 @@ function Start-AzsInfrastructureRoleInstance {
389389
[switch] $Force
390390
)
391391

392-
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure to start $Name ?", "")) {
392+
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to start $Name ?", "")) {
393393
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/infraRoleInstances"
394394

395395
Invoke-AzsInfrastructureAction -Name $Name -Action "poweron" -Location $Location -ResourceType $resourceType
@@ -415,7 +415,7 @@ function Stop-AzsInfrastructureRoleInstance {
415415
[switch] $Force
416416
)
417417

418-
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure to shut down $Name ?", "")) {
418+
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to shut down $Name ?", "")) {
419419
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/infraRoleInstances"
420420

421421
Invoke-AzsInfrastructureAction -Name $Name -Action "shutdown" -Location $Location -ResourceType $resourceType
@@ -441,7 +441,7 @@ function Restart-AzsInfrastructureRoleInstance {
441441
[switch] $Force
442442
)
443443

444-
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure to restart $Name ?", "")) {
444+
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to restart $Name ?", "")) {
445445
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/infraRoleInstances"
446446

447447
Invoke-AzsInfrastructureAction -Name $Name -Action "reboot" -Location $Location -ResourceType $resourceType
@@ -479,7 +479,7 @@ function Add-AzsIpPool {
479479
ResourceType = "Microsoft.Fabric.Admin/fabricLocations/IPPools"
480480
ResourceGroupName = "system.{0}" -f $Location
481481
ApiVersion = "2016-05-01"
482-
Properties = @{
482+
Properties = @{
483483
StartIpAddress = "$StartIPAddress"
484484
EndIpAddress = "$EndIPAddress"
485485
AddressPrefix = "$AddressPrefix"
@@ -509,7 +509,7 @@ function Disable-AzsScaleUnitNode {
509509
[switch] $Force
510510
)
511511

512-
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure to disable scale unit node $Name ?", "")) {
512+
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to disable scale unit node $Name ?", "")) {
513513
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
514514

515515
Invoke-AzsInfrastructureAction -Action "StartMaintenanceMode" -Name $Name -Location $Location -ResourceType $resourceType
@@ -537,7 +537,7 @@ function Enable-AzsScaleUnitNode {
537537
[switch] $Force
538538
)
539539

540-
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure to enable scale unit node $Name ?", "")) {
540+
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to enable scale unit node $Name ?", "")) {
541541
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
542542

543543
Invoke-AzsInfrastructureAction -Action "StopMaintenanceMode" -Name $Name -Location $Location -ResourceType $resourceType
@@ -546,6 +546,94 @@ function Enable-AzsScaleUnitNode {
546546

547547
Export-ModuleMember -Function Enable-AzsScaleUnitNode
548548

549+
<#
550+
.SYNOPSIS
551+
Repairs a scale unit node by reimaging and readding a specific node
552+
#>
553+
554+
function Repair-AzsScaleUnitNode {
555+
[CmdletBinding(SupportsShouldProcess = $true)]
556+
Param(
557+
[Parameter(Mandatory = $false)]
558+
[string] $Location,
559+
560+
[Parameter(Mandatory = $true)]
561+
[ValidateNotNullorEmpty()]
562+
[string] $ScaleUnitNodeName,
563+
564+
[Parameter(Mandatory = $true)]
565+
[ValidateNotNullorEmpty()]
566+
[string] $BMCIPv4Address,
567+
568+
[switch] $Force
569+
)
570+
571+
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to repair scale unit node $ScaleUnitNodeName ?", "")) {
572+
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
573+
574+
$parameters = @{
575+
bmcIPv4Address = $BMCIPv4Address
576+
}
577+
578+
Invoke-AzsInfrastructureAction -Action "Repair" -Name $ScaleUnitNodeName -Location $Location -ResourceType $resourceType -Parameters $parameters
579+
}
580+
}
581+
582+
Export-ModuleMember -Function Repair-AzsScaleUnitNode
583+
584+
<#
585+
.SYNOPSIS
586+
Powers off a scale unit node
587+
#>
588+
589+
function Stop-AzsScaleUnitNode {
590+
[CmdletBinding(SupportsShouldProcess = $true)]
591+
Param(
592+
[Parameter(Mandatory = $false)]
593+
[string] $Location,
594+
595+
[Parameter(Mandatory = $true)]
596+
[ValidateNotNullorEmpty()]
597+
[string] $ScaleUnitNodeName,
598+
599+
[switch] $Force
600+
)
601+
602+
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to stop scale unit node $ScaleUnitNodeName ?", "")) {
603+
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
604+
605+
Invoke-AzsInfrastructureAction -Action "PowerOff" -Name $ScaleUnitNodeName -Location $Location -ResourceType $resourceType
606+
}
607+
}
608+
609+
Export-ModuleMember -Function Stop-AzsScaleUnitNode
610+
611+
<#
612+
.SYNOPSIS
613+
Powers on a scale unit node
614+
#>
615+
616+
function Start-AzsScaleUnitNode {
617+
[CmdletBinding(SupportsShouldProcess = $true)]
618+
Param(
619+
[Parameter(Mandatory = $false)]
620+
[string] $Location,
621+
622+
[Parameter(Mandatory = $true)]
623+
[ValidateNotNullorEmpty()]
624+
[string] $ScaleUnitNodeName,
625+
626+
[switch] $Force
627+
)
628+
629+
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to start scale unit node $ScaleUnitNodeName ?", "")) {
630+
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
631+
632+
Invoke-AzsInfrastructureAction -Action "PowerOn" -Name $ScaleUnitNodeName -Location $Location -ResourceType $resourceType
633+
}
634+
}
635+
636+
Export-ModuleMember -Function Start-AzsScaleUnitNode
549637

550638
<#
551639
.SYNOPSIS
@@ -660,9 +748,12 @@ function Invoke-AzsInfrastructureAction {
660748
[string] $Name,
661749
[string] $Location,
662750
[string] $Action,
663-
[string] $ResourceType
751+
[string] $ResourceType,
752+
753+
[Parameter(Mandatory = $false)]
754+
[Hashtable] $Parameters = $null
664755
)
665-
756+
666757
$Location = Get-AzsHomeLocation -Location $Location
667758

668759
$params = @{
@@ -673,5 +764,10 @@ function Invoke-AzsInfrastructureAction {
673764
ResourceName = "{0}/{1}" -f $Location, $Name
674765
}
675766

767+
if ($Parameters)
768+
{
769+
$params.Parameters = $Parameters
770+
}
771+
676772
Invoke-AzureRmResourceAction @params -Force
677773
}

Infrastructure/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Add-AzureRMEnvironment -Name "AzureStackAdmin" -ArmEndpoint "https://adminmanage
2222
Then login:
2323

2424
```powershell
25-
Login-AzureRmAccount -EnvironmentName "AzureStackAdmin"
25+
Login-AzureRmAccount -EnvironmentName "AzureStackAdmin"
2626
```
2727
----
2828
If you are **not** using your home directory tenant, you will need to supply the tenant ID to your login command. You may find it easiest to obtain using the Connect tool. For **Azure Active Directory** environments provide your directory tenant name:
@@ -68,7 +68,7 @@ The command does the following:
6868
Review the Update Summary for a specified region.
6969

7070
```powershell
71-
Get-AzsUpdateSummary
71+
Get-AzsUpdateLocation
7272
```
7373

7474
The command does the following:
@@ -179,7 +179,7 @@ The command does the following:
179179

180180
```powershell
181181
182-
Get-AzsStorageShare
182+
Get-AzsInfrastructureShare
183183
```
184184

185185
The command does the following:
@@ -359,7 +359,7 @@ Get-AzsIpPool
359359

360360
```powershell
361361
#Review Current Region Update Summary
362-
Get-AzsUpdateSummary
362+
Get-AzsUpdateLocation
363363
364364
#Check for available and applicable updates
365365
Get-AzsUpdate
@@ -371,7 +371,7 @@ Install-AzsUpdate -Update "2.0.0.0"
371371
Get-AzsUpdateRun -Update "2.0.0.0"
372372
373373
#Review Region Update Summary after successful run
374-
Get-AzsUpdateSummary
374+
Get-AzsUpdateLocation
375375
```
376376

377377
### Perform FRU procedure
@@ -385,10 +385,10 @@ $node | fl
385385
#Enable Maintenance Mode for that node which drains all active resources
386386
Disable-AzsScaleUnitNode -Name $node.name
387387
388-
#Power Off Server using build in KVN or physical power button
388+
#Power Off Server using build in KVM or physical power button
389389
#BMC IP Address is returned by previous command $node.properties | fl
390390
#Apply FRU Procedure
391-
#Power On Server using build in KVN or physical power button
391+
#Power On Server using build in KVM or physical power button
392392
393393
#Resume ScaleUnitNode from Maintenance Mode
394394
Enable-AzsScaleUnitNode -Name $node.name

0 commit comments

Comments
 (0)