Skip to content

Commit 8bfdea4

Browse files
authored
Merge pull request #8 from AsBuiltReport/dev
v0.3.1 public release
2 parents 64495ab + 49674aa commit 8bfdea4

11 files changed

+588
-289
lines changed

AsBuiltReport.VMware.SRM.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AsBuiltReport.VMware.SRM.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.3.0'
15+
ModuleVersion = '0.3.1'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -27,7 +27,7 @@ Author = 'Jonathan Colon'
2727
CompanyName = 'ZenPrSolutions'
2828

2929
# Copyright statement for this module
30-
Copyright = '(c) 2021 Jonathan Colon. All rights reserved.'
30+
Copyright = '(c) 2022 Jonathan Colon. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
3333
Description = 'A PowerShell module to generate an as built report on the configuration of VMware SRM.'

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# :arrows_counterclockwise: VMware SRM As Built Report Changelog
22

3+
## [0.3.1] - 2022-01-17
4+
5+
### Added
6+
7+
- Added Recovery Site PlaceHolder Datastore Information
8+
- Added Vmware Replication VM status (Replicated/Non-Replicated)
9+
10+
### Changed
11+
12+
- Improved Recovery Site SRM status validation.
13+
14+
### Fixed
15+
16+
- Fix per table caption warning message
17+
318
## [0.3.0] - 2021-12-11
419

520
### Added

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Please refer to the AsBuiltReport [website](https://www.asbuiltreport.com) for m
3737

3838
## Sample Report - Custom Style 1
3939

40-
Sample VMware SRM As Built report HTML file: [Sample VMware SRM As-Built Report.html](https://technomyth.zenprsolutions.net/wp-content/uploads/2021/12/Sample-VMware-SRM-As-Built-Report.html)
40+
Sample VMware SRM As Built report HTML file: [Sample VMware SRM As-Built Report.html](https://technomyth.zenprsolutions.net/wp-content/uploads/2022/01/Sample-VMware-SRM-As-Built-Report.html)
4141

4242
# :beginner: Getting Started
4343

@@ -150,7 +150,7 @@ The **Options** schema allows certain options within the report to be toggled on
150150

151151
The **InfoLevel** schema allows configuration of each section of the report at a granular level. The following sections can be set.
152152

153-
There are 2 levels (0-1) of detail granularity for each section as follows;
153+
There are 4 levels (0-3) of detail granularity for each section as follows;
154154

155155
| Setting | InfoLevel | Description |
156156
|:-------:|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------|

Src/Private/Get-AbrSRMInventoryMapping.ps1

Lines changed: 100 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Get-AbrSRMInventoryMapping {
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.3.0
8+
Version: 0.3.1
99
Author: Jonathan Colon
1010
Twitter: @jcolonfzenpr
1111
Github: rebelinux
@@ -27,8 +27,6 @@ function Get-AbrSRMInventoryMapping {
2727
try {
2828
$Mapping = $LocalSRM.ExtensionData.InventoryMapping.GetFolderMappings()
2929
Section -Style Heading3 'Folder Mappings' {
30-
Paragraph "The following section provides a summary of the Folder Mapping on Site $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)."
31-
BlankLine
3230
$OutObj = @()
3331
if ($Mapping) {
3432
foreach ($ObjMap in $Mapping) {
@@ -40,8 +38,8 @@ function Get-AbrSRMInventoryMapping {
4038
$LocalObj = $RemoteObj
4139
}
4240
$inObj = [ordered] @{
43-
"Local Folder" = $HashObj.Keys
44-
"Remote Folder" = $HashObj.Values
41+
"$($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)" = $HashObj.Keys
42+
"$($LocalSRM.ExtensionData.GetPairedSite().Name)" = $HashObj.Values
4543
}
4644
$OutObj += [pscustomobject]$inobj
4745
}
@@ -63,8 +61,6 @@ function Get-AbrSRMInventoryMapping {
6361
try {
6462
$Mapping = $LocalSRM.ExtensionData.InventoryMapping.GetNetworkMappings()
6563
Section -Style Heading3 'Network Mappings' {
66-
Paragraph "The following section provides a summary of the Network Mapping on Site $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)."
67-
BlankLine
6864
$OutObj = @()
6965
if ($Mapping) {
7066
$HashObj = $Null
@@ -76,8 +72,8 @@ function Get-AbrSRMInventoryMapping {
7672
$LocalObj = $RemoteObj
7773
}
7874
$inObj = [ordered] @{
79-
"Local Network" = $HashObj.Keys
80-
"Remote Network" = $HashObj.Values
75+
"$($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)" = $HashObj.Keys
76+
"$($LocalSRM.ExtensionData.GetPairedSite().Name)" = $HashObj.Values
8177
}
8278
$OutObj += [pscustomobject]$inobj
8379
}
@@ -99,8 +95,6 @@ function Get-AbrSRMInventoryMapping {
9995
try {
10096
$Mapping = $LocalSRM.ExtensionData.InventoryMapping.GetResourcePoolMappings()
10197
Section -Style Heading3 'Resources Mappings' {
102-
Paragraph "The following section provides a summary of the Resources Mapping on Site $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)."
103-
BlankLine
10498
$OutObj = @()
10599
if ($Mapping) {
106100
$HashObj = $Null
@@ -112,11 +106,11 @@ function Get-AbrSRMInventoryMapping {
112106
$LocalObj = $RemoteObj
113107
}
114108
$inObj = [ordered] @{
115-
"Local Resource" = Switch ($HashObj.Keys) {
109+
"$($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)" = Switch ($HashObj.Keys) {
116110
"Resources" {"Root Resource Pool"}
117111
default {$HashObj.Keys}
118112
}
119-
"Remote Resource" = Switch ($HashObj.Values) {
113+
"$($LocalSRM.ExtensionData.GetPairedSite().Name)" = Switch ($HashObj.Values) {
120114
"Resources" {"Root Resource Pool"}
121115
default {$HashObj.Values}
122116
}
@@ -140,55 +134,111 @@ function Get-AbrSRMInventoryMapping {
140134
}
141135
try {
142136
if ($RemotevCenter) {
143-
$Mapping = $LocalSRM.ExtensionData.PlaceholderDatastoreManager.GetPlaceholderDatastores()
137+
$LocalMapping = $LocalSRM.ExtensionData.PlaceholderDatastoreManager.GetPlaceholderDatastores()
138+
$RemoteMapping = $RemoteSRM.ExtensionData.PlaceholderDatastoreManager.GetPlaceholderDatastores()
144139
Section -Style Heading3 'Placeholder Datastore Mappings' {
145140
if ($Options.ShowDefinitionInfo) {
146141
Paragraph "For each protected virtual machine Site Recovery Manager creates a placeholder virtual machine at the recovery site. Placeholder virtual machines are contained in a datastore and registered with the vCenter Server at the recovery site. This datastore is called the placeholder datastore. Since placeholder virtual machines do not have virtual disks they consume a minimal amount of storage"
147142
BlankLine
148143
}
149-
Paragraph "The following section provides a summary of the Placeholder Datastore Mapping on Site $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)."
150-
BlankLine
151144
$OutObj = @()
152-
if ($Mapping) {
153-
foreach ($ObjMap in $Mapping) {
154-
#//Todo "How the fuck i can extract remote PlaceHolder Datastore Info"
155-
Write-PscriboMessage "Discovered Placeholder Datastore Mapping information for $($ObjMap.Name) on $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)."
156-
$inObj = [ordered] @{
157-
"Name" = $ObjMap.Name
158-
"Datastore Type" = $ObjMap.Type
159-
"Capacity" = "$([math]::Round(($ObjMap.Capacity)/ 1GB, 2)) GB"
160-
"Free Space" = "$([math]::Round(($ObjMap.FreeSpace)/ 1GB, 2)) GB"
161-
"Reserved Space" = "$([math]::Round(($ObjMap.ReservedSpace)/ 1GB, 2)) GB"
162-
"Location" = ConvertTo-VIobject $ObjMap.VisibleTo.key
163-
"Fault" = Switch ($ObjMap.Fault) {
164-
"" {"-"; break}
165-
$Null {"-"; break}
166-
default {$ObjMap.Fault}
167-
}
168-
"Status" = Switch ($ObjMap.Status) {
169-
"green" {"OK"}
170-
"orange" {"Warning"}
171-
"red" {"Critical"}
172-
default {$ObjMap.Status}
145+
if ($LocalMapping -or $RemoteMapping) {
146+
foreach ($ObjMap in $LocalMapping) {
147+
try {
148+
if ($ObjMap) {
149+
#//Todo "How the fuck i can extract remote PlaceHolder Datastore Info"
150+
Write-PscriboMessage "Discovered Placeholder Datastore Mapping information for $($ObjMap.Name)."
151+
$inObj = [ordered] @{
152+
"Name" = $ObjMap.Name
153+
"Datastore Type" = $ObjMap.Type
154+
"Capacity" = "$([math]::Round(($ObjMap.Capacity)/ 1GB, 2)) GB"
155+
"Free Space" = "$([math]::Round(($ObjMap.FreeSpace)/ 1GB, 2)) GB"
156+
"Reserved Space" = "$([math]::Round(($ObjMap.ReservedSpace)/ 1GB, 2)) GB"
157+
"Location" = Switch (($ObjMap.VisibleTo.key).count) {
158+
0 {"-"}
159+
default {ConvertTo-VIobject $ObjMap.VisibleTo.key}
160+
}
161+
"Fault" = Switch ($ObjMap.Fault) {
162+
"" {"-"; break}
163+
$Null {"-"; break}
164+
default {$ObjMap.Fault}
165+
}
166+
"Status" = Switch ($ObjMap.Status) {
167+
"green" {"OK"}
168+
"orange" {"Warning"}
169+
"red" {"Critical"}
170+
default {$ObjMap.Status}
171+
}
172+
}
173+
$OutObj = [pscustomobject]$inobj
174+
175+
if ($Healthcheck.InventoryMapping.Status) {
176+
$OutObj | Where-Object { $_.'Status' -ne 'OK'} | Set-Style -Style Warning -Property 'Status'
177+
}
178+
179+
$TableParams = @{
180+
Name = "Placeholder Datastore Mappings - $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)"
181+
List = $true
182+
ColumnWidths = 50, 50
183+
}
184+
if ($Report.ShowTableCaptions) {
185+
$TableParams['Caption'] = "- $($TableParams.Name)"
186+
}
187+
$OutObj | Table @TableParams
173188
}
174189
}
175-
$OutObj += [pscustomobject]$inobj
190+
catch {
191+
Write-PscriboMessage -IsWarning $_.Exception.Message
192+
}
176193
}
177-
}
194+
foreach ($ObjMap in $RemoteMapping) {
195+
try {
196+
if ($ObjMap) {
197+
Write-PscriboMessage "Discovered Placeholder Datastore Mapping information for $($ObjMap.Name)."
198+
$inObj = [ordered] @{
199+
"Name" = $ObjMap.Name
200+
"Datastore Type" = $ObjMap.Type
201+
"Capacity" = "$([math]::Round(($ObjMap.Capacity)/ 1GB, 2)) GB"
202+
"Free Space" = "$([math]::Round(($ObjMap.FreeSpace)/ 1GB, 2)) GB"
203+
"Reserved Space" = "$([math]::Round(($ObjMap.ReservedSpace)/ 1GB, 2)) GB"
204+
"Location" = Switch (($ObjMap.VisibleTo.key).count) {
205+
0 {"-"}
206+
default {ConvertTo-VIobject $ObjMap.VisibleTo.key}
207+
}
208+
"Fault" = Switch ($ObjMap.Fault) {
209+
"" {"-"; break}
210+
$Null {"-"; break}
211+
default {$ObjMap.Fault}
212+
}
213+
"Status" = Switch ($ObjMap.Status) {
214+
"green" {"OK"}
215+
"orange" {"Warning"}
216+
"red" {"Critical"}
217+
default {$ObjMap.Status}
218+
}
219+
}
220+
$OutObj = [pscustomobject]$inobj
178221

179-
if ($Healthcheck.InventoryMapping.Status) {
180-
$OutObj | Where-Object { $_.'Status' -ne 'OK'} | Set-Style -Style Warning -Property 'Status'
181-
}
222+
if ($Healthcheck.InventoryMapping.Status) {
223+
$OutObj | Where-Object { $_.'Status' -ne 'OK'} | Set-Style -Style Warning -Property 'Status'
224+
}
182225

183-
$TableParams = @{
184-
Name = "Placeholder Datastore Mappings - $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)"
185-
List = $true
186-
ColumnWidths = 50, 50
187-
}
188-
if ($Report.ShowTableCaptions) {
189-
$TableParams['Caption'] = "- $($TableParams.Name)"
226+
$TableParams = @{
227+
Name = "Placeholder Datastore Mappings - $($LocalSRM.ExtensionData.GetPairedSite().Name)"
228+
List = $true
229+
ColumnWidths = 50, 50
230+
}
231+
if ($Report.ShowTableCaptions) {
232+
$TableParams['Caption'] = "- $($TableParams.Name)"
233+
}
234+
$OutObj | Table @TableParams
235+
}
236+
}
237+
catch {
238+
Write-PscriboMessage -IsWarning $_.Exception.Message
239+
}
240+
}
190241
}
191-
$OutObj | Table @TableParams
192242
}
193243
}
194244
else {Write-PscriboMessage -IsWarning "No Recovery Site vCenter connection has been detected. Deactivating placeholder datastore mappings section"}

Src/Private/Get-AbrSRMProtectedSiteInfo.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Get-AbrSRMProtectedSiteInfo {
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.3.0
8+
Version: 0.3.1
99
Author: Jonathan Colon
1010
Twitter: @jcolonfzenpr
1111
Github: rebelinux
@@ -31,7 +31,7 @@ function Get-AbrSRMProtectedSiteInfo {
3131
Paragraph "In a typical Site Recovery Manager installation, the protected site provides business-critical datacenter services. The protected site can be any site where vCenter Server supports a critical business need."
3232
BlankLine
3333
}
34-
Paragraph "The following section provides a summary of the Protected Site $($ProtectedSiteInfo.SiteName)."
34+
Paragraph "The following table details information of the Protected Site $($ProtectedSiteInfo.SiteName)."
3535
BlankLine
3636
$OutObj = @()
3737
if ($ProtectedSiteInfo) {
@@ -75,7 +75,7 @@ function Get-AbrSRMProtectedSiteInfo {
7575
}
7676
if ($LocalSRMVM) {
7777
Section -Style Heading4 "SRM Server VM Properties" {
78-
Paragraph "The following section provides the hardware properties of the Protected Site $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)."
78+
Paragraph "The following table details the hardware inventory of the Protected Site $($LocalSRM.ExtensionData.GetLocalSiteInfo().SiteName)."
7979
BlankLine
8080
$OutObj = @()
8181
Write-PscriboMessage "Discovered SRM VM Properties $($LocalSRMVM.Name)."

0 commit comments

Comments
 (0)