Creating a host profile from an ESXi host results in “argument of type NoneType is not iterable” error message.

VMware_vSphere_Logo

Here’s an interesting one – all of a sudden my hosts started showing as “Unknown” on Host Profile Compliance screen. Error message that I was presented with reads as – “Unexpected error checking compliance: argument of type NoneType is not iterable”. Screenshot to complete the picture:

Creating_a_host_profile_from_an_ESXi_host_results_in_argument_of_type_NoneType_is_not_iterable_error_message_2

Trying to create a new host profile from the affected host was not successful either with similar error message:

Creating_a_host_profile_from_an_ESXi_host_results_in_argument_of_type_NoneType_is_not_iterable_error_message_1
After some time had passed (and me trying to troubleshoot this issue of course..) I came to a conclusion that SNMP was at fault and the sole reason for errors on the host profile compliance screen. In particular snmp.xml file that sits in /etc/vmware was updated with incorrect information/formatting by a colleague of mine (don’t ask..) Not working snmp.xml file with areas of interest highlighted:

Creating_a_host_profile_from_an_ESXi_host_results_in_argument_of_type_NoneType_is_not_iterable_error_message_3

and a working counterpart that passes host profile compliance checks:

Creating_a_host_profile_from_an_ESXi_host_results_in_argument_of_type_NoneType_is_not_iterable_error_message_4

As you can see if you split the section into separate subsections called <communities></communities> and <port></port> this will not work in ESXi 5.5. Trick here is to include all info under <targets></targets> in this format:

<targets>ip_address_of_snmp_receiver@port_number community_name</targets>

which should have no negative impact on compliance checks.

So there you have it, working SNMP as well as host profiles!

Lesson learnt – don’t use outdated scripts to set SNMP values which worked on ESXi 4.x and 5.x, they might negative impact on the latest version of ESXi.

Leave a Reply