From 8618d21afd29e7d4ade9e7dce32c83888c4d78eb Mon Sep 17 00:00:00 2001 From: Krishna Nithin Date: Thu, 13 Apr 2017 21:59:16 -0700 Subject: [PATCH 1/4] Add FRP/HRP/URP usecases to Canary (#150) * Randomize the RG names during multiple iterations * Append iteration count to RG * Correct the if check * frp hrp urp get calls to display various infrastructure information (#149) --- CanaryValidator/Canary.Tests.ps1 | 116 +++++++++++++++++++++++++++---- 1 file changed, 102 insertions(+), 14 deletions(-) diff --git a/CanaryValidator/Canary.Tests.ps1 b/CanaryValidator/Canary.Tests.ps1 index 5cb60636..32abe161 100644 --- a/CanaryValidator/Canary.Tests.ps1 +++ b/CanaryValidator/Canary.Tests.ps1 @@ -61,12 +61,12 @@ param ( [parameter(HelpMessage="Resource group under which all the utilities need to be placed")] [Parameter(ParameterSetName="default", Mandatory=$false)] [Parameter(ParameterSetName="tenant", Mandatory=$false)] [ValidateNotNullOrEmpty()] - [string]$CanaryUtilitiesRG = "canur" + [Random]::new().Next(1,999), + [string]$CanaryUtilitiesRG = "cnur" + [Random]::new().Next(1,99), [parameter(HelpMessage="Resource group under which the virtual machines need to be placed")] [Parameter(ParameterSetName="default", Mandatory=$false)] [Parameter(ParameterSetName="tenant", Mandatory=$false)] [ValidateNotNullOrEmpty()] - [string]$CanaryVMRG = "canvr" + [Random]::new().Next(1,999), + [string]$CanaryVMRG = "cnvr" + [Random]::new().Next(1,99), [parameter(HelpMessage="Location where all the resource need to deployed and placed")] [Parameter(ParameterSetName="default", Mandatory=$false)] [Parameter(ParameterSetName="tenant", Mandatory=$false)] @@ -105,22 +105,26 @@ Import-Module -Name $PSScriptRoot\..\Connect\AzureStack.Connect.psm1 -Force Import-Module -Name $PSScriptRoot\..\Infrastructure\AzureStack.Infra.psm1 -Force Import-Module -Name $PSScriptRoot\..\ComputeAdmin\AzureStack.ComputeAdmin.psm1 -Force -$storageAccName = $CanaryUtilitiesRG + "sa" -$storageCtrName = $CanaryUtilitiesRG + "sc" -$keyvaultName = $CanaryUtilitiesRG + "kv" -$keyvaultCertName = "ASCanaryVMCertificate" -$kvSecretName = $keyvaultName.ToLowerInvariant() + "secret" -$VMAdminUserName = "CanaryAdmin" -$VMAdminUserPass = "CanaryAdmin@123" -$canaryUtilPath = Join-Path -Path $env:TEMP -ChildPath "CanaryUtilities$((Get-Date).Ticks)" -$linuxImagePublisher = "Canonical" -$linuxImageOffer = "UbuntuServer" -$linuxImageVersion = "1.0.0" - $runCount = 1 $tmpLogname = $CanaryLogFileName while ($runCount -le $NumberOfIterations) { + if ($NumberOfIterations -gt 1) + { + $CanaryUtilitiesRG = $CanaryUtilitiesRG + $runCount + $CanaryVMRG = $CanaryVMRG + $runCount + } + $storageAccName = $CanaryUtilitiesRG + "sa" + $storageCtrName = $CanaryUtilitiesRG + "sc" + $keyvaultName = $CanaryUtilitiesRG + "kv" + $keyvaultCertName = "ASCanaryVMCertificate" + $kvSecretName = $keyvaultName.ToLowerInvariant() + "secret" + $VMAdminUserName = "CanaryAdmin" + $VMAdminUserPass = "CanaryAdmin@123" + $canaryUtilPath = Join-Path -Path $env:TEMP -ChildPath "CanaryUtilities$((Get-Date).Ticks)" + $linuxImagePublisher = "Canonical" + $linuxImageOffer = "UbuntuServer" + $linuxImageVersion = "1.0.0" if (Test-Path -Path $canaryUtilPath) { Remove-Item -Path $canaryUtilPath -Force -Recurse @@ -173,6 +177,90 @@ while ($runCount -le $NumberOfIterations) $defaultSubscription | Select-AzureRmSubscription } } + + Invoke-Usecase -Name 'ListFabricResourceProviderInfo' -Description "List FabricResourceProvider(FRP) information like storage shares, capacity, logical networks etc." -UsecaseBlock ` + { + Invoke-Usecase -Name 'GetAzureStackInfraRole' -Description "List all infrastructure roles" -UsecaseBlock ` + { + Get-AzSInfraRole -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackInfraRoleInstance' -Description "List all infrastructure role instances" -UsecaseBlock ` + { + Get-AzSInfraRoleInstance -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackLogicalNetwork' -Description "List all logical networks" -UsecaseBlock ` + { + Get-AzSLogicalNetwork -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackStorageCapacity' -Description "List storage capacity" -UsecaseBlock ` + { + Get-AzSStorageCapacity -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackStorageShare' -Description "List all storage file shares" -UsecaseBlock ` + { + Get-AzSStorageShare -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackScaleUnit' -Description "List Azure Stack scale units in specified Region" -UsecaseBlock ` + { + Get-AzSScaleUnit -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackScaleUnitNode' -Description "List nodes in scale unit" -UsecaseBlock ` + { + Get-AzSScaleUnitNode -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackIPPool' -Description "List all IP pools" -UsecaseBlock ` + { + Get-AzSIPPool -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackMacPool' -Description "List all MAC address pools " -UsecaseBlock ` + { + Get-AzSMacPool -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackGatewayPool' -Description "List all gateway pools" -UsecaseBlock ` + { + Get-AzSGatewayPool -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackSLBMux' -Description "List all SLB MUX instances" -UsecaseBlock ` + { + Get-AzSSLBMUX -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackGateway' -Description "List all gateway" -UsecaseBlock ` + { + Get-AzSGateway -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + } + + Invoke-Usecase -Name 'ListHealthResourceProviderAlerts' -Description "List all HealthResourceProvider(HRP) alerts " -UsecaseBlock ` + { + Invoke-Usecase -Name 'GetAzureStackAlert' -Description "List all alerts" -UsecaseBlock ` + { + Get-AzSAlert -TenantID $TenantID -AzureStackCredentials $ServiceAdminCredentials -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + } + + Invoke-Usecase -Name 'ListUpdatesResourceProviderInfo' -Description "List URP information like summary of updates available, update to be applied, last update applied etc." -UsecaseBlock ` + { + Invoke-Usecase -Name 'GetAzureStackUpdateSummary' -Description "List summary of updates status" -UsecaseBlock ` + { + Get-AzSUpdateSummary -TenantID $TenantID -AzureStackCredentials $ServiceAdminCredentials -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + + Invoke-Usecase -Name 'GetAzureStackUpdateToApply' -Description "List all updates that can be applied" -UsecaseBlock ` + { + Get-AzSUpdate -TenantID $TenantID -AzureStackCredentials $ServiceAdminCredentials -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation + } + } if ($WindowsISOPath) { From df32ee767bd2d0ffd2d2dd19fa6f019a1d9835cd Mon Sep 17 00:00:00 2001 From: Krishna Nithin Date: Tue, 18 Apr 2017 10:07:50 -0700 Subject: [PATCH 2/4] Randomize tenant subscription name artifacts --- CanaryValidator/Canary.Tests.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CanaryValidator/Canary.Tests.ps1 b/CanaryValidator/Canary.Tests.ps1 index 32abe161..8605d2b4 100644 --- a/CanaryValidator/Canary.Tests.ps1 +++ b/CanaryValidator/Canary.Tests.ps1 @@ -302,11 +302,11 @@ while ($runCount -le $NumberOfIterations) if ($TenantAdminCredentials) { - $subscriptionRGName = "ascansubscrrg" + [Random]::new().Next(1,999) - $tenantPlanName = "ascantenantplan" + [Random]::new().Next(1,999) - $tenantOfferName = "ascantenantoffer" + [Random]::new().Next(1,999) - $tenantSubscriptionName = "ascanarytenantsubscription" + [Random]::new().Next(1,999) - $canaryDefaultTenantSubscription = "canarytenantdefaultsubscription" + [Random]::new().Next(1,999) + $subscriptionRGName = $CanaryUtilitiesRG + "subscrrg" + [Random]::new().Next(1,999) + $tenantPlanName = $CanaryUtilitiesRG + "tenantplan" + [Random]::new().Next(1,999) + $tenantOfferName = $CanaryUtilitiesRG + "tenantoffer" + [Random]::new().Next(1,999) + $tenantSubscriptionName = $CanaryUtilitiesRG + "tenantsubscription" + [Random]::new().Next(1,999) + $canaryDefaultTenantSubscription = $CanaryUtilitiesRG + "tenantdefaultsubscription" + [Random]::new().Next(1,999) if (-not $TenantArmEndpoint) { From 839f53714ac77e627131ffd50de409c6ace15529 Mon Sep 17 00:00:00 2001 From: Krishna Nithin Date: Wed, 19 Apr 2017 12:07:14 -0700 Subject: [PATCH 3/4] Pass location explicitly --- CanaryValidator/Canary.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CanaryValidator/Canary.Tests.ps1 b/CanaryValidator/Canary.Tests.ps1 index 8605d2b4..fd7dc56a 100644 --- a/CanaryValidator/Canary.Tests.ps1 +++ b/CanaryValidator/Canary.Tests.ps1 @@ -268,7 +268,7 @@ while ($runCount -le $NumberOfIterations) { if (-not (Get-AzureRmVMImage -Location $ResourceLocation -PublisherName "MicrosoftWindowsServer" -Offer "WindowsServer" -Sku "2016-Datacenter-Core" -ErrorAction SilentlyContinue)) { - New-Server2016VMImage -ISOPath $WindowsISOPath -TenantId $TenantID -EnvironmentName $SvcAdminEnvironmentName -Version Core -AzureStackCredentials $ServiceAdminCredentials -CreateGalleryItem $false + New-Server2016VMImage -ISOPath $WindowsISOPath -TenantId $TenantID -EnvironmentName $SvcAdminEnvironmentName -Location $ResourceLocation -Version Core -AzureStackCredentials $ServiceAdminCredentials -CreateGalleryItem $false } } } @@ -288,7 +288,7 @@ while ($runCount -le $NumberOfIterations) } New-Item -Path $CanaryCustomImageFolder -ItemType Directory $CustomVHDPath = CopyImage -ImagePath $LinuxImagePath -OutputFolder $CanaryCustomImageFolder - Add-VMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -tenantID $TenantID -azureStackCredentials $ServiceAdminCredentials -CreateGalleryItem $false -EnvironmentName $SvcAdminEnvironmentName + Add-VMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -tenantID $TenantID -azureStackCredentials $ServiceAdminCredentials -Location $ResourceLocation -CreateGalleryItem $false -EnvironmentName $SvcAdminEnvironmentName Remove-Item $CanaryCustomImageFolder -Force -Recurse } } From 880bbd49f57be559861a1e440d2e5102178d7b44 Mon Sep 17 00:00:00 2001 From: vikasnav Date: Fri, 28 Apr 2017 13:26:27 -0700 Subject: [PATCH 4/4] Update the VMNames from MAS to AzS --- Connect/AzureStack.Connect.psm1 | 4 ++-- Connect/README.md | 2 +- Connect/Tests/Connect.Tests.ps1 | 2 +- Identity/AzureStack.Identity.psm1 | 2 +- ToolTestingUtils/ToolTestingScript.ps1 | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Connect/AzureStack.Connect.psm1 b/Connect/AzureStack.Connect.psm1 index 7e409153..409e5696 100644 --- a/Connect/AzureStack.Connect.psm1 +++ b/Connect/AzureStack.Connect.psm1 @@ -150,7 +150,7 @@ function Get-AzureStackNatServerAddress { [Parameter(HelpMessage="The Domain suffix of the environment VMs")] [string] $DomainSuffix = 'azurestack.local', [parameter(HelpMessage="NAT computer name in this Azure Stack Instance")] - [string] $natServer = "mas-bgpnat01", + [string] $natServer = "azs-bgpnat01", [parameter(HelpMessage="Administrator user name of this Azure Stack Instance")] [string] $User = "administrator", [parameter(mandatory=$true, HelpMessage="Administrator password used to deploy this Azure Stack instance")] @@ -229,7 +229,7 @@ function Connect-AzureStackVpn { [Parameter(HelpMessage="The Domain suffix of the environment VMs")] [string] $DomainSuffix = 'azurestack.local', [parameter(HelpMessage="Certificate Authority computer name in this Azure Stack Instance")] - [string] $Remote = "mas-ca01", + [string] $Remote = "azs-ca01", [parameter(HelpMessage="Administrator user name of this Azure Stack Instance")] [string] $User = "administrator", [parameter(mandatory=$true, HelpMessage="Administrator password used to deploy this Azure Stack instance")] diff --git a/Connect/README.md b/Connect/README.md index 81bd1d2e..20c203f0 100644 --- a/Connect/README.md +++ b/Connect/README.md @@ -34,7 +34,7 @@ The commands below need to access the Azure Stack PoC host computer and Azure St ```powershell # Add Azure Stack PoC host to the trusted hosts on your client computer Set-Item wsman:\localhost\Client\TrustedHosts -Value "" -Concatenate -Set-Item wsman:\localhost\Client\TrustedHosts -Value mas-ca01.azurestack.local -Concatenate +Set-Item wsman:\localhost\Client\TrustedHosts -Value azs-ca01.azurestack.local -Concatenate ``` For the VPN connection, use the admin password provided at the time of the Azure Stack deployment. diff --git a/Connect/Tests/Connect.Tests.ps1 b/Connect/Tests/Connect.Tests.ps1 index 7e8781f0..816c66b3 100644 --- a/Connect/Tests/Connect.Tests.ps1 +++ b/Connect/Tests/Connect.Tests.ps1 @@ -68,7 +68,7 @@ InModuleScope $script:ModuleName { $EnvironmentName = $global:EnvironmentName Set-Item wsman:\localhost\Client\TrustedHosts -Value $HostComputer -Concatenate - Set-Item wsman:\localhost\Client\TrustedHosts -Value mas-ca01.azurestack.local -Concatenate + Set-Item wsman:\localhost\Client\TrustedHosts -Value azs-ca01.azurestack.local -Concatenate Describe 'ConnectModule - Accessing Environment Data' { It 'Recovered AAD Tenant ID should be correct' { diff --git a/Identity/AzureStack.Identity.psm1 b/Identity/AzureStack.Identity.psm1 index 5c08bd4e..7a2288c7 100644 --- a/Identity/AzureStack.Identity.psm1 +++ b/Identity/AzureStack.Identity.psm1 @@ -48,7 +48,7 @@ function New-ADGraphServicePrincipal { # Adfs Machine name [Parameter(Mandatory = $true , Position = 1)] [string] - $AdfsMachineName = "mas-adfs01.azurestack.local", + $AdfsMachineName = "azs-adfs01.azurestack.local", # Domain Administrator Credential to create Service Principal [Parameter(Mandatory = $true, diff --git a/ToolTestingUtils/ToolTestingScript.ps1 b/ToolTestingUtils/ToolTestingScript.ps1 index c94b8b66..d8a84c06 100644 --- a/ToolTestingUtils/ToolTestingScript.ps1 +++ b/ToolTestingUtils/ToolTestingScript.ps1 @@ -4,7 +4,7 @@ param ( [Parameter(mandatory=$true, HelpMessage="The Admin ARM endpoint of the Azure Stack Environment")] [string] $ArmEndpoint, [parameter(HelpMessage="NAT computer name in this Azure Stack Instance")] - [string] $natServer = "MAS-BGPNAT01", + [string] $natServer = "AzS-BGPNAT01", [parameter(HelpMessage="Administrator user name of this Azure Stack Instance")] [string] $AdminUser = "administrator", [parameter(HelpMessage="Administrator Azure Stack Environment Name")]