vCO – Configure ESXi Syslog Server and more

In this example I configure some advanced setting on an ESXi host. Syslog server is just one of the.
First I create a for loop to create my hostSetting array objects. Then late I fill them. Always the key and a value. You can check the ESXi host advanced setting in GUI for parameters. You need to watch the type. For instance the port for the syslog server is of type value_IntValue. There are also float and long. I have to say I don’t know why it say deprecated for value. Maybe I have to come back on that.

http://www.vmware.com/support/orchestrator/doc/vco_vsphere41_api/index.html

//myhost is input parameter of type VcHostSystem
var hostSetting = new Array();

for (i=0; i<=3; i++)
{
	hostSetting[i] = new VcOptionValue();
}
hostSetting[0].key = "Syslog.Remote.Hostname";
hostSetting[0].value = "mysyslog.bigbluemike.com";

hostSetting[1].key = "Syslog.Remote.Port";
hostSetting[1].value_IntValue = 514;

hostSetting[2].key = "Config.Defaults.security.host.ruissl";
hostSetting[2].value = true;

hostSetting[3].key = "Annotations.WelcomeMessage";
hostSetting[3].value = "Welcome to this nice an shiny ESXi host.";

host.configManager.advancedOption.updateOptions(hostSetting);

Published by txusa

VMware Certified Design Expert - VCDX 92. VMware Architect, automation enthusiast.

2 thoughts on “vCO – Configure ESXi Syslog Server and more

  1. Thanks a lot for that simple snippit!
    Helped me a lot of getting started with my script for some advanced settings.
    Still up to date with ESXi 5.5 and 6.0.
    Best way to find out the variable typ in the current versions is the MOB browser of the ESXi/vCenter.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: