Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

few fixes #559

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions Scenarios/AzSHCI and Dell Servers Update/Scenario.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@
#create downloads folder
if (-not (Test-Path $DellToolsDownloadFolder -ErrorAction Ignore)){New-Item -Path $DellToolsDownloadFolder -ItemType Directory}
#grab DSU links from Dell website
if (-not ([Net.ServicePointManager]::SecurityProtocol).tostring().contains("Tls12")){ #there is no need to set Tls12 in 1809 releases, therefore for insider it does not apply
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
}
$URL="https://dl.dell.com/omimswac/dsu/"
$Results=Invoke-WebRequest $URL -UseDefaultCredentials
$Results=Invoke-WebRequest $URL -UseDefaultCredentials -UseBasicParsing
$Links=$results.Links.href | Select-Object -Skip 1
#create PSObject from results
$DSUs=@()
Expand Down Expand Up @@ -337,6 +340,8 @@ if ($offline){
New-PSSessionConfigurationFile -RunAsVirtualAccount -Path $env:TEMP\VirtualAccount.pssc
Register-PSSessionConfiguration -Name 'VirtualAccount' -Path $env:TEMP\VirtualAccount.pssc -Force
} -ErrorAction Ignore
#wait a bit for virtual account
Start-Sleep 5
#install update
$MSUpdateInstallResult=Invoke-Command -ComputerName $Node -ConfigurationName 'VirtualAccount' {
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
Expand Down Expand Up @@ -400,9 +405,15 @@ if ($offline){
Write-Output "$(get-date -Format 'yyyy/MM/dd hh:mm:ss tt') $($Node): Reboot is required"
#restart node and wait for PowerShell to come up (with powershell 7 you need to wait for WINRM :)
Write-Output "$(get-date -Format 'yyyy/MM/dd hh:mm:ss tt') $($Node): Restarting Cluster Node"
Restart-Computer -ComputerName $Node -Protocol WSMan -Wait -For PowerShell | Out-Null
Restart-Computer -ComputerName $Node -Protocol WSMan -Wait -For PowerShell -Force | Out-Null
}

#wait until node is in paused state (might not be yet up - cluster service)
do {
$State=(Get-ClusterNode -Cluster $ClusterName).State
Start-Sleep 5
}while($state -ne "Paused")

#disable storage maintenance mode
Write-Output "$(get-date -Format 'yyyy/MM/dd hh:mm:ss tt') $($Node): Disabling Storage Maintenance mode"
Get-StorageFaultDomain -Type StorageScaleUnit -CimSession $Node | Where-Object FriendlyName -eq $Node | Disable-StorageMaintenanceMode -CimSession $Node
Expand Down