I am using vCO 5 with vCenter 5 plug-in. I am creating a workflow that prepares a brand new VM that is brought into the environment (it connects the VM to the Active Directory, HIDS, etc). I would like to trigger a default alarm (for example, the VM Error alarm that gets triggered by the VcGeneralVMErrorEvent) when this workflow fails. What would be code required to do this?
Alternatively, can I create an alarm that is triggered by the "LogUserEvent"?
I have tried the following code. I need help with:
Populating the parameters in the commented code. Also, is this the right path to take?
var vmErrorEvent = new VcGeneralVmErrorEvent();
vmErrorEvent.fullFormattedMessage = "My message";
vmErrorEvent.createdTime = new Date();
vmErrorEvent.userName = "Tripwire Server";
vmErrorEvent.message = "My message";//vmErrorEvent.vm = new VcVmEventArgument(???, vcVM);//vmErrorEvent.chainId = ??//vmErrorEvent.key = ??
var sdk = vcVM.sdkConnection;
var eventMgr = sdk.eventManager;
eventMgr.postEvent(vmErrorEvent);
Thanks in advance for your help!
Message was edited by: standVM