VMware Cloud Community
holashh
Enthusiast
Enthusiast
Jump to solution

Unable to setRecoverySettings over the SRM API

Hello all,

I am create script for automation of adding server into SRM with requested settings, like priority, postRecoverySteps and so on.

I am strugled in the last step to set the requested settings to the SRM plan over a method srmPlan.SetRecoverySettings(vm, settings) with the following error:

Exception calling "SetRecoverySettings" with "2" argument(s): "fault.drextapi.fault.InvalidArgument.summary"

At C:\PowerShell\srm\SRM-Cmdlets\SrmFunctions.ps1:726 char:3                                               

+         $RecoveryPlan.SetRecoverySettings($moRef, $RecoverySettings)                                     

+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                     

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException                              

    + FullyQualifiedErrorId : VimException                                                                 

Could anybody help me with this,

thank you all in advance.

0 Kudos
1 Solution

Accepted Solutions
holashh
Enthusiast
Enthusiast
Jump to solution

I fixed this for me few weeks ago and the fix was really pitty, as I forgot to read RecoveryPriority string definitions,

So the whole issue was that I used "high" instead of "higher", so this was the issue

View solution in original post

0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

The fault seems to say that one or more of the values in yoru parameters are not what the method expects.

How did you get the parameter values?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
holashh
Enthusiast
Enthusiast
Jump to solution

Hi LucD,

I have used the srmFunctions provided by Ben Meadowcroft here PowerCLI – BenMeadowcroft.com and fill the settings in pretty same way, so I exactly defined the value for "RecoveryPriority" and for "FinalPowerState".

I tried it by my own way, that is more coded than Ben provided in his helper functions, but here I really follow his post.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Just to make, you are also doing this in SRM 5.8? Or a later version?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

holashh
Enthusiast
Enthusiast
Jump to solution

I am doing this in the SRM 6.1.1 and powerCLI is version 6.0 R1

0 Kudos
holashh
Enthusiast
Enthusiast
Jump to solution

I fixed this for me few weeks ago and the fix was really pitty, as I forgot to read RecoveryPriority string definitions,

So the whole issue was that I used "high" instead of "higher", so this was the issue

0 Kudos