VMware Cloud Community
KiwiDave
Enthusiast
Enthusiast
Jump to solution

vCO Constants - Specifically vCenter

Hi,

I would like to know what constants are available in vCO, specifically how to return the vcenter which is currently being used..

MfG,

Dave

0 Kudos
1 Solution

Accepted Solutions
dvatov
VMware Employee
VMware Employee
Jump to solution

I think id property will return an url with the ip address or domain name of the vcenter machine. Which of two will be returned depends on what you have entered in the plug-in configuration when vCenter was added. Do you need other 'name' of the vCenter?

View solution in original post

0 Kudos
7 Replies
dvatov
VMware Employee
VMware Employee
Jump to solution

Hi Dave,

Each managed object like VcVirtualMachine, VcResourcePool, etc has property sdkConnection. It gives info about the vcenter the object comes from.

Daniel

KiwiDave
Enthusiast
Enthusiast
Jump to solution

Thanks for that Daniel, I was working with that, but the only information I can get out of there is the vCenter version using the aboutInfo.fullName, nothing on the actual name of the vCenter server.

I can get the instanceUuid of the sdkConnection and search from there I guess, but I was hoping there'd be an easier solution available.

0 Kudos
dvatov
VMware Employee
VMware Employee
Jump to solution

I think id property will return an url with the ip address or domain name of the vcenter machine. Which of two will be returned depends on what you have entered in the plug-in configuration when vCenter was added. Do you need other 'name' of the vCenter?

0 Kudos
KiwiDave
Enthusiast
Enthusiast
Jump to solution

Perfect! Thanks a lot Daniel! That was what I was after. Smiley Happy

0 Kudos
MEMvlc
Contributor
Contributor
Jump to solution

where can I find the id property referenced above?  is there one on the sdkconnection object?   this is for vco 5.1.

thanks

0 Kudos
dvatov
VMware Employee
VMware Employee
Jump to solution

VcPlugin.allSdkConnections[0].id - this should give you the ip of the first registered vCenter server.

0 Kudos
MEMvlc
Contributor
Contributor
Jump to solution

after I asked the question, I saw how to do this, great when multiple vCenters defined -- thanks for confirmation -- very nice!

0 Kudos