VMware Cloud Community
sanzende
Contributor
Contributor
Jump to solution

vRealize Orchestrator - ovfManager.parseDescriptor returning error

Hi,

I am planning to write a script in vRealize Orchestrator to import an OVF. For that I have started with the script and have written so far this and running it to take one step at a time. But I am getting error "TypeError: Cannot call method "parseDescriptor" of null" for function parseDecriptor " I have added System.log(ovfD) to print the ocf content to verify and it prints. So still I do not know why it is giving me this. Am I missing anything here?

var ovfmanager = host.sdkConnection.ovfManager();

var descriptorSpec = new VcOvfParseDescriptorParams();

descriptorSpec.locale = '';

descriptorSpec.deploymentOption = '';

var tempDir = System.getTempDirectory() ;

var fileReader = new FileReader(tempDir + '/ss.ovf') ;

fileReader.open() ;

var ovfDescriptor = fileReader.readAll();

var ovfD = String(ovfDescriptor);

ovfD = ovfD.trim();

fileReader.close();

System.log(ovfD);

var ovfInfo = ovfmanager.parseDescriptor(ovfD, descriptorSpec);

1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

On the first line, you are trying to execute a method ovfManager() but it's not a method; it's a property.

So the first line should be


var ovfmanager = host.sdkConnection.ovfManager;

View solution in original post

2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

On the first line, you are trying to execute a method ovfManager() but it's not a method; it's a property.

So the first line should be


var ovfmanager = host.sdkConnection.ovfManager;
sanzende
Contributor
Contributor
Jump to solution

Hi IIian,


Many thanks for the help!


Regards

Sandeep



Reply
0 Kudos