Skip to content

Commit eae10b7

Browse files
authored
Merge pull request #47 from rebelinux/dev
Nvme Improvements
2 parents 538ed4b + 7090cb2 commit eae10b7

7 files changed

+365
-4
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: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
function Get-AbrOntapVserverNamespaceStorage {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve NetApp ONTAP vserver 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+
[string]
22+
$Vserver
23+
)
24+
25+
begin {
26+
Write-PScriboMessage "Collecting ONTAP Vserver namespace information."
27+
}
28+
29+
process {
30+
try {
31+
$VserverNamespace = Get-NcNvmeNamespace -VserverContext $Vserver -Controller $Arra
32+
$VserverObj = @()
33+
if ($VserverNamespace) {
34+
foreach ($Item in $VserverNamespace) {
35+
try {
36+
$namespacemap = Get-NcNvmeSubsystemMap -Vserver $Vserver -Controller $Array | Where-Object { $_.Path -eq $Item.Path }
37+
$namespacepath = $Item.Path.split('/')
38+
$namespace = $namespacepath[3]
39+
$available = $Item.Size - $Item.SizeUsed
40+
$used = ($Item.SizeUsed / $Item.Size) * 100
41+
$inObj = [ordered] @{
42+
'Namespace Name' = $namespace
43+
'Parent Volume' = $Item.Volume
44+
'Path' = $Item.Path
45+
'Serial Number' = $Item.Uuid
46+
'Subsystem Map' = Switch (($namespacemap).count) {
47+
0 { "None" }
48+
default { $namespacemap.Subsystem }
49+
}
50+
'Home Node ' = $Item.Node
51+
'Capacity' = $Item.Size | ConvertTo-FormattedNumber -Type Datasize -ErrorAction SilentlyContinue
52+
'Available' = $available | ConvertTo-FormattedNumber -Type Datasize -ErrorAction SilentlyContinue
53+
'Used' = $used | ConvertTo-FormattedNumber -Type Percent -ErrorAction SilentlyContinue
54+
'OS Type' = $Item.Ostype
55+
'Is Mapped' = Switch ([string]::IsNullOrEmpty($Item.Subsystem)) {
56+
$true { "No" }
57+
$false { "Yes" }
58+
default { $Item.Subsystem }
59+
}
60+
'ReadOnly' = ConvertTo-TextYN $Item.IsReadOnly
61+
'Status' = Switch ($Item.State) {
62+
'online' { 'Up' }
63+
'offline' { 'Down' }
64+
default { $Item.Online }
65+
}
66+
}
67+
$VserverObj = [pscustomobject]$inobj
68+
69+
if ($Healthcheck.Vserver.Status) {
70+
$VserverObj | Where-Object { $_.'Status' -like 'Down' } | Set-Style -Style Warning -Property 'Status'
71+
$VserverObj | Where-Object { $_.'Used' -ge 90 } | Set-Style -Style Critical -Property 'Used'
72+
$VserverObj | Where-Object { $_.'Is Mapped' -eq 'No' } | Set-Style -Style Warning -Property 'Is Mapped'
73+
}
74+
75+
$TableParams = @{
76+
Name = "Namespace - $($namespace)"
77+
List = $true
78+
ColumnWidths = 25, 75
79+
}
80+
if ($Report.ShowTableCaptions) {
81+
$TableParams['Caption'] = "- $($TableParams.Name)"
82+
}
83+
$VserverObj | Sort-Object -Property 'Namespace Name' | Table @TableParams
84+
} catch {
85+
Write-PScriboMessage -IsWarning $_.Exception.Message
86+
}
87+
}
88+
}
89+
} catch {
90+
Write-PScriboMessage -IsWarning $_.Exception.Message
91+
}
92+
}
93+
94+
end {}
95+
96+
}
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+
}

0 commit comments

Comments
 (0)