VMware Cloud Community
JRehl01
Contributor
Contributor

vCenter Plugin SDK connection not returning any VMs

I've been having some issues recently with the vCenter plugin for vCO, specifically for one SDK Connection (I have three in total).

During my provisioning workflow, I try to convert a vCloud Director VM to a vCenter VM, using the vCenter plugin, so I can use the VIX plugin to perform some scripts in the VM.

However, when I try to do the conversion, the vCenter plugin isn't returning anything.

Script:

     var arrVMs = new Array();

     arrVMs = System.getModule("com.vmware.library.vc.vm").getAllVMsMatchingRegexp(VclVM.name);     //VclVM is type vCloud:VM

     var VcVM = arrVMs[0];

However, I don't get anything in arrVMs. I've tried doing it in a test workflow:

     var arrVMs = new Array();

     arrVMs = SDKConnection.getAllVirtualMachines(); //SDKconnection is type VC:SdkConnection

     System.log("Number of VMs: " + arrVMs.length);

I ran it and I get "Number of VMs: 0" in the log.

I find this weird because I'm able to find all the VMs I need in the inventory view, it just doesn't work with scripts.

If I restart the vCO service through the configuration page, it DOES work temporarily, for a few minutes, then it goes back to this.

The SDK connection does have a large number of VMs (over 1200). Would that cause a memory issue? I even tried querying using xpath syntax (xpath:name[starts-with(.,'" + VM.name + "')]) so I wouldn't have the server return ALL the vms and then parse through them all, and I still got nothing.

Any ideas?

0 Kudos
5 Replies
cdecanini_
VMware Employee
VMware Employee

In case this can help you I provided an action that is not using the query service to find the VM. It is building the managed object from its reference: Get a vCenter Virtual Machine from a vCloud VM

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
ChristianWehner
VMware Employee
VMware Employee

Hi,

you could also try this where you aren't using the SDKConnection:

var vms = Server.findAllForType("VC:VirtualMachine","xpath:name='"+VclVM.name+"'");

System.log( vms[0].name );

Regards,

Chris

0 Kudos
JRehl01
Contributor
Contributor

Christian,

     I just tried that with no luck.

cdecanini_,

     I haven't been able to try yours out yet.

I do see the following info message about 1200 times at the time of the workflow run in the DS log on the vCenter server giving me trouble:

No user data: authorization denied. Did you invoke notifyAdd to trigger userData creation?

This can't be a permissions issue, the acct being used has full admin rights, and the fact that when bouncing the vCO service, this actually works temporarily.

Message was edited by: JRehl01

0 Kudos
ChristianWehner
VMware Employee
VMware Employee

I never saw this message before. I could you only help with some more troubleshooting I would do in your case:

Are you able to browse your vCenter from inventory tab? Do you see same messages in DS log while browsing?

How about reconfigure your vCenter plugin or maybe reinstall it?

What about the Orchestrator logs? Do you see here any anomalies?

Regards,

Chris

0 Kudos
JRehl01
Contributor
Contributor

Yes, I'm able to browse in vCenter from the inventory tab.

I do not see the same messages in the DS log while browsing. Just "Recieved new query request" logs and a few "New Generation: ######" logs.

I don't see anything wrong in the Orchestrator logs, just "dump Statistics()" with no results when I run the workflow.

I haven't reinstalled the plugin yet, I'm hoping to do any reinstallation as a last resort.

0 Kudos