vSphere REST API GET: /api/vcenter/host Fails with error "vapi.data.structure.union.extra" when ESXi Host is in DPM Standby Mode.
search cancel

vSphere REST API GET: /api/vcenter/host Fails with error "vapi.data.structure.union.extra" when ESXi Host is in DPM Standby Mode.

book

Article ID: 419713

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When an ESXi host is placed into standby mode by Distributed Power Management (DPM), the host's connection state in vCenter Server changes to Standby.

Executing the REST API call to retrieve the host summary details: GET:/api/vcenter/host?hosts=host-****

The API returns an HTTP 500 internal server error containing the following Response:

"error_type": "INTERNAL_SERVER_ERROR",
"messages": [
  {
    "args": [
      "com.vmware. vcenter.host.summary",
      "connection_state",
      "NOT_RESPONDING",
      "power_state"
    ],
    "default_message": "Structure com.vmware.vcenter.host.summary has a union constraint with tag 'connection_state' of value 'NOT_RESPONDING', for which the field 'power_state' is not allowed to be set.",
    "id": "vapi.data.structure.union.extra"
  }
]

Environment

VMware vCenter Server 8.x

Cause

  • This issue is an known issue in vCenter Automation API (vAPI) implementation for the ESXi's host summary data structure (com.vmware.vcenter.host.summary).
  • The vAPI layer contains a constraint that mistakenly limits the presence of the powerState field to only when the host's connectionState is CONNECTED.
  • When a host is placed into standby mode by DPM, vCenter correctly sets the host's connectionState to NOT_RESPONDING but simultaneously populates the powerState as STANDBY.
  • The vAPI shim code, which is responsible for building the API response, attempts to include both the NOT_RESPONDING connection state and the known STANDBY power state. This combination violates the restrictive API constraint. The internal validation fails, resulting in the vapi.data.structure.union.extra error, which is returned to the user as an INTERNAL_SERVER_ERROR.

Resolution

There is currently no workarounds available to prevent the API call from failing when the host is in DPM standby mode.

The fix for this issue will be included in a future release.