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

User/brod/constrained #179

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
42 changes: 25 additions & 17 deletions PrivateCloud.DiagnosticInfo/PrivateCloud.DiagnosticInfo.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2016,17 +2016,23 @@ function Get-SddcDiagnosticInfo

$JobStatic += start-job -Name CauDebugTrace {
try {

# SCDT returns a fileinfo object for the saved ZIP on the pipeline; discard (allow errors/warnings to flow as normal)
$parameters = (Get-Command Save-CauDebugTrace).Parameters.Keys
if ($parameters -contains "FeatureUpdateLogs") {
$null = Save-CauDebugTrace -Cluster $using:AccessNode -FeatureUpdateLogs All -FilePath $using:Path
if ($executionContext.SessionState.LanguageMode -eq "FullLanguage")
{
# SCDT returns a fileinfo object for the saved ZIP on the pipeline; discard (allow errors/warnings to flow as normal)
$parameters = (Get-Command Save-CauDebugTrace).Parameters.Keys
if ($parameters -contains "FeatureUpdateLogs") {
$null = Save-CauDebugTrace -Cluster $using:AccessNode -FeatureUpdateLogs All -FilePath $using:Path
}
else {
$null = Save-CauDebugTrace -Cluster $using:AccessNode -FilePath $using:Path
}
}
else {
$null = Save-CauDebugTrace -Cluster $using:AccessNode -FilePath $using:Path
else
{
Write-Host "Skipping CauDebugTrace because cannot run Save-CAUDebugTrace in constrained language mode."
}
}
catch { Show-Warning("Unable to get CAU debug trace. `nError="+$_.Exception.Message) }
catch { Write-Warning("Unable to get CAU debug trace. `nError="+$_.Exception.Message) }
}

} else {
Expand Down Expand Up @@ -3783,31 +3789,32 @@ function Get-SddcDiagnosticArchiveJobParameters

$c = Get-Cluster -Name $Cluster -ErrorAction Stop

if ($PSBoundParameters.ContainsKey('Days')) {
$psBoundParametersKeys = $PSBoundParameters.Keys
if ($psBoundParametersKeys -contains 'Days') {
try {
$Days.Value = ($c | Get-ClusterParameter -Name SddcDiagnosticArchiveDays -ErrorAction Stop).Value
} catch {
$Days.Value = 60
}
}

if ($PSBoundParameters.ContainsKey('Path')) {
if ($psBoundParametersKeys -contains 'Path') {
try {
$Path.Value = ($c | Get-ClusterParameter -Name SddcDiagnosticArchivePath -ErrorAction Stop).Value
} catch {
$Path.Value = Join-Path $env:SystemRoot "SddcDiagnosticArchive"
}
}

if ($PSBoundParameters.ContainsKey('Size')) {
if ($psBoundParametersKeys -contains 'Size') {
try {
$Size.Value = ($c | Get-ClusterParameter -Name SddcDiagnosticArchiveSize -ErrorAction Stop).Value
} catch {
$Size.Value = 500MB
}
}

if ($PSBoundParameters.ContainsKey('At')) {
if ($psBoundParametersKeys -contains 'At') {
try {
$Task = Get-ClusteredScheduledTask -Cluster $c.Name -TaskName SddcDiagnosticArchive -ErrorAction Stop

Expand Down Expand Up @@ -4905,7 +4912,7 @@ function Get-StorageBusCacheReport
Label = 'CacheDevice#'; Expression = {
if ($_.IsSblCacheDevice -eq 'true') {
'= cache'
} elseif ($idmap.ContainsKey($_.CacheDeviceId)) {
} elseif ($idmap.Keys -contains $_.CacheDeviceId) {
$idmap[$_.CacheDeviceId]
} elseif ($_.CacheDeviceId -eq '{00000000-0000-0000-0000-000000000000}') {
"= unbound"
Expand Down Expand Up @@ -5185,7 +5192,8 @@ function Get-StorageLatencyReport
# is the count scheme split (RS5) or combined (RS1)?
# match 1 is the bucket type
# match 2 is the value bucket number (1 .. n)
if ($xh.ContainsKey("BucketIoSuccess1")) {
$xhKeys = $xh.Keys
if ($xhKeys -contains "BucketIoSuccess1") {
$schemasplit = $true
$buckvalueschema = "^BucketIo(Success|Failed)(\d+)$"
} else {
Expand Down Expand Up @@ -5299,7 +5307,7 @@ function Get-StorageLatencyReport
}

# now place the counting array into the device hash; each nonzero bucket adds +1
if (-not $buckhash.ContainsKey($dev)) {
if (-not ($buckhash.Keys -contains $dev)) {
# new device
$buckhash[$dev] = $buckvalues |% { if ($_) { 1 } else { 0 }}
} else {
Expand Down Expand Up @@ -5396,7 +5404,7 @@ function Get-StorageLatencyReport
# to inject them.

# output the table of device latency bucket counts
$buckhash.Keys |? { $PhysicalDisksTable.ContainsKey($_) } |% {
$buckhash.Keys |? { $PhysicalDisksTable.Keys -contains $_ } |% {

$dev = $_

Expand Down Expand Up @@ -5430,7 +5438,7 @@ function Get-StorageLatencyReport

$n = 0
if ($null -ne $evs) {
$evs |? { $PhysicalDisksTable.ContainsKey($_.Device) } |% { $n += 1; $_ } | sort Time -Descending | ft -AutoSize ('Time','Device' + $pdattrs_ev + $bucklabels)
$evs |? { $PhysicalDisksTable.Keys -contains $_.Device } |% { $n += 1; $_ } | sort Time -Descending | ft -AutoSize ('Time','Device' + $pdattrs_ev + $bucklabels)
}

if ($n -eq 0) {
Expand Down