KBI 310880 VMware Rules Run Fine Tested In GUI, But Fail Randomly In Production, Executed By Engine

Version

Argent for VMware all versions

Date

Thursday, 6 Mar 2014

Summary

Customer can use custom PowerCLI script to monitor VMware environment

If both the custom PowerShell Script Rule and built-in VMware Rule happen to run in the same shared pool concurrently, they can fail randomly

As a result, VMware Rules run fine when customer tests in GUI, but fail randomly when put into production and executed by Engine

Customer may notice Rules times out, or see PowerShell runtime exceptions in the Relator trace log:

Index operation failed; the array index evaluated to null. (PowerShell Runtime Exception)

Technical Background

PowerCLI has a limitation of single concurrent connection to vCenter within a process

Argent for VMware has an internal mechanism to synchronize the connection usage when running built-in Rules in Argent for VMware

The mechanism can only handle the connection open and closed by Monitoring Engine

But the custom PowerCLI script initiates such a connection by explicitly calling ‘connect-viserver

Argent for VMware Monitoring Engine has no idea of existence of such connections

As a result, the PowerCLI exception errors will happen, and none of Rules can run properly

Resolution

Make sure using Relator option ‘Spawn New Monitoring Engine Process‘ for the custom PowerShell Script Rules