Creating a host profile from an ESXi host fails with error: argument of type 'NoneType' is not iterable
search cancel

Creating a host profile from an ESXi host fails with error: argument of type 'NoneType' is not iterable

book

Article ID: 340297

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Symptoms:
After upgrading to ESXi 5.1, you experience these symptoms:
  • You cannot create a host profile from the host.
  • Creating a host profile fails.
  • You see the error:

    Error: argument of type 'NoneType' is not iterable

  • In the /var/log/syslog.log file on the ESXi host, you see entries similar to:
Host Profiles[46238]: ERROR: SNMP plugin failed to run esxcli command "get": Errors:
Community string was not specified in trap target:

Host Profiles[46238]: ERROR: localcli system snmp get failed (LocalizedException) {
dynamicType = <unset>,
dynamicProperty = (vmodl.DynamicProperty) [],
msg = 'com.vmware.profile.AgentConfigProfile.EsxcliGet',
faultCause = <unset>,
faultMessage = (vmodl.LocalizableMessage) []
2013-06-12T11:35:36Z 2013-06-12 11:35:36,035 Host Profiles[46238]: ERROR: Exception while retrieving profile. Exception: argument of type 'NoneType' is not iterable


Environment

VMware vCenter Server 5.1.x
VMware vSphere ESXi 5.1

Cause

The issue may occur if the snmp.xml file is not updated during the upgrade.

Resolution

To resolve this issue, update the snmp.xml file.
To modify the snmp.xml file:
  1. Connect to the ESXi host with SSH. For more information, see Using ESXi Shell in ESXi 5.x (2004746).
  2. Navigate to /etc/vmware/:

    cd /etc/vmware/

  3. Back up the snmp.xml file:

    cp snmp.xml snmp.xml.bak

  4. Open the snmp.xml file using editor. For more information, see Editing files on an ESX host using vi or nano (1020302).
  5. Modify the first line in the file from:

    <?xml version="1.0"?>

    To:

    <?xml version="1.0" encoding="ISO-8859-1"?>

  6. In the targets section, add an IP address to which the SNMP traps are to be sent. For example:

    <targets>
    127.0.0.1@162 public
    </targets>

    Alternatively, if you do not want any extra traffic on the network, add a loop-back address.

  7. Save and close the snmp.xml file.

    Note: The formatting of the snmp.xml file may appear to change. However, this does not affect the functionality.


Additional Information

Editing files on an ESX host using vi or nano
Using ESXi Shell in ESXi 5.x and 6.x