Skip to content

Commit ab64f83

Browse files
committed
Initial Vserver Nvme Supprot
1 parent 07f1a03 commit ab64f83

7 files changed

+267
-2
lines changed

AsBuiltReport.NetApp.ONTAP.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"Vserver": {
5656
"Status": true,
5757
"Iscsi": true,
58+
"Nvme": true,
5859
"FCP": true,
5960
"CG": true,
6061
"NFS": true,

CHANGELOG.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
# :arrows_counterclockwise: NetApp ONTAP Storage As Built Report Changelog
22

3-
## [0.6.7] - 2024-02-02
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.6.7] - Unreleased
9+
10+
### Added
11+
12+
- Initial Vserver NVME support
413

514
### Changed
615

7-
- Code Cleanup
16+
- Update the Eomm/why-don-t-you-tweet action to v2.0.0
17+
- General code cleanup/improvements
18+
- Increased Required Modules version:
19+
- AsBuiltReport.Core v1.4.0
20+
- NetApp.Ontap v9.15.1.2407
21+
22+
### Fixed
823

24+
- Fix [#40](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/40)
25+
- Fix [#41](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/41)
26+
- Fix [#42](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/42)
27+
- Fix [#43](https://github.com/AsBuiltReport/AsBuiltReport.NetApp.ONTAP/issues/43)
928

1029
## [0.6.6] - 2023-08-07
1130

Src/Private/Get-AbrOntapVserverFcpAdapter.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ function Get-AbrOntapVserverFcpAdapter {
5252
$TableParams = @{
5353
Name = "FCP Physical Adapter - $($ClusterInfo.ClusterName)"
5454
List = $false
55+
ColumnWidths = 32, 17, 17, 17, 17
5556
}
5657
if ($Report.ShowTableCaptions) {
5758
$TableParams['Caption'] = "- $($TableParams.Name)"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
function Get-AbrOntapVserverNvmeFcAdapter {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve NetApp ONTAP Vserver Nvme FC adapter 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 Nvme FC adapter information."
27+
}
28+
29+
process {
30+
try {
31+
$VserverData = Get-NcNvmeInterface -VserverContext $Vserver -Controller $Array | Where-Object {$_.PhysicalProtocol -eq 'fibre_channel'} | Sort-Object -Property HomeNode
32+
$VserverObj = @()
33+
if ($VserverData) {
34+
foreach ($Item in $VserverData) {
35+
try {
36+
$inObj = [ordered] @{
37+
'Node Name' = $Item.HomeNode
38+
'Adapter' = $Item.HomePort
39+
'Protocol' = $Item.PhysicalProtocol
40+
'WWNN' = $Item.FcWwnn
41+
'WWPN' = $Item.FcWwpn
42+
'Status' = Switch ($Item.StatusAdmin) {
43+
'up' { 'Up' }
44+
'down' { 'Down' }
45+
default { $Item.StatusAdmin }
46+
}
47+
}
48+
$VserverObj += [pscustomobject]$inobj
49+
} catch {
50+
Write-PScriboMessage -IsWarning $_.Exception.Message
51+
}
52+
}
53+
if ($Healthcheck.Vserver.FCP) {
54+
$VserverObj | Where-Object { $_.'Status' -like 'Down' } | Set-Style -Style Warning -Property 'Status'
55+
}
56+
57+
$TableParams = @{
58+
Name = "Nvme FC Physical Adapter - $($Vserver)"
59+
List = $false
60+
ColumnWidths = 25, 12, 15, 18, 18, 12
61+
62+
}
63+
if ($Report.ShowTableCaptions) {
64+
$TableParams['Caption'] = "- $($TableParams.Name)"
65+
}
66+
$VserverObj | Table @TableParams
67+
}
68+
} catch {
69+
Write-PScriboMessage -IsWarning $_.Exception.Message
70+
}
71+
}
72+
73+
end {}
74+
75+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
function Get-AbrOntapVserverNvmeInterface {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve NetApp ONTAP Vserver NVME interface 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 NVME interface information."
27+
}
28+
29+
process {
30+
try {
31+
$VserverData = Get-NcNvmeInterface -VserverContext $Vserver -Controller $Array | Sort-Object -Property TransportProtocols
32+
$VserverObj = @()
33+
if ($VserverData) {
34+
foreach ($Item in $VserverData) {
35+
try {
36+
$inObj = [ordered] @{
37+
'Interface Name' = $Item.Lif
38+
'Transport Address' = $Item.TransportAddress
39+
'Transport Protocols' = $Item.TransportProtocols
40+
'Status' = Switch ($Item.StatusAdmin) {
41+
'up' { 'Up' }
42+
'down' { 'Down' }
43+
default { $Item.StatusAdmin }
44+
}
45+
}
46+
$VserverObj += [pscustomobject]$inobj
47+
} catch {
48+
Write-PScriboMessage -IsWarning $_.Exception.Message
49+
}
50+
}
51+
if ($Healthcheck.Vserver.Nvme) {
52+
$VserverObj | Where-Object { $_.'Status' -like 'Down' } | Set-Style -Style Warning -Property 'Status'
53+
}
54+
55+
$TableParams = @{
56+
Name = "NVME Interface - $($Vserver)"
57+
List = $false
58+
ColumnWidths = 40, 36, 12, 12
59+
}
60+
if ($Report.ShowTableCaptions) {
61+
$TableParams['Caption'] = "- $($TableParams.Name)"
62+
}
63+
$VserverObj | Table @TableParams
64+
}
65+
} catch {
66+
Write-PScriboMessage -IsWarning $_.Exception.Message
67+
}
68+
}
69+
70+
end {}
71+
72+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
function Get-AbrOntapVserverNvmeTcpAdapter {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve NetApp ONTAP Vserver Nvme TCP adapter 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 Nvme TCP adapter information."
27+
}
28+
29+
process {
30+
try {
31+
$VserverData = Get-NcNvmeInterface -VserverContext $Vserver -Controller $Array | Where-Object {$_.PhysicalProtocol -eq 'ethernet'} | Sort-Object -Property HomeNode
32+
$VserverObj = @()
33+
if ($VserverData) {
34+
foreach ($Item in $VserverData) {
35+
try {
36+
$inObj = [ordered] @{
37+
'Node Name' = $Item.HomeNode
38+
'Adapter' = $Item.HomePort
39+
'Protocol' = $Item.PhysicalProtocol
40+
'IP Address' = $Item.TransportAddress
41+
'Status' = Switch ($Item.StatusAdmin) {
42+
'up' { 'Up' }
43+
'down' { 'Down' }
44+
default { $Item.StatusAdmin }
45+
}
46+
}
47+
$VserverObj += [pscustomobject]$inobj
48+
} catch {
49+
Write-PScriboMessage -IsWarning $_.Exception.Message
50+
}
51+
}
52+
if ($Healthcheck.Vserver.FCP) {
53+
$VserverObj | Where-Object { $_.'Status' -like 'Down' } | Set-Style -Style Warning -Property 'Status'
54+
}
55+
56+
$TableParams = @{
57+
Name = "Nvme TCP Physical Adapter - $($Vserver)"
58+
List = $false
59+
ColumnWidths = 30, 17, 17, 20, 16
60+
61+
}
62+
if ($Report.ShowTableCaptions) {
63+
$TableParams['Caption'] = "- $($TableParams.Name)"
64+
}
65+
$VserverObj | Table @TableParams
66+
}
67+
} catch {
68+
Write-PScriboMessage -IsWarning $_.Exception.Message
69+
}
70+
}
71+
72+
end {}
73+
74+
}

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,29 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
436436
}
437437
}
438438
#---------------------------------------------------------------------------------------------#
439+
# NVME Section #
440+
#---------------------------------------------------------------------------------------------#
441+
if ( Get-NcNvme -Controller $Array | Where-Object { $_.Vserver -eq $SVM } ) {
442+
Section -Style Heading5 'Nvme Services Information' {
443+
Paragraph "The following section provides the Nvme Service Information on $($SVM)."
444+
BlankLine
445+
# Get-AbrOntapVserverNvmeSummary -Vserver $SVM
446+
if (Get-NcNvmeInterface -VserverContext $Vserver -Controller $Array | Where-Object { $_.PhysicalProtocol -eq 'fibre_channel' }) {
447+
Section -ExcludeFromTOC -Style Heading6 'Nvme FC Physical Adapter' {
448+
Get-AbrOntapVserverNvmeFcAdapter -Vserver $SVM
449+
}
450+
}
451+
HomePort if (Get-NcNvmeInterface -VserverContext $Vserver -Controller $Array | Where-Object { $_.PhysicalProtocol -eq 'ethernet' }) {
452+
Section -ExcludeFromTOC -Style Heading6 'Nvme TCP Physical Adapter' {
453+
Get-AbrOntapVserverNvmeTcpAdapter -Vserver $SVM
454+
}
455+
}
456+
Section -ExcludeFromTOC -Style Heading6 'NVME Interfaces' {
457+
Get-AbrOntapVserverNvmeInterface -Vserver $SVM
458+
}
459+
}
460+
}
461+
#---------------------------------------------------------------------------------------------#
439462
# ISCSI Section #
440463
#---------------------------------------------------------------------------------------------#
441464
if ( Get-NcIscsiService -Controller $Array | Where-Object { $_.Vserver -eq $SVM } ) {

0 commit comments

Comments
 (0)