Hi,
I want to set host advanced options with vco, but i cannot get it to work.
I took the powershell code, that is quite easy, and tried it the same way in Orchestrator.
Powershell:
$option = New-Object VMware.Vim.OptionValue
$option.key = $tgtkey
$option.value = $tgtvalue
$optarr += $option
$optMgr.UpdateOptions($optarr)
vCO code snippet:
var aoValues = new Array();
configuredValue = oTargetHost.configManager.advancedOption.queryOptions("NFS.MaxVolumes");
System.log("Configured value is: " + configuredValue[0].value + ", Key: " + configuredValue[0].key);
configuredValue[0].value="256";
aoValues.push(configuredValue[0]);oTargetHost.configManager.advancedOption.updateOptions(aoValues);
I also tried to create a new OptionValue, like this:
var myVcOptionValue = new VcOptionValue() ;
myVcOptionValue.key="NFS.MaxVolumes";
myVcOptionValue.value="256";
aoValues.push(myVcOptionValue);
Both result in the same error message:
InternalError: a parameter was not correct.
How can I make this work?
The HostSystem Object does not have a updateOptions method.
Try to use the configManager of the Host.
Like: VcHostSystem.configManager.advancedOption.updateOption(changedValue);
Hi chris,
Thats what I tried and it did not work.
oTargetHost.configManager.advancedOption.updateOptions(aoValues);
the trouble is that Javascript does not now anything about advanced Number Formats like Int and Long:
var myVcOptionValue = new VcOptionValue() ; myVcOptionValue.key="NFS.MaxVolumes"; myVcOptionValue.
value_LongValue="256"; aoValues.push(myVcOptionValue);
should Work.
You might also want to have a look at this one:
I tried the same like below.
var myVcOptionValue = new VcOptionValue() ;
value
myVcOptionValue.key="NFS.MaxVolumes";
myVcOptionValue.="256";
aoValues.push(myVcOptionValue);
Error Message : A specified parameter was not correct:
Hi,
I got it working for a VM. Maybe you can use this approach also for a host.
var optionValueToUpdate= new VcOptionValue(in_configParamName, in_configParamValue);
var extraConfig = new Array();
extraConfig.push(optionValueToUpdate);
if (in_configParamValue != "")
System.debug("Add option: " + optionValueToUpdate);
else
System.debug("Delete option: " + optionValueToUpdate);
var spec = new VcVirtualMachineConfigSpec();
spec.extraConfig = extraConfig;
task = in_vm.reconfigVM_Task(spec);
My input parameters:
in_vm (VcVirtualMachine)
in_configParamName (string) - e.g. "disk.EnableUUID"
in_configParamValue (string) e.g. "TRUE" // this might be also of type object, but I did not test it
I attached the workflow if someone needs it...
Thanks! value_LongValue worked for me.