Skip to content

Commit

Permalink
Merge pull request #506 from microsoft/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jaromirk authored Mar 31, 2022
2 parents 00bb1c7 + 55ddef1 commit c50c830
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 103 deletions.
98 changes: 0 additions & 98 deletions Scenarios/AzSHCI Deployment/Scenario.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1050,104 +1050,6 @@
start-sleep 10
#endregion

#region (optional) register your Dell partner ID to your Azure Subscription https://docs.microsoft.com/en-us/partner-center/link-partner-id-for-azure-performance-pal-dpor
if ($DellHW){
#define list of Location PAL IDs
$CSV=@"
Argentina;1973856
Australia;1576776
Austria;1444496
Belgium;1447258
Brazil;1563635
Canada;742767
Chile;2389235
China;2580218
Colombia;1736279
Czech Republic;1980606
Denmark;1449600
Egypt;6462248
Finland;1993462
France;892181
Germany;1449416
Greece;3679221
Hong Kong Sar;2790298
India;2419713
Indonesia;2834572
Ireland;1447272
Israel;6462253
Italy;1446223
Japan;578508
Korea;2153293
Luxembourg;6462292
Malaysia;2731874
Mexico;724848
Morocco;6462283
Netherlands;1446198
New Zealand;1872429
Norway;1446238
Pakistan;6462648
Panama;1477223
Peru;6466758
Poland;3697305
Portugal;1552205
Romania;1735552
Russia;4543982
Singapore;2773797
Slovakia;3812320
South Africa;1970176
Spain;1004323
Sweden;1449417
Switzerland;1449592
Taiwan;5097219
Thailand;2345177
Turkey;3396579
United Arab Emirates;3159758
United Kingdom;1447267
United States;913990
"@
$Header = 'Country', 'LocationID'
$PALIDs=ConvertFrom-Csv -Delimiter ";" -InputObject $CSV -Header $Header

#Install Azure packages
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
$ModuleNames="Az.Accounts","Az.Resources","Az.ManagementPartner"
foreach ($ModuleName in $ModuleNames){
if (!(Get-InstalledModule -Name $ModuleName -ErrorAction Ignore)){
Install-Module -Name $ModuleName -Force
}
}

#login to Azure (if not logged in already)
if (-not (Get-AzContext)){
Login-AzAccount -UseDeviceAuthentication
}

$RegistrationInfo=Get-AzManagementPartner -ErrorAction Ignore
<#
if ($RegistrationInfo -eq $null){
Write-Host "Partner registration not found" -ForegroundColor Red
}else{
Write-Host "Following partner registration found:" -ForegroundColor Green
$RegistrationInfo
}
#>

#Select location
$LocationID=$PALIDs | Out-GridView -Title "Please select location ID" -OutputMode Single

#register new partner
if ($RegistrationInfo){
Update-AzManagementPartner -PartnerId $LocationID.LocationID
}else{
New-AzManagementPartner -PartnerId $LocationID.LocationID
}

#remove
#$RegistrationInfo=Get-AzManagementPartner
#Remove-AzManagementPartner -PartnerID $RegistrationInfo.PartnerID
}
#endregion

#region (optional - just an example) Create some VMs (3 per each CSV disk) https://github.com/Microsoft/WSLab/tree/master/Scenarios/S2D%20and%20Bulk%20VM%20creation
Start-Sleep -Seconds 60 #just to a bit wait as I saw sometimes that first VMs fails to create
if ($realVMs -and $VHDPath){
Expand Down
4 changes: 2 additions & 2 deletions Scenarios/AzSHCI and AVD/Scenario.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@
$imageOSDisk = @{Id = $ImageVersionID}
$OSDiskConfig = New-AzDiskConfig -Location $HostPoolLocation -CreateOption "FromImage" -ImageReference $imageOSDisk
New-AzDisk -ResourceGroupName $AVDResourceGroupName -DiskName $ManagedDiskName -Disk $OSDiskConfig
$output=Grant-AzDiskAccess -ResourceGroupName $AVDResourceGroupName -DiskName $ManagedDiskName -Access 'Read' -DurationInSecond 3600
$output=Grant-AzDiskAccess -ResourceGroupName $AVDResourceGroupName -DiskName $ManagedDiskName -Access 'Read' -DurationInSecond 36000 #10 hours
$SAS=$output.accesssas
#Start-BitsTransfer -Source $SAS -Destination "\\$ClusterName\ClusterStorage$\$LibraryVolumeName\$SKU.vhd"
#download using AzCopy as it's faster than bits transfer. But it cannot be downloaded directly to CSV
#download using AzCopy as it's faster than bits transfer
#https://aka.ms/downloadazcopy-v10-windows\
# Download the package
Start-BitsTransfer -Source "https://aka.ms/downloadazcopy-v10-windows" -Destination "$env:UserProfile\Downloads\AzCopy.zip"
Expand Down
2 changes: 1 addition & 1 deletion Scenarios/AzSHCI and MDT/Scenario.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$Files+=@{Uri="https://go.microsoft.com/fwlink/?linkid=2166133" ; FileName="adkwinpesetup.exe" ; Description="WindowsPE for Windows 11 21H2"}
$Files+=@{Uri="https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492/MicrosoftDeploymentToolkit_x64.msi" ; FileName="MicrosoftDeploymentToolkit_x64.msi" ; Description="Microsoft Deployment Toolkit"}
#$Files+=@{Uri="https://software-download.microsoft.com/download/pr/AzureStackHCI_17784.1408_EN-US.iso" ; FileName="AzureStackHCI_17784.1408_EN-US.iso" ; Description="Azure Stack HCI ISO"}
$Files+=@{Uri="https://software-download.microsoft.com/download/sg/AzureStackHCI_20348.288_en-us.iso" ; FileName="AzureStackHCI_20348.288_en-us.iso" ; Description="Azure Stack HCI ISO"}
$Files+=@{Uri="https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/AzureStackHCI_20348.587_en-us.iso" ; FileName="AzureStackHCI_20348.587_en-us.iso" ; Description="Azure Stack HCI ISO"}
$Files+=@{Uri="https://go.microsoft.com/fwlink/?linkid=866658" ; FileName="SQL2019-SSEI-Expr.exe" ; Description="SQL Express 2019"}
#$Files+=@{Uri="https://aka.ms/ssmsfullsetup" ; FileName="SSMS-Setup-ENU.exe" ; Description="SQL Management Studio"}
foreach ($file in $files){
Expand Down
12 changes: 10 additions & 2 deletions Scripts/2_CreateParentDisks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,10 @@ If (-not $isAdmin) {
if ($DC.AutomaticCheckpointsEnabled -eq $True){
$DC | Set-VM -AutomaticCheckpointsEnabled $False
}
if ($LabConfig.InstallSCVMM -eq "Yes"){
#SCVMM 2022 requires 4GB of memory
$DC | Set-VMMemory -StartupBytes 4GB -MinimumBytes 4GB
}

#Apply Unattend to VM
if ($VMVersion.Build -ge 17763){
Expand Down Expand Up @@ -1017,8 +1021,12 @@ If (-not $isAdmin) {
Invoke-Command -VMGuid $DC.id -Credential $cred -ScriptBlock {
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force
d:\scvmm\1_SQL_Install.ps1
d:\scvmm\2_ADK_Install.ps1
Restart-Computer
d:\scvmm\2_ADK_Install.ps1
#install prereqs
if (Test-Path "D:\SCVMM\SCVMM\Prerequisites\VCRedist\amd64\vcredist_x64.exe"){
Start-Process -FilePath "D:\SCVMM\SCVMM\Prerequisites\VCRedist\amd64\vcredist_x64.exe" -ArgumentList "/passive /quiet /norestart" -Wait
}
Restart-Computer
}
Start-Sleep 10

Expand Down

0 comments on commit c50c830

Please sign in to comment.