Closed chibotero closed 10 years ago
This may be because your vCenter events are being flooded with a lot of entries. By default vCheck will only use 100,000 events, if you have a large and noisy environment this might mean the creation/remove events are not returned.
Unfortunately the Get-VIEvent cmdlet doesn't support filtering, so the best you can do if this is the case is to try returning the maximum number of results. Since the -MaxSamples parameter is an int32, try the following modification:
In "09 Created or cloned VMs.ps1" (Line 6):
$VIEvent = Get-VIEvent -maxsamples ([int32]::MaxValue) -Start ($Date).AddDays(-$VMsNewRemovedAge)
Hi Thanks for the answer but the change didn't help Any way to debug this and find a fix ?
Regards Haim
-----Original Message----- From: "Sneddo" notifications@github.com Sent: 11/06/2014 07:00 To: "alanrenouf/vCheck-vSphere" vCheck-vSphere@noreply.github.com Cc: "chibotero" haim.chibotero@gmail.com Subject: Re: [vCheck-vSphere] Cant see new VM created or VM Removed (#213)
This may be because your vCenter events are being flooded with a lot of entries. By default vCheck will only use 100,000 events, if you have a large and noisy environment this might mean the creation/remove events are not returned. Unfortunately the Get-VIEvent cmdlet doesn't support filtering, so the best you can do if this is the case is to try returning the maximum number of results. Since the -MaxSamples parameter is an int32, try the following modification: In "09 Created or cloned VMs.ps1" (Line 6): $VIEvent = Get-VIEvent -maxsamples ([int32]::MaxValue) -Start ($Date).AddDays(-$VMsNewRemovedAge) — Reply to this email directly or view it on GitHub.
So, having done a bit more reading, if you specify a start and end date the MaxSample parameter is ignored (at least in 5.5 U2). I've been doing a bit of testing an in a in our environment (~240 hosts, 2000 VMs) I'm still hitting the int32 limit it seems, mostly due to HP SIM spamming our vCenter events.
So let's try:
$VIEvent = Get-VIEvent -Start ($Date).AddDays(-$VMsNewRemovedAge) -Finish ($Date)
The downside is this is that it takes ages to complete due to the fact you have to retrieve all events before you do any filtering, so I'd keep the $VMsNewRemovedAge to a minimum.
Hi I am running still 5.1 seems I missed copying over the ")" in your first comment so the script wasn't working now after fixing it it works great :-)
Thanks Haim
On Thu, Jun 12, 2014 at 7:01 AM, Sneddo notifications@github.com wrote:
So, having done a bit more reading, if you specify a start and end date the MaxSample parameter is ignored (at least in 5.5 U2). I've been doing a bit of testing an in a in our environment (~240 hosts, 2000 VMs) I'm still hitting the int32 limit it seems, mostly due to HP SIM spamming our vCenter events.
So let's try:
$VIEvent = Get-VIEvent -Start ($Date).AddDays(-$VMsNewRemovedAge) -Finish (Get-Date)
The downside is this is that it takes ages to complete due to the fact you have to retrieve all events before you do any filtering, so I'd keep the $VMsNewRemovedAge to a minimum.
— Reply to this email directly or view it on GitHub https://github.com/alanrenouf/vCheck-vSphere/issues/213#issuecomment-45827923 .
Hi let me start saying I love your scripts, I was using the old version a year ago and just started all from scratch today. in both cases I couldn't see any input on new VM created or VM Removed.
can you advise ? Thanks, Haim