Skip to content

Commit 06f96a5

Browse files
Merge pull request #284 from Azure/mattmcg/mergebranch
Merge master in vnext
2 parents a808b45 + 6ab4c3f commit 06f96a5

File tree

13 files changed

+194
-102
lines changed

13 files changed

+194
-102
lines changed

CloudCapabilities/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ Import-Module ".\AzureRM.CloudCapabilities.psm1"
1414
Connected Azure or AzureStack powershell environment (Refer [AzureStack-Tools repo/Connect](../Connect) for connecting to an Azure Stack instance. )
1515

1616
```powershell
17-
Get-AzureRMCloudCapabilities -Location '<provide location>' -Verbose #-IncludeComputeCapabilities -IncludeStorageCapabilities
17+
Get-AzureRMCloudCapability -Location '<provide location>' -Verbose #-IncludeComputeCapabilities -IncludeStorageCapabilities
1818
```

Deployment/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The Azure Stack Development Kit installer provides a UI with the following featu
77
- Rerun and Gather Logs
88
- Reboot to SafeOS
99

10+
![](https://github.com/1RedOne/AzureStack-Tools/blob/master/Deployment/ScreenShot.png?raw=true)
11+
1012
To install the Azure Stack Development Kit you require
1113

1214
- A physical server that meets the requirements

Deployment/ScreenShot.png

27 KB
Loading

Deployment/asdk-installer.ps1

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,66 +1301,64 @@ Write-Host "." -NoNewline -ForegroundColor Cyan
13011301

13021302
# Get environment details
13031303
# CloudBuilder
1304-
if (test-path "C:\CloudDeployment\Setup\InstallAzureStackPOC.ps1") {
1305-
1306-
if(!(test-path "C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1")){
1307-
# Deployment not initialized
1308-
$Script:Initialized="CloudBuilder_Install"
1309-
$syncHash.Control_Header_Tbl_Title.Text = $Text_Install.Mode_Title
1310-
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Install.Mode_LeftTitle
1311-
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Install.Mode_LeftContent
1312-
}
1313-
else{
1314-
# Import module to check current deployment status
1315-
Import-Module "C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1" -Force -Verbose:$false
1316-
$actionProgress = Get-ActionProgress -ActionType Deployment
1317-
# Deployment not started
1318-
if (!($actionProgress)){
1304+
if (test-path "C:\CloudDeployment\Setup\InstallAzureStackPOC.ps1") {
1305+
if(!(test-path "C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1")){
1306+
# Deployment not initialized
13191307
$Script:Initialized="CloudBuilder_Install"
13201308
$syncHash.Control_Header_Tbl_Title.Text = $Text_Install.Mode_Title
13211309
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Install.Mode_LeftTitle
13221310
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Install.Mode_LeftContent
13231311
}
1324-
# Deployment in progress
1325-
elseif($actionProgress.LastAttribute.Value -eq 'InProgress'){
1326-
# Not deployed with deployment UI
1327-
if(!(test-path "C:\CloudDeployment\Rerun\config.xml")){
1328-
New-Item C:\CloudDeployment\Rerun -type directory -Force
1329-
'<config status="rerun" run="0"/>' | Out-File C:\CloudDeployment\Rerun\config.xml
1330-
$Script:Initialized="CloudBuilder_Rerun"
1331-
$syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title
1332-
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle
1333-
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent
1334-
}
1335-
# Deployed with deployment UI
1336-
else {
1337-
$Status = [XML](Get-Content "C:\CloudDeployment\Rerun\config.xml")
1338-
# Contains only 1 or 2 deployment logs
1339-
if ($status.config.status -eq "Rerun" -and [int]$status.config.run -le 2){
1312+
else{
1313+
# Import module to check current deployment status
1314+
Import-Module "C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1" -Force -Verbose:$false
1315+
$actionProgress = Get-ActionProgress -ActionType Deployment
1316+
# Deployment not started
1317+
if (!($actionProgress)){
1318+
$Script:Initialized="CloudBuilder_Install"
1319+
$syncHash.Control_Header_Tbl_Title.Text = $Text_Install.Mode_Title
1320+
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Install.Mode_LeftTitle
1321+
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Install.Mode_LeftContent
1322+
}
1323+
# Deployment completed successfully
1324+
elseif($actionProgress.Attribute("Status").Value -eq 'Success'){
1325+
$Script:Initialized="CloudBuilder_Completed_GatherLogs"
1326+
$syncHash.Control_Header_Tbl_Title.Text = $Text_Completed.Mode_Title
1327+
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Completed.Mode_LeftTitle
1328+
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Completed.Mode_LeftContent
1329+
}
1330+
# Deployment in progress or stopped
1331+
else{
1332+
# Not deployed with deployment UI
1333+
if(!(test-path "C:\CloudDeployment\Rerun\config.xml")){
1334+
New-Item C:\CloudDeployment\Rerun -type directory -Force
1335+
'<config status="rerun" run="0"/>' | Out-File C:\CloudDeployment\Rerun\config.xml
13401336
$Script:Initialized="CloudBuilder_Rerun"
13411337
$syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title
13421338
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle
13431339
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent
1344-
}
1345-
# Contains 2 or more deplployment logs
1340+
}
1341+
# Deployed with deployment UI
13461342
else {
1347-
$Script:Initialized="CloudBuilder_Rerun_GatherLogs"
1348-
$syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title_Logs
1349-
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle_Logs
1350-
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent_Logs
1343+
$Status = [XML](Get-Content "C:\CloudDeployment\Rerun\config.xml")
1344+
# Contains only 1 or 2 deployment logs
1345+
if ($status.config.status -eq "Rerun" -and [int]$status.config.run -le 2){
1346+
$Script:Initialized="CloudBuilder_Rerun"
1347+
$syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title
1348+
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle
1349+
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent
1350+
}
1351+
# Contains 2 or more deployment logs
1352+
else {
1353+
$Script:Initialized="CloudBuilder_Rerun_GatherLogs"
1354+
$syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title_Logs
1355+
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle_Logs
1356+
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent_Logs
13511357
}
13521358
}
13531359
}
1354-
else{
1355-
# Deployment completed
1356-
$Script:Initialized="CloudBuilder_Completed_GatherLogs"
1357-
$syncHash.Control_Header_Tbl_Title.Text = $Text_Completed.Mode_Title
1358-
$syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Completed.Mode_LeftTitle
1359-
$syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Completed.Mode_LeftContent
13601360
}
13611361

1362-
}
1363-
13641362
# Reboot options
13651363
F_Reboot_Options
13661364
$syncHash.Control_Mode_Tbl_RightTitle.Text = $Text_Install.Mode_RightTitle
@@ -1666,12 +1664,12 @@ If ($synchash.Control_NetConfig_Rbt_Static.IsChecked){
16661664
}
16671665

16681666
If ($synchash.Control_NetConfig_Tbx_VlanID.Text.Length -gt 0){
1669-
$InstallScript += " -PublicVLan "
1667+
$InstallScript += " -PublicVlanId "
16701668
$InstallScript += $synchash.Control_NetConfig_Tbx_VlanID.Text
16711669
}
16721670

16731671
If ($synchash.Control_NetConfig_Tbx_DnsForwarder.Text.Length -gt 0){
1674-
$InstallScript += " -EnvironmentDNS "
1672+
$InstallScript += " -DNSForwarder "
16751673
$InstallScript += $synchash.Control_NetConfig_Tbx_DnsForwarder.Text
16761674
}
16771675

@@ -1743,11 +1741,11 @@ Function F_Install {
17431741
}
17441742

17451743
If ($synchash.Control_NetConfig_Tbx_VlanID.Text.Length -gt 0){
1746-
' -PublicVLan "' + $synchash.Control_NetConfig_Tbx_VlanID.Text + '"' | Add-Content $filepath -NoNewline
1744+
' -PublicVlanId "' + $synchash.Control_NetConfig_Tbx_VlanID.Text + '"' | Add-Content $filepath -NoNewline
17471745
}
17481746

17491747
If ($synchash.Control_NetConfig_Tbx_DnsForwarder.Text.Length -gt 0){
1750-
' -EnvironmentDNS "' + $synchash.Control_NetConfig_Tbx_DnsForwarder.Text + '"' | Add-Content $filepath -NoNewline
1748+
' -DNSForwarder "' + $synchash.Control_NetConfig_Tbx_DnsForwarder.Text + '"' | Add-Content $filepath -NoNewline
17511749
}
17521750

17531751
If ($synchash.Control_NetConfig_Tbx_TimeServer.Text.Length -gt 0){
@@ -1764,7 +1762,7 @@ Function F_Install {
17641762
#endregion Rerun Count
17651763

17661764
#region Install
1767-
Start-Process powershell $filepath
1765+
Start-Process powershell -ArgumentList "-noexit", "-file $filepath"
17681766
#endregion
17691767

17701768
}

Identity/AzureStack.Identity.psm1

Lines changed: 4 additions & 6 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-
3029
<#
3130
.Synopsis
3231
This function is used to create a Service Principal on teh AD Graph
@@ -315,8 +314,6 @@ function Register-AzsGuestDirectoryTenant {
315314
}
316315
}
317316

318-
319-
320317
<#
321318
.Synopsis
322319
Consents to the given Azure Stack instance within the callers's Azure Directory Tenant.
@@ -369,7 +366,7 @@ function Register-AzsWithMyDirectoryTenant {
369366
$refreshToken = Get-AzureRmUserRefreshToken -azureEnvironment $azureEnvironment -directoryTenantId $azureStackEnvironment.AdTenant -AutomationCredential $AutomationCredential
370367

371368
# Initialize the Graph PowerShell module to communicate with the correct graph service
372-
$graphEnvironment = ResolveGraphEnvironment $azureEnvironment
369+
$graphEnvironment = Resolve-GraphEnvironment $azureEnvironment
373370
Initialize-GraphEnvironment -Environment $graphEnvironment -DirectoryTenantId $DirectoryTenantName -RefreshToken $refreshToken
374371

375372
# Initialize the service principal for the Azure Stack Resource Manager application (allows us to acquire a token to ARM). If not specified, the sign-up flow must be completed via the Azure Stack portal first.
@@ -450,8 +447,9 @@ function Register-AzsWithMyDirectoryTenant {
450447
}
451448

452449
Export-ModuleMember -Function @(
453-
"Register-AzsWithMyDirectoryTenant",
454450
"Register-AzsGuestDirectoryTenant",
451+
"Register-AzsWithMyDirectoryTenant",
455452
"Get-AzsDirectoryTenantidentifier",
456453
"New-AzsADGraphServicePrincipal"
457-
)
454+
455+
)

Infrastructure/AzureStack.Infra.psm1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,46 @@ function Get-AzsBackup {
694694

695695
Export-ModuleMember -Function Get-AzsBackup
696696

697+
<#
698+
.SYNOPSIS
699+
Set Azure Stack geographic location information
700+
#>
701+
702+
function Set-AzSLocationInformation {
703+
param(
704+
[Parameter(Mandatory = $false)]
705+
[string] $Location,
706+
707+
[Parameter(Mandatory = $true)]
708+
[string] $Latitude = '47.608013',
709+
710+
[Parameter(Mandatory = $true)]
711+
[string] $Longitude = '-122.335167'
712+
)
713+
714+
$Location = Get-AzsHomeLocation -Location $Location
715+
716+
$resourceType = "Microsoft.Subscriptions.Admin/locations"
717+
$apiVersion = "2015-11-01"
718+
719+
$locationResource = Get-AzureRmResource -ResourceType $resourceType -ResourceName $Location -ApiVersion $apiVersion
720+
721+
$params = @{
722+
ResourceName = $Location
723+
ResourceType = $resourceType
724+
ApiVersion = $apiVersion
725+
Properties = @{
726+
Id = $locationResource.ResourceId
727+
Name = $locationResource.Name
728+
DisplayName = $locationResource.Name
729+
Latitude = $Latitude
730+
Longitude = $Longitude
731+
}
732+
}
733+
734+
New-AzureRmResource @params -IsFullObject -Force
735+
}
736+
697737
<#
698738
.SYNOPSIS
699739
Start Infrastructure Backup

Infrastructure/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ The command does the following:
167167
Does return the total capacity of the storage subsystem
168168

169169
```powershell
170-
Get-AzsStorageCapacity
170+
Get-AzSStorageSubsystem
171171
```
172172

173173
The command does the following:
@@ -223,7 +223,7 @@ The command does the following:
223223
Does list all SLB MUX Instances
224224

225225
```powershell
226-
Get-AzSLBMux
226+
Get-AzsSLBMux
227227
```
228228

229229
The command does the following:
@@ -476,6 +476,6 @@ $latitude = '12.972442'
476476
$longitude = '77.580643'
477477
$regionName = 'local'
478478
479-
Set-AzsLocationInformation -Region $regionName -Latitude $latitude -Longitude $longitude
479+
Set-AzsLocationInformation -Location $regionName -Latitude $latitude -Longitude $longitude
480480
481481
```

Infrastructure/Tests/Infra.Tests.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ InModuleScope $script:ModuleName {
4444
{ Get-AzsScaleUnitNode } |
4545
Should Not Throw
4646
}
47-
It 'Get-AzsStorageCapacity should not throw' {
48-
{ Get-AzsStorageCapacity } |
47+
It 'Get-AzsStorageSubsystem should not throw' {
48+
{ Get-AzsStorageSubsystem } |
4949
Should Not Throw
5050
}
5151
It 'Get-AzsInfraRole should not throw' {
@@ -64,9 +64,8 @@ InModuleScope $script:ModuleName {
6464
{ Get-Azslogicalnetwork } |
6565
Should Not Throw
6666
}
67-
68-
It 'Get-AzsUpdateSummary should not throw' {
69-
{ Get-AzsUpdateSummary } |
67+
It 'Get-AzsUpdateLocation should not throw' {
68+
{ Get-AzsUpdateLocation } |
7069
Should Not Throw
7170
}
7271
It 'Get-AzsUpdate should not throw' {

ServiceAdmin/AzureStack.ServiceAdmin.psm1

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,13 @@
88
Creates "default" tenant offer with unlimited quotas across Compute, Network, Storage and KeyVault services.
99
#>
1010

11-
function Add-AzsStorageQuota {
11+
function New-AzsComputeQuota {
1212
param(
1313
[string] $Name = "default",
14-
[int] $CapacityInGb = 1000,
15-
[int] $NumberOfStorageAccounts = 2000,
16-
[string] $Location = $null
17-
)
18-
19-
$Location = Get-AzsHomeLocation -Location $Location
20-
21-
$params = @{
22-
ResourceName = "{0}/{1}" -f $Location, $Name
23-
ResourceType = "Microsoft.Storage.Admin/locations/quotas"
24-
ApiVersion = "2015-12-01-preview"
25-
Properties = @{
26-
capacityInGb = $CapacityInGb
27-
numberOfStorageAccounts = $NumberOfStorageAccounts
28-
}
29-
}
30-
31-
New-AzsServiceQuota @params
32-
}
33-
34-
function Add-AzsComputeQuota {
35-
param(
36-
[string] $Name = "default",
37-
[int] $VmCount = 1000,
38-
[int] $MemoryLimitMB = 1048576,
39-
[int] $CoresLimit = 1000,
14+
[int] $CoresLimit = 200,
15+
[int] $VirtualMachineCount = 50,
16+
[int] $AvailabilitySetCount = 10,
17+
[int] $VmScaleSetCount = 10,
4018
[string] $Location = $null
4119
)
4220

@@ -47,16 +25,17 @@ function Add-AzsComputeQuota {
4725
ResourceType = "Microsoft.Compute.Admin/locations/quotas"
4826
ApiVersion = "2015-12-01-preview"
4927
Properties = @{
50-
virtualMachineCount = $VmCount
51-
memoryLimitMB = $MemoryLimitMB
52-
coresLimit = $CoresLimit
28+
virtualMachineCount = $VirtualMachineCount
29+
availabilitySetCount = $AvailabilitySetCount
30+
coresLimit = $CoresLimit
31+
vmScaleSetCount = $VmScaleSetCount
5332
}
5433
}
5534

5635
New-AzsServiceQuota @params
5736
}
5837

59-
function Add-AzsNetworkQuota {
38+
function New-AzsNetworkQuota {
6039
param(
6140
[string] $Name = "default",
6241
[int] $PublicIpsPerSubscription = 500,
@@ -145,7 +124,15 @@ function New-AzsServiceQuota {
145124
)
146125

147126
$serviceQuota = New-AzureRmResource -ResourceName $ResourceName -ResourceType $ResourceType -ApiVersion $ApiVersion -Properties $Properties -Force
148-
$serviceQuota.ResourceId
127+
$quotaObject = New-Object PSObject
128+
foreach ($property in ($serviceQuota.Properties | Get-Member -MemberType NoteProperty)){
129+
$quotaObject | Add-Member NoteProperty -Name $property.Name -Value $serviceQuota.Properties.($property.Name)
130+
}
131+
$quotaObject | Add-Member NoteProperty Name($serviceQuota.ResourceName)
132+
$quotaObject | Add-Member NoteProperty Type($serviceQuota.ResourceType)
133+
$quotaObject | Add-Member NoteProperty Location($serviceQuota.Location)
134+
$quotaObject | Add-Member NoteProperty Id($serviceQuota.ResourceId)
135+
$quotaObject
149136
}
150137

151138
function Get-AzsServiceQuota {

0 commit comments

Comments
 (0)