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!
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.
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.
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.
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.
Thanks Daniel, that's exactly what I was looking for!
Regards,
Shravan
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.