Skip to content

Commit 7090cb2

Browse files
committed
Improvements to NVME section
1 parent c1f5fe1 commit 7090cb2

6 files changed

+258
-16
lines changed

Src/Private/Get-AbrOntapEfficiencyAggr.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function Get-AbrOntapEfficiencyAggr {
9191
}
9292
if ($OutObj) {
9393
Section -Style Heading4 'HealthCheck - Volume with Disabled Deduplication' {
94-
Paragraph "The following section provides the Volume efficiency healthcheck Information on $($ClusterInfo.ClusterName)."
94+
Paragraph "The following table provides the Volume efficiency healthcheck Information on $($ClusterInfo.ClusterName)."
9595
BlankLine
9696
$OutObj | Table @TableParams
9797
}

Src/Private/Get-AbrOntapNetworkMGMT.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function Get-AbrOntapNetworkMgmt {
198198
try {
199199
if ((Get-NcNetInterface -Controller $Array | Where-Object { $_.DataProtocols -ne 'fcp' -and $_.IsHome -like "False" }) -and $Healthcheck.Network.Interface) {
200200
Section -ExcludeFromTOC -Style Heading6 'HealthCheck - Check If Network Interface is Home' {
201-
Paragraph "The following section provides the LIF Home Status Information on $($ClusterInfo.ClusterName)."
201+
Paragraph "The following table provides the LIF Home Status Information on $($ClusterInfo.ClusterName)."
202202
BlankLine
203203
$ClusterData = Get-NcNetInterface -Controller $Array | Where-Object { $_.DataProtocols -ne 'fcp' -and $_.IsHome -like "False" }
204204
$ClusterObj = @()
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
function Get-AbrOntapVserverCGNamespace {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve NetApp ONTAP Vserver Consistency Groups Namespace information from the Cluster Management Network
5+
.DESCRIPTION
6+
7+
.NOTES
8+
Version: 0.6.7
9+
Author: Jonathan Colon
10+
Twitter: @jcolonfzenpr
11+
Github: rebelinux
12+
.EXAMPLE
13+
14+
.LINK
15+
16+
#>
17+
param (
18+
[Parameter (
19+
Position = 0,
20+
Mandatory)]
21+
$CGObj
22+
)
23+
24+
begin {
25+
Write-PScriboMessage "Collecting ONTAP Vserver Consistency Groups namespace information."
26+
}
27+
28+
process {
29+
try {
30+
$NamespaceData = $CGObj.namespaces
31+
$CGNamespaceObj = @()
32+
if ($NamespaceData) {
33+
foreach ($Item in $NamespaceData) {
34+
try {
35+
$inObj = [ordered] @{
36+
'Name' = $Item.Name.Split('/')[3]
37+
'Capacity' = Switch ([string]::IsNullOrEmpty($Item.space.size)) {
38+
$true { '-' }
39+
$false { $Item.space.size | ConvertTo-FormattedNumber -Type Datasize -ErrorAction SilentlyContinue }
40+
default { '-' }
41+
}
42+
'Used' = Switch ([string]::IsNullOrEmpty($Item.space.used)) {
43+
$true { '-' }
44+
$false { $Item.space.used | ConvertTo-FormattedNumber -Type Datasize -ErrorAction SilentlyContinue }
45+
default { '-' }
46+
}
47+
'OS Type' = ConvertTo-EmptyToFiller $Item.os_type
48+
'Volume State' = $Item.status.container_state
49+
'Mapped' = ConvertTo-TextYN $Item.status.mapped
50+
'Read Only' = ConvertTo-TextYN $Item.status.read_only
51+
'State' = $Item.status.state
52+
53+
54+
}
55+
$CGNamespaceObj += [pscustomobject]$inobj
56+
} catch {
57+
Write-PScriboMessage -IsWarning $_.Exception.Message
58+
}
59+
}
60+
61+
if ($Healthcheck.Vserver.CG) {
62+
$CGNamespaceObj | Where-Object { $_.'Volume State' -ne 'online' } | Set-Style -Style Warning -Property 'Volume State'
63+
$CGNamespaceObj | Where-Object { $_.'Mapped' -eq 'No' } | Set-Style -Style Warning -Property 'Mapped'
64+
$CGNamespaceObj | Where-Object { $_.'Read Only' -eq 'Yes' } | Set-Style -Style Warning -Property 'Read Only'
65+
$CGNamespaceObj | Where-Object { $_.'State' -eq 'offline' } | Set-Style -Style Warning -Property 'State'
66+
}
67+
68+
$TableParams = @{
69+
Name = "Consistency Group Namespace - $($CGObj.Name)"
70+
List = $false
71+
ColumnWidths = 30, 10, 9, 10, 11, 10, 10, 10
72+
}
73+
if ($Report.ShowTableCaptions) {
74+
$TableParams['Caption'] = "- $($TableParams.Name)"
75+
}
76+
$CGNamespaceObj | Sort-Object -Property Name | Table @TableParams
77+
}
78+
} catch {
79+
Write-PScriboMessage -IsWarning $_.Exception.Message
80+
}
81+
}
82+
83+
end {}
84+
85+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
function Get-AbrOntapVserverNonMappedNamespace {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve NetApp ONTAP NVMW Non Mapped amespace information from the Cluster Management Network
5+
.DESCRIPTION
6+
7+
.NOTES
8+
Version: 0.6.7
9+
Author: Jonathan Colon
10+
Twitter: @jcolonfzenpr
11+
Github: rebelinux
12+
.EXAMPLE
13+
14+
.LINK
15+
16+
#>
17+
param (
18+
[Parameter (
19+
Position = 0,
20+
Mandatory)]
21+
[string]
22+
$Vserver
23+
)
24+
25+
begin {
26+
Write-PScriboMessage "Collecting ONTAP NVME Non Mapped Namespace information."
27+
}
28+
29+
process {
30+
try {
31+
$NamespaceFilter = Get-NcNvmeNamespace -VserverContext $Vserver -Controller $Array | Where-Object { -Not $_.Subsystem }
32+
$OutObj = @()
33+
if ($NamespaceFilter) {
34+
foreach ($Item in $NamespaceFilter) {
35+
try {
36+
$namespacename = (($Item.Path).split('/'))[3]
37+
$inObj = [ordered] @{
38+
'Volume Name' = $Item.Volume
39+
'Lun Name' = $namespacename
40+
'Type' = $Item.Ostype
41+
'Mapped' = "No"
42+
'State' = $Item.State
43+
}
44+
$OutObj += [pscustomobject]$inobj
45+
} catch {
46+
Write-PScriboMessage -IsWarning $_.Exception.Message
47+
}
48+
}
49+
if ($Healthcheck.Vserver.Status) {
50+
$OutObj | Set-Style -Style Warning
51+
}
52+
53+
$TableParams = @{
54+
Name = "HealthCheck - Non-Mapped Namespace - $($Vserver)"
55+
List = $false
56+
ColumnWidths = 30, 30, 10, 10, 20
57+
}
58+
if ($Report.ShowTableCaptions) {
59+
$TableParams['Caption'] = "- $($TableParams.Name)"
60+
}
61+
$OutObj | Table @TableParams
62+
}
63+
} catch {
64+
Write-PScriboMessage -IsWarning $_.Exception.Message
65+
}
66+
}
67+
68+
end {}
69+
70+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
function Get-AbrOntapVserverSubsystem {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve NetApp ONTAP vserver subsystem information from the Cluster Management Network
5+
.DESCRIPTION
6+
7+
.NOTES
8+
Version: 0.6.7
9+
Author: Jonathan Colon
10+
Twitter: @jcolonfzenpr
11+
Github: rebelinux
12+
.EXAMPLE
13+
14+
.LINK
15+
16+
#>
17+
param (
18+
[Parameter (
19+
Position = 0,
20+
Mandatory)]
21+
[string]
22+
$Vserver
23+
)
24+
25+
begin {
26+
Write-PScriboMessage "Collecting ONTAP Vserver Subsystem information."
27+
}
28+
29+
process {
30+
try {
31+
$VserverSubsystem = Get-NcNvmeSubsystem -VserverContext $Vserver -Controller $Array
32+
$VserverObj = @()
33+
if ($VserverSubsystem) {
34+
foreach ($Item in $VserverSubsystem) {
35+
try {
36+
$namespacemap = Get-NcNvmeSubsystemMap -Controller $Array | Where-Object { $_.Subsystem -eq $Item.Subsystem } | Select-Object -ExpandProperty Path
37+
$MappedNamespace = @()
38+
foreach ($namespace in $namespacemap) {
39+
try {
40+
$namespacename = $namespace.split('/')
41+
$MappedNamespace += $namespacename[3]
42+
} catch {
43+
Write-PScriboMessage -IsWarning $_.Exception.Message
44+
}
45+
}
46+
$inObj = [ordered] @{
47+
'Subsystem Name' = $Item.Subsystem
48+
'Type' = $Item.Ostype
49+
'Target NQN' = $Item.TargetNqn
50+
'Host NQN' = $Item.Hosts.Nqn
51+
'Mapped Namespace' = Switch (($MappedNamespace).count) {
52+
0 { "None" }
53+
default { $MappedNamespace }
54+
}
55+
}
56+
$VserverObj = [pscustomobject]$inobj
57+
if ($Healthcheck.Vserver.Status) {
58+
$VserverObj | Where-Object { ($_.'Mapped Namespace').count -eq 0 } | Set-Style -Style Warning -Property 'Mapped Namespace'
59+
}
60+
61+
$TableParams = @{
62+
Name = "Subsystem - $($Item.Subsystem)"
63+
List = $true
64+
ColumnWidths = 25, 75
65+
}
66+
if ($Report.ShowTableCaptions) {
67+
$TableParams['Caption'] = "- $($TableParams.Name)"
68+
}
69+
$VserverObj | Table @TableParams
70+
} catch {
71+
Write-PScriboMessage -IsWarning $_.Exception.Message
72+
}
73+
}
74+
}
75+
} catch {
76+
Write-PScriboMessage -IsWarning $_.Exception.Message
77+
}
78+
}
79+
80+
end {}
81+
82+
}

Src/Public/Invoke-AsBuiltReport.NetApp.ONTAP.ps1

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
507507
Get-AbrOntapVserverLunIgroup -Vserver $SVM
508508
}
509509
$NonMappedLun = Get-AbrOntapVserverNonMappedLun -Vserver $SVM
510-
if ($Healthcheck.Vserver.Status -and $NonMappedLunFCP) {
510+
if ($Healthcheck.Vserver.Status -and $NonMappedLun) {
511511
Section -ExcludeFromTOC -Style Heading6 'HealthCheck - Non-Mapped Lun Information' {
512512
Paragraph "The following section provides information of Non Mapped Lun on $($SVM)."
513513
BlankLine
@@ -525,19 +525,19 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
525525
Paragraph "The following section provides the Namespace Storage Information on $($SVM)."
526526
BlankLine
527527
Get-AbrOntapVserverNamespaceStorage -Vserver $SVM
528-
# if (Get-NcIgroup -Vserver $SVM -Controller $Array) {
529-
# Section -ExcludeFromTOC -Style Heading6 'Igroup Mapping' {
530-
# Get-AbrOntapVserverLunIgroup -Vserver $SVM
531-
# }
532-
# $NonMappedLun = Get-AbrOntapVserverNonMappedLun -Vserver $SVM
533-
# if ($Healthcheck.Vserver.Status -and $NonMappedLunFCP) {
534-
# Section -ExcludeFromTOC -Style Heading6 'HealthCheck - Non-Mapped Lun Information' {
535-
# Paragraph "The following section provides information of Non Mapped Lun on $($SVM)."
536-
# BlankLine
537-
# $NonMappedLun
538-
# }
539-
# }
540-
# }
528+
if (Get-NcNvmeSubsystem -Vserver $SVM -Controller $Array) {
529+
Section -ExcludeFromTOC -Style Heading6 'Subsystem Mapping' {
530+
Get-AbrOntapVserverSubsystem -Vserver $SVM
531+
}
532+
$NonMappedNamespace = Get-AbrOntapVserverNonMappedNamespace -Vserver $SVM
533+
if ($Healthcheck.Vserver.Status -and $NonMappedNamespace) {
534+
Section -ExcludeFromTOC -Style Heading6 'HealthCheck - Non-Mapped Namespace Information' {
535+
Paragraph "The following table provides information about Non Mapped Namespace on $($SVM)."
536+
BlankLine
537+
$NonMappedNamespace
538+
}
539+
}
540+
}
541541
}
542542
}
543543
#---------------------------------------------------------------------------------------------#
@@ -555,6 +555,11 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
555555
Get-AbrOntapVserverCGLun -CGObj $CG
556556
}
557557
}
558+
if ($CG.namespaces) {
559+
Section -ExcludeFromTOC -Style Heading6 "$($CG.name) Namespaces" {
560+
Get-AbrOntapVserverCGNamespace -CGObj $CG
561+
}
562+
}
558563
}
559564
}
560565
}

0 commit comments

Comments
 (0)