VMware Cloud Community
shravang
Contributor
Contributor
Jump to solution

SRM APIs: How to specify if the Recovery operation must be Planned migration or Disaster recovery

Is there any way using the SRM APIs to specify if we want a Planned Migration, or a Disaster Recovery during failover?

Also, how exactly do we use the ListPrompts and AnswerPrompt APIs? Any examples would be appreciated. Thanks!

0 Kudos
1 Solution

Accepted Solutions
Daniel_Georgiev
VMware Employee
VMware Employee
Jump to solution

If you want to run Disaster Recovery you have to use Recovery Mode option failover (number 0). In the SRM 5.8 we introduce one new Recovery Mode option - Migrate (Planned Migration - number 5). This command is not added to SRM API documentation but will be updated shortly.

Example:

PowerCLI > $RPmode = New-Object VMware.VimAutomation.Srm.Views.SrmRecoveryPlanRecoveryMode

PowerCLI > $RPmode.Value__ = 5

PowerCLI > $RPmode.ToString()

> Migrate

Commands ListPrompts and AnswerPrompt have nothing to do with the plan execution(Planned Migration or Disaster Recovery).

- Daniel G.

View solution in original post

0 Kudos
5 Replies
Daniel_Georgiev
VMware Employee
VMware Employee
Jump to solution

Yes, you can specify a mode on method that Start recovery plan (test, cleanupTest, failover, reprotect, revert). You can find more information in our documentation for API -> https://www.vmware.com/support/developer/srm-api/srm_58_api.pdf - Page 33 (ListPrompts, AnswerPrompt)

Hope this help,

Daniel G.

0 Kudos
shravang
Contributor
Contributor
Jump to solution

Hi Daniel,

The mode lets me choose between a test failover and a real failover.

But on choosing a failover, how do I specify if I want to do a planned migration or a disaster recovery?

In the GUI, this is specified in a prompt that pops up on selecting 'Recovery'.

Do ListPrompts and AnswerPrompt have anything to do with it?

If so, could you show an example of how to use the ListPrompts and AnswerPrompt APIs for this? The description in the documentation wasn't too clear about this.

0 Kudos
Daniel_Georgiev
VMware Employee
VMware Employee
Jump to solution

If you want to run Disaster Recovery you have to use Recovery Mode option failover (number 0). In the SRM 5.8 we introduce one new Recovery Mode option - Migrate (Planned Migration - number 5). This command is not added to SRM API documentation but will be updated shortly.

Example:

PowerCLI > $RPmode = New-Object VMware.VimAutomation.Srm.Views.SrmRecoveryPlanRecoveryMode

PowerCLI > $RPmode.Value__ = 5

PowerCLI > $RPmode.ToString()

> Migrate

Commands ListPrompts and AnswerPrompt have nothing to do with the plan execution(Planned Migration or Disaster Recovery).

- Daniel G.

0 Kudos
shravang
Contributor
Contributor
Jump to solution

Thanks Daniel, that's exactly what I was looking for!

Regards,

Shravan

0 Kudos
admin
Immortal
Immortal
Jump to solution

Note that you can also use the fact that it is an enumerated type to specify the mode like this (for migration):

PowerCLI > $RPmode = [VMware.VimAutomation.Srm.Views.SrmRecoveryPlanRecoveryMode]::Migrate

or this (for failover)

PowerCLI > $RPmode = [VMware.VimAutomation.Srm.Views.SrmRecoveryPlanRecoveryMode]::Failover


Which avoids having to figure out number to set Value__ too.

0 Kudos