VMware Cloud Community
visuri
Contributor
Contributor

Capturing events with CheckForUpdates and WaitForUpdates not working

Hi,

We are trying to capture events such as "VMPowerOffEvent" by using CheckForUpdates and WaitForUpdates, but the events are not getting captured as expected. We are firing webservice calls to perform operations like CreateCollectorForEvents, CreateFilter, etc. but it seems like we are missing something in these calls. Please find the requests and responses below to understand this better :

Step 1: CREATE FILTER

1.1 : Create Events Collector

Creating an event collector to capture "VmPowerOffEvent" event types.

Root folder as retrieved in the service context is: group-d1

The event to be filtererd : VmPoweredOffEvent

Request:

</adapter-response

After creating the filter in step 1, I executed “PowerOn” and “PowerOff” action on 1 VM. I then executed step 2 hoping to capture the power off event. But as you can see the response.is empty. The function waitForUpdates is also not retrieving the expected result.

As per the documentation, the CheckForUpdates and WaitForUpdates should return a version string that is used by the client to fire the next update notification call. In case an empty string is passed first (as in this case) the response should include a version string. As you can see in this response, the version string in the response is also empty here.

Could you please let me know what I could be missing here in order to successfully receive “VmPoweredOff” notifications as per this code?

Also, as per my understanding these calls work on union of all filters created. Is there any way that we can view / delete all the current filters to ensure that only our filter remains? Thanks for your help.

~Viresh

0 Kudos
1 Reply
visuri
Contributor
Contributor

I figured this out - had to do all this in the same session. It works now.

0 Kudos