I am about to go bonkers trying to figure out how to configure snmp on an esx host using Orchestrator. I see the object for it (VcHostSystem.configManager.snmpSystem) but this is set to null when I try to use it. I used the managed object browser and sure enough it shows up as "unset" . The api documentation confirms that this is where I would go to update this configuration but i can't seem to make this work. All the searches I do show people using one of the remote command line tools to set this. Can anyone assist with a way they are doing this with orchestrator? I suppose I could create a workflow that calls out to the command line utils but that seems barbaric. I also thought I could maybe manipulate the xml file directly on the host but again it seems rather caveman like. Hopefully I am just missing something obvious in my attempts to do this.
Here is my test code:
This seems to be another of those unfortunate ESXi features that cannot be managed through a vCenter. So, for each host you wish to manage, you have to import the SSL cert and add the host to vCO in order to make such changes. Based on my test script, and manually adding the SSL cert and host to my vCO server I was able to set the SNMP settings as you coded above.
I haven't tried doing anything with the SNMP stuff of a host yet... if I were to try, I think the first thing I would do is setup ONYX to record the actions I perform in the vCenter client, then use the vCO Javascript it generates to try some tests... of course there is a little cleanup of the script it generates, but it should hopefully get you pretty close.
Here is a nice kb for your kind information. Have a look..
kb.vmware.com/kb/1008065
Maybe I am going crazy here but I don't see any way of configuring snmp from within the vi client. I actually was going to use ONYX for this. As far as I can tell it is only via the command line. I could create a workflow using the ssh plugin to run this but that seems really lame. Like I said the functionality is documented in the api I just can't seem to get the code to run. I listed my test code in the original post. I also tried walking the managed objec browser but no joy.
Thanks for the link to the kb but that is just documenting the command line method of making the configuration change. I want to do this with an orchestrator workflow using the vCenter plugin.
Hi, please take a look at this PowerCLI thread about the same issue.
http://communities.vmware.com/message/1189281
It might be helpful.
Thanks.
This seems to be another of those unfortunate ESXi features that cannot be managed through a vCenter. So, for each host you wish to manage, you have to import the SSL cert and add the host to vCO in order to make such changes. Based on my test script, and manually adding the SSL cert and host to my vCO server I was able to set the SNMP settings as you coded above.
Ugh... we have a huge environment and the idea of adding individual hosts to Orchestrator seems like a nightmare (and will really clutter up Orchestrator). I guess I will see if I can automate adding a host to Orchestrator, making the configuration change, then removing the host or maybe I can get this to work with the rest plugin. We have been trying to get this to work with host profiles but there are problems going that route. We have had inconsistencies in the way the profiles get applied as well as needing different SNMP configurations depending on the location/role of the particular ESX host.
So is this considered a bug in the api or is this by design? It is supremely frustrating to me that 95% of the api is available when connecting to the vCenter that is managing it. Off the top of your head what are some of the other things that are not available via vCenter?
Paul
I figured I would post how I got this working in our environment. Sorry but some of the system calls are out to my actions. You'll need to substitute those with something of your own. If you need those I could provide for you but they are simple things like retrieving the configuration item and removing white space
1. setup a scripting host or use the vMA appliance. I am using our vMA appliance.
2. Using the SSH plugin add the host to your vCenter Orchestrator and do a key exchange.
3. I created an action to check if the host already has any SNMP settings since in our environment we only want to populate things if this is empty or we specifically tell the update action to overwrite. My action looks as follows.