VMware Cloud Community
jbenning
Contributor
Contributor

Fetching the default IaaS host

I've been try to get the default IaaS host from an action (to populate dynamic forms in a blueprint). the following code simply returns "undefined":

var host = Server.findAllForType("vCAC:VCACHost")[0];

System.log("found: "+host.displayName);

I sure i'm missing something basic - but i assumed that the IaaS host would be available..

Thanks!

0 Kudos
1 Reply
sbeaver
Leadership
Leadership

What you really want to try is something like this...

var tenant = "vsphere.local" //tenant name

var host = vCACCAFEHostManager.getDefaultHostForTenant(tenant , true);

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos