VMware Cloud Community
anuragvr
Enthusiast
Enthusiast

Adding failover host to the vSphere HA fails with error “ A specified parameter was not correct “ in vCO workflow

Hi,

I am trying to configure vSphere HA through vCenter Orchestrator workflow, I am facing strange error when I try to add failover host in HA. It works for some cluster and hosts but it could not for others, it throws following error

error Task 'ReconfigureComputeResource_Task' error: A specified parameter was not correct.

Following is my code snippet from my workflow


var clusterConfigSpec = new VcClusterConfigSpecEx();

clusterConfigSpec.dasConfig = new VcClusterDasConfigInfo();

clusterConfigSpec.dasConfig.admissionControlPolicy = new VcClusterFailoverHostAdmissionControlPolicy();

var fHosts = [];

for(var i in inFailoverHosts){

var vcSysHost = System.getModule("com.vmware.PTLAB").getHostSystemMatchingName(inFailoverHosts[i]);

                System.log("%%%%%% vcSysHost "+vcSysHost.name);

                fHosts.push(vcSysHost);

}

clusterConfigSpec.dasConfig.admissionControlPolicy.failoverHosts = fHosts;

reconfigTask = cluster.reconfigureComputeResource_Task(clusterConfigSpec, true);

Please help me to resolve the issue.

0 Kudos
4 Replies
tschoergez
Leadership
Leadership

What's the output of the System.log() line?

One guess: getHostSystemMatchingName() returns an Array of HostSystem, but for the fHosts.push() you only want to have a single object.

So a fHosts.push(vcSysHost.pop()) could help in that case.

Other thing: Check the API reference, perhaps there are more atributes mandatory for ClusterConfigEx or ClusterDasConfigInfo.

Can you try to do it manually and use Onyx to see the proper call?

And check the vCenter Server log, that "specificed parameter was not correct" error origins in vCenter. perhaps vCenter log provides more pointers what's wrong / missing.

Joerg

0 Kudos
anuragvr
Enthusiast
Enthusiast

Thanks Joerg for your response, my problem still unresolved Smiley Sad

Custom action “getHostSystemMatchingName” returns the VC:HostSystem object not the array that’s why I am creating array of VcHostSystem in code “fHosts”  for assigning to failoverHosts (please red the attached code snippet),  System.log() in my code snippet prints the name of VcHostsySytem those I retrieved by proving name to the action “getHostSystemMatchingName”.

  As I mentioned in my query this code is running for some cluster in the same vCenter but not worked for others, I am a good programmer but not a having a good knowledge about VMware environment

0 Kudos
tschoergez
Leadership
Leadership

Can you give an example of the System.log() output?

If it runs for some clusters, but not for others, than have a look how the cluster settings differ, and relate that to the API reference to check if there are other mandatory parts of the configSpec  if some cluster settings are enabled.

You also can check with Onyx what the complete call looks like.

Joerg

0 Kudos
anuragvr
Enthusiast
Enthusiast

System.log() prints the HostSystem name e.g. 10.xxx.xxx.xxx, as I mentioned I can add failover host for the same cluster through vSphere UI but I could not through vCO workflow.

I resolved this issue by retrieving available host from cluster itself instead of my custom action that internally calling VcPlugin.getAllHostSystems()., may be it return faulty list (our vCO attached with multiple vCenter ser ver)

thanks for your response.

0 Kudos