Skip to content

Commit

Permalink
Merge pull request #52 from MicKBfr/dev
Browse files Browse the repository at this point in the history
FIX : support multiple volume with same name
  • Loading branch information
rebelinux authored Aug 15, 2024
2 parents 125dc40 + 06de14d commit dbdacf8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Src/Private/Get-AbrOntapEfficiencyVol.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrOntapEfficiencyVol {
.DESCRIPTION
.NOTES
Version: 0.6.7
Version: 0.6.8
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -28,12 +28,12 @@ function Get-AbrOntapEfficiencyVol {

process {
try {
$Data = Get-NcVol -VserverContext $Vserver -Controller $Array | Where-Object { $_.Name -ne 'vol0' -and $_.State -eq "online" }
$Data = Get-NcVol -VserverContext $Vserver -Controller $Array | Where-Object { $_.JunctionPath -ne '/' -and $_.Name -ne 'vol0' -and $_.State -eq "online" }
$OutObj = @()
if ($Data) {
foreach ($Item in $Data) {
try {
$Saving = Get-NcEfficiency -Volume $Item.Name -Controller $Array
$Saving = Get-NcEfficiency -Volume $Item.Name -Vserver $Vserver -Controller $Array
$inObj = [ordered] @{
'Volume' = $Item.Name
'Capacity' = $Saving.Capacity | ConvertTo-FormattedNumber -Type Datasize -ErrorAction SilentlyContinue
Expand Down Expand Up @@ -66,4 +66,4 @@ function Get-AbrOntapEfficiencyVol {

end {}

}
}
4 changes: 2 additions & 2 deletions Src/Private/Get-AbrOntapEfficiencyVolDetailed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrOntapEfficiencyVolDetailed {
.DESCRIPTION
.NOTES
Version: 0.6.7
Version: 0.6.8
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -33,7 +33,7 @@ function Get-AbrOntapEfficiencyVolDetailed {
if ($Data) {
foreach ($Item in $Data) {
try {
$Saving = Get-NcEfficiency -Volume $Item.Name -Controller $Array
$Saving = Get-NcEfficiency -Volume $Item.Name -Vserver $Vserver -Controller $Array
$inObj = [ordered] @{
'Volume' = $Item.Name
'Capacity' = $Saving.Capacity | ConvertTo-FormattedNumber -Type Datasize -ErrorAction SilentlyContinue
Expand Down
8 changes: 4 additions & 4 deletions Src/Private/Get-AbrOntapVserverVolumeSnapshot.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrOntapVserverVolumeSnapshot {
.DESCRIPTION
.NOTES
Version: 0.6.7
Version: 0.6.8
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -33,8 +33,8 @@ function Get-AbrOntapVserverVolumeSnapshot {
if ($VolumeFilter) {
foreach ($Item in $VolumeFilter) {
try {
$SnapReserve = Get-NcVol $Item.Name -Controller $Array | Select-Object -ExpandProperty VolumeSpaceAttributes
$SnapPolicy = Get-NcVol $Item.Name -Controller $Array | Select-Object -ExpandProperty VolumeSnapshotAttributes
$SnapReserve = Get-NcVol $Item.Name -VserverContext $Vserver -Controller $Array | Select-Object -ExpandProperty VolumeSpaceAttributes
$SnapPolicy = Get-NcVol $Item.Name -VserverContext $Vserver -Controller $Array | Select-Object -ExpandProperty VolumeSnapshotAttributes
$inObj = [ordered] @{
'Volume' = $Item.Name
'Snapshot Enabled' = ConvertTo-TextYN $SnapPolicy.AutoSnapshotsEnabled
Expand Down Expand Up @@ -72,4 +72,4 @@ function Get-AbrOntapVserverVolumeSnapshot {

end {}

}
}
6 changes: 3 additions & 3 deletions Src/Private/Get-AbrOntapVserverVolumeSnapshotHealth.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrOntapVserverVolumeSnapshotHealth {
.DESCRIPTION
.NOTES
Version: 0.6.7
Version: 0.6.8
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -31,7 +31,7 @@ function Get-AbrOntapVserverVolumeSnapshotHealth {
$SnapshotDays = 7
$Now = Get-Date
$VserverFilter = Get-NcVol -VserverContext $Vserver -Controller $Array | Where-Object { $_.JunctionPath -ne '/' -and $_.Name -ne 'vol0' }
$SnapShotData = Get-NcSnapshot -Volume $VserverFilter -Controller $Array | Where-Object { $_.Name -notmatch "snapmirror.*" -and $_.Created -le $Now.AddDays(-$SnapshotDays) }
$SnapShotData = Get-NcSnapshot -Volume $VserverFilter -Vserver $Vserver -Controller $Array | Where-Object { $_.Name -notmatch "snapmirror.*" -and $_.Created -le $Now.AddDays(-$SnapshotDays) }
if ($SnapShotData) {
Section -Style Heading4 "HealthCheck - Volumes Snapshot" {
Paragraph "The following section provides the Vserver Volumes Snapshot HealthCheck on $($SVM)."
Expand Down Expand Up @@ -70,4 +70,4 @@ function Get-AbrOntapVserverVolumeSnapshotHealth {

end {}

}
}
6 changes: 3 additions & 3 deletions Src/Public/Invoke-AsBuiltReport.NetApp.ONTAP.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
.DESCRIPTION
Documents the configuration of NetApp ONTAP in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.6.7
Version: 0.6.8
Author: Jonathan Colon Feliciano
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -641,8 +641,8 @@ function Invoke-AsBuiltReport.NetApp.ONTAP {
BlankLine
Get-AbrOntapEfficiencyAggr
foreach ($SVM in $Vservers) {
$VolFilter = Get-NcVol -VserverContext $SVM -Controller $Array | Where-Object { $_.State -eq "online" }
if (Get-NcEfficiency -Volume $VolFilter.Name -Controller $Array | Where-Object { $_.Name -ne "vol0" }) {
$VolFilter = Get-NcVol -VserverContext $SVM -Controller $Array | Where-Object { ($_.State -eq "online") -and ($_.Name -ne "vol0") }
if (Get-NcEfficiency -Volume $VolFilter.Name[0] -Vserver $SVM -Controller $Array) {
Section -Style Heading4 "$SVM Vserver Volume Deduplication" {
Get-AbrOntapEfficiencyVolSisStatus -Vserver $SVM
Section -Style Heading5 "Volume Efficiency" {
Expand Down

0 comments on commit dbdacf8

Please sign in to comment.