Skip to content

Commit

Permalink
Added Nas Repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Aug 31, 2024
1 parent 71d2dcd commit e62df22
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 20 deletions.
64 changes: 52 additions & 12 deletions Src/Private/Get-DiagBackupToRepo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ function Get-DiagBackupToRepo {
try {
$BackupRepo = Get-VbrBackupRepoInfo
$LocalBackupRepo = Get-VbrBackupRepoInfo | Where-Object { $_.Role -like '*Local' }
$RemoteBackupRepo = Get-VbrBackupRepoInfo | Where-Object { $_.Role -like 'Dedup*' }
$DedupBackupRepo = Get-VbrBackupRepoInfo | Where-Object { $_.Role -like 'Dedup*' }
$ObjStorage = Get-VbrBackupObjectRepoInfo
$ArchiveObjStorage = Get-VbrBackupArchObjRepoInfo
$NASBackupRepo = Get-VbrBackupRepoInfo | Where-Object { $_.Role -like '*Share' }

if ($BackupServerInfo) {
if ($BackupRepo) {
SubGraph MainSubGraph -Attributes @{Label = 'Backup Repository'; fontsize = 22; penwidth = 1; labelloc = 't'; style = 'dashed,rounded'; color = $SubGraphDebug.color } {
SubGraph MainSubGraph -Attributes @{Label = 'Backup Repositories'; fontsize = 22; penwidth = 1; labelloc = 't'; style = 'dashed,rounded'; color = $SubGraphDebug.color } {
if ($LocalBackupRepo) {
SubGraph LocalRepos -Attributes @{Label = 'Local Repository'; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
SubGraph LocalRepos -Attributes @{Label = 'Local Repositories'; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
# Node used for subgraph centering
Node LocalReposDummy @{Label = 'LocalReposDummy'; style = $SubGraphDebug.style; color = $SubGraphDebug.color; shape = 'plain' }
if (($LocalBackupRepo | Measure-Object).count -le 3) {
Expand Down Expand Up @@ -74,23 +75,62 @@ function Get-DiagBackupToRepo {
}
Edge -From MainSubGraph:s -To LocalReposDummy @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}
if ($RemoteBackupRepo) {
if ($NASBackupRepo) {
SubGraph NasRepos -Attributes @{Label = 'NAS Repositories'; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
# Node used for subgraph centering
Node NasReposDummy @{Label = 'NasReposDummy'; style = $SubGraphDebug.style; color = $SubGraphDebug.color; shape = 'plain' }
if (($NASBackupRepo | Measure-Object).count -le 3) {
foreach ($REPOOBJ in ($NASBackupRepo | Sort-Object -Property Name)) {
$REPOHASHTABLE = @{}
$REPOOBJ.psobject.properties | ForEach-Object { $REPOHASHTABLE[$_.Name] = $_.Value }
Node $REPOOBJ -NodeScript { $_.Name } @{Label = $REPOHASHTABLE.Label; fontname = "Segoe Ui" }
}

Edge -From NasReposDummy -To $NASBackupRepo.Name @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
} else {
$Group = Split-array -inArray ($NASBackupRepo | Sort-Object -Property Name) -size 3
$Number = 0
while ($Number -ne $Group.Length) {
$Random = Get-Random
SubGraph "NasBackupGroup$($Number)_$Random" -Attributes @{Label = ' '; style = $SubGraphDebug.style; color = $SubGraphDebug.color; fontsize = 18; penwidth = 1 } {
$Group[$Number] | ForEach-Object {
$REPOHASHTABLE = @{}
$_.psobject.properties | ForEach-Object { $REPOHASHTABLE[$_.Name] = $_.Value }
Node $_.Name @{Label = $REPOHASHTABLE.Label; fontname = "Segoe Ui" }
}
}
$Number++
}

Edge -From NasReposDummy -To $Group[0].Name @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
$Start = 0
$NasRepoNum = 1
while ($NasRepoNum -ne $Group.Length) {
Edge -From $Group[$Start].Name -To $Group[$NasRepoNum].Name @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
$Start++
$NasRepoNum++
}
}
}
Edge -From MainSubGraph:s -To NasReposDummy @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}
if ($DedupBackupRepo) {
SubGraph RemoteRepos -Attributes @{Label = 'Deduplicating Storage Appliances'; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
Node RemoteReposDummy @{Label = 'RemoteReposDummy'; style = $EdgeDebug.style; color = $EdgeDebug.color; shape = 'plain' }
if (($RemoteBackupRepo | Measure-Object).count -le 3) {
foreach ($REPOOBJ in ($RemoteBackupRepo | Sort-Object -Property Name)) {
if (($DedupBackupRepo | Measure-Object).count -le 3) {
foreach ($REPOOBJ in ($DedupBackupRepo | Sort-Object -Property Name)) {
$REPOHASHTABLE = @{}
$REPOOBJ.psobject.properties | ForEach-Object { $REPOHASHTABLE[$_.Name] = $_.Value }
Node $REPOOBJ -NodeScript { $_.Name } @{Label = $REPOHASHTABLE.Label; fontname = "Segoe Ui" }
}

Edge -From RemoteReposDummy -To $RemoteBackupRepo.Name @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
Edge -From RemoteReposDummy -To $DedupBackupRepo.Name @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
} else {
$Group = Split-array -inArray ($RemoteBackupRepo | Sort-Object -Property Name) -size 3
$Group = Split-array -inArray ($DedupBackupRepo | Sort-Object -Property Name) -size 3
$Number = 0
while ($Number -ne $Group.Length) {
$Random = Get-Random
SubGraph "RemoteBackupRepo$($Number)_$Random" -Attributes @{Label = ' '; style = $SubGraphDebug.style; color = $SubGraphDebug.color; fontsize = 18; penwidth = 1 } {
SubGraph "DedupBackupRepo$($Number)_$Random" -Attributes @{Label = ' '; style = $SubGraphDebug.style; color = $SubGraphDebug.color; fontsize = 18; penwidth = 1 } {
$Group[$Number] | ForEach-Object {
$REPOHASHTABLE = @{}
$_.psobject.properties | ForEach-Object { $REPOHASHTABLE[$_.Name] = $_.Value }
Expand All @@ -114,7 +154,7 @@ function Get-DiagBackupToRepo {

}
if ($ObjStorage) {
SubGraph ObjectStorage -Attributes @{Label = 'Object Repository'; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
SubGraph ObjectStorage -Attributes @{Label = 'Object Repositories'; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
Node ObjectStorageDummy @{Label = 'ObjectStorageDummy'; style = $SubGraphDebug.style; color = $SubGraphDebug.color; shape = 'plain' }
if (($ObjStorage | Measure-Object).count -le 3) {
foreach ($STORAGEOBJ in ($ObjStorage | Sort-Object -Property Name)) {
Expand Down Expand Up @@ -152,7 +192,7 @@ function Get-DiagBackupToRepo {
Edge -From MainSubGraph:s -To ObjectStorageDummy @{minlen = 1; style = $EdgeDebug.style; color = $EdgeDebug.color }
}
if ($ArchiveObjStorage) {
SubGraph ArchiveObjectStorage -Attributes @{Label = 'Archive Object Repository'; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
SubGraph ArchiveObjectStorage -Attributes @{Label = 'Archive Object Repositories'; fontsize = 18; penwidth = 1.5; labelloc = 't'; style = 'dashed,rounded' } {
Node ArchiveObjectStorageDummy @{Label = 'ArchiveObjectStorageDummy'; style = $EdgeDebug.style; color = $EdgeDebug.color; shape = 'plain' }
if (($ArchiveObjStorage | Measure-Object).count -le 3) {
foreach ($STORAGEArchiveOBJ in ($ArchiveObjStorage | Sort-Object -Property Name)) {
Expand Down Expand Up @@ -192,7 +232,7 @@ function Get-DiagBackupToRepo {
}
}

Edge -From $BackupServerInfo.Name -To MainSubGraph @{lhead='clusterMainSubGraph';minlen = 3 }
Edge -From $BackupServerInfo.Name -To MainSubGraph @{minlen = 3 }
}
}
} catch {
Expand Down
16 changes: 10 additions & 6 deletions Src/Private/Get-VbrBackupRepoInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,19 @@ function Get-VbrBackupRepoInfo {
if ($Role -like '*Local') {
$Rows.add('Server', $BackupRepo.Host.Name.Split('.')[0])
$Rows.add('Path', $BackupRepo.FriendlyPath)
$Rows.add('Total Space', "$(($BackupRepo).GetContainer().CachedTotalSpace.InGigabytes) GB")
$Rows.add('Used Space', "$(($BackupRepo).GetContainer().CachedFreeSpace.InGigabytes) GB")
$Rows.add('Total-Space', "$(($BackupRepo).GetContainer().CachedTotalSpace.InGigabytes) GB")
$Rows.add('Used-Space', "$(($BackupRepo).GetContainer().CachedFreeSpace.InGigabytes) GB")
} elseif ($Role -like 'Dedup*') {
$Rows.add('Dedup Type', $BackupRepo.TypeDisplay)
$Rows.add('Total Space', "$(($BackupRepo).GetContainer().CachedTotalSpace.InGigabytes) GB")
$Rows.add('Used Space', "$(($BackupRepo).GetContainer().CachedFreeSpace.InGigabytes) GB")
$Rows.add('DedupType', $BackupRepo.TypeDisplay)
$Rows.add('Total-Space', "$(($BackupRepo).GetContainer().CachedTotalSpace.InGigabytes) GB")
$Rows.add('Used-Space', "$(($BackupRepo).GetContainer().CachedFreeSpace.InGigabytes) GB")
} elseif ($Role -like '*Share') {
$Rows.add('Path', $BackupRepo.FriendlyPath)
$Rows.add('Total-Space', "$(($BackupRepo).GetContainer().CachedTotalSpace.InGigabytes) GB")
$Rows.add('Used-Space', "$(($BackupRepo).GetContainer().CachedFreeSpace.InGigabytes) GB")
}

if (($Role -ne 'Dedup Appliances') -and ($Role -ne 'SAN') -and ($BackupRepo.Host.Name -in $ViBackupProxy.Host.Name -or $BackupRepo.Host.Name -in $HvBackupProxy.Host.Name)) {
if (($Role -ne 'Dedup Appliances') -and ($Role -ne 'SAN') -and ($Role -notlike '*Share') -and ($BackupRepo.Host.Name -in $ViBackupProxy.Host.Name -or $BackupRepo.Host.Name -in $HvBackupProxy.Host.Name)) {
$BackupType = 'Proxy'
} else { $BackupType = $BackupRepo.Type }

Expand Down
1 change: 1 addition & 0 deletions Src/Private/Images.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $script:Images = @{
"VBR_Proxy_Server" = "Proxy_Server.png"
"VBR_Wan_Accel" = "WAN_accelerator.png"
"VBR_SOBR" = "Scale-out_Backup_Repository.png"
"VBR_NAS" = "NAS.png"
"VBR_LOGO" = "Veeam_logo.png"
"VBR_No_Icon" = "no_icon.png"
'VBR_Storage_NetApp' = "Storage_NetApp.png"
Expand Down
8 changes: 6 additions & 2 deletions Src/Private/SharedUtilsFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ function Get-IconType {
'IndividualComputers' { 'VBR_AGENT_IC' }
'ActiveDirectory' { 'VBR_AGENT_AD' }
'CSV' { 'VBR_AGENT_CSV' }
'CifsShare' {'VBR_NAS'}
'NfsShare' {'VBR_NAS'}
default { 'VBR_No_Icon' }
}

Expand Down Expand Up @@ -60,15 +62,17 @@ function Get-RoleType {
'DDBoost' { 'Dedup Appliances' }
'HPStoreOnceIntegration' { 'Dedup Appliances' }
'ExaGrid' { 'Dedup Appliances' }
'InfiniGuard' { 'Dedup Appliances' }
'Cloud' { 'Cloud' }
'SanSnapshotOnly' { 'SAN' }
"vmware" { 'VMware Backup Proxy' }
"hyperv" { 'HyperV Backup Proxy' }
"agent" { 'Agent & Files Backup Proxy' }
"nas" { 'NAS Backup Proxy' }
default { 'Backup Repository' }
"CifsShare" { 'SMB Share' }
"NfsShare" { 'NFS Share' }
default { 'Unknown' }
}

return $RoleType
}
function ConvertTo-TextYN {
Expand Down

0 comments on commit e62df22

Please sign in to comment.