VMware Cloud Community
deepakmits
Contributor
Contributor

Any api to get alert/event indicating error/promt while executing recovery plan in SRM ?

Is there any SRM API to get alert/event when any error or prompt occurs when recovery plan is executing in SRM ?

Reply
0 Kudos
6 Replies
mal_michael
Commander
Commander

Hi,

I don't fully understand your question.

What are you trying to achieve?

You have the following APIs to handle prompts:

ListPrompts List the current prompts that are waiting for input. When a prompt step is reached, the plan goes into waiting state until AnswerPrompt is received. Prompts are given in the same order in which VMs are scheduled to start up.
AnswerPrompt Answer the current prompt displayed by a Recovery Plan. Requires the Run privilege for test, or the Failover privilege for the other modes.

What do you mean by getting an alert? Where, in vCenter?

Michael.

Reply
0 Kudos
deepakmits
Contributor
Contributor

Thanks for your reply. What I wanted to know that can we trap any alert/event which could occur when some error/prompt comes when recovery plan is executing. Like some waitForUpdate() kind of API which can be called on reocvery plan executiong . Or any API which could give me alert/event on completion of every step in recovery plan. When reocvery plan executes does it generate any event which can be trapped and used to show some info about step executed successfully or failed.

Reply
0 Kudos
mal_michael
Commander
Commander

SRM does log events for many of its actions.

See "Events and Alarms" section on page 93 of the SRM 5.0 admin guide and particularily page 96 "Recovery Events". I can see several events that might be helpful:

RecoveryVmBegin

RecoveryVmEnd

RecoveryPlanPromptDisplay

RecoveryPlanPromptResponse

It even looks like you have events for individual command steps:

RecoveryPlanServerCommandBegin

RecoveryPlanServerCommandEnd

RecoveryPlanVmCommandBegin

RecoveryPlanVmCommandEnd

HTH,

Michael.

Reply
0 Kudos
deepakmits
Contributor
Contributor

Thanks Michael. Question is are these events returned by any APIs so that these can be trapped and used programatically ?

Reply
0 Kudos
mal_michael
Commander
Commander

You can use SNMP traps to get the events:

SRM provides Simple Network Management Protocol (SNMP) traps that collect information sent by the API. All traps are compliant with the SNMPv1 type. Information provided by the traps can be used to initiate actions by client applications. Callers of the SRM API interface should listen for the SNMP traps listed below. You might need to configure the vCenter Server to forward the SNMP traps to the registered SNMP Server.
The MIB file is located in the following directory:
<installdir>\www\VMWARE-SRM-TRAPS-5_0.MIB

or I believe you can get them from vCenter via vSphere API.

Michael.

deepakmits
Contributor
Contributor

Thanks Michael.

Reply
0 Kudos