Hello, I have setup vCheck on two hosts. I have amended few plugins already successfully but one is worrying me in the sense that I don´t know if I can rely on it. There are no VMs that need consolidation but the error it throws when I run it leaves me a doubt.
Both hosts have ISE connected to a vcenter.
On host 1, when I run vcheck.ps1 -config all ok. No errors. When I run plugin manually I get the error below (I sense it´s normal as it might need some parameters for $HostsViews contained in the vcheck script maybe?, but I´m not sure):
Exception calling "Add" with "2" argument(s): "Key cannot be null.
Parameter name: key"
At C:\VI-Tools\vCheck\vCheck-vSphere-master\Plugins\60 VM\45 VMs needing snapshot consolidation.ps1:13 char:31
On host2 when I run vcheck.ps1 -config I get the error below, and this worries me more (as this is the PROD vCheck box)
You cannot call a method on a null-valued expression.
At C:\vCheck-vSphere-master\Plugins\60 VM\45 VMs needing snapshot consolidation.ps1:14 char:25
I'm pasting the script for convenience as it´s not long, line 14 is the last one-liner:
$Title = "VMs needing snapshot consolidation"
$Header = "VMs needing snapshot consolidation [count]"
$Comments = "The following VMs have snapshots that failed to consolidate. See <a href='http://blogs.vmware.com/vsphere/2011/08/consolidate-snapshots.html' target='_blank'>this article</a> for more details"
$Display = "Table"
$Author = "Luc Dekens, Frederic Martin"
$PluginVersion = 1.3
$PluginCategory = "vSphere"
# Start of Settings
# End of Settings
$htabHostVersion = @{}
$HostsViews | Foreach-Object {$htabHostVersion.Add($_.MoRef,$_.config.product.version)}
$FullVM | Where-Object {$htabHostVersion[$_.runtime.host].Split('.')[0] -ge 5 -and $_.runtime.consolidationNeeded} | Sort-Object -Property Name | Select-Object Name,@{N="Consolidation needed";E={$_.Runtime.consolidationNeeded}}