Validating connection on the vCenter adapter fails with error "Unable to connect to VC: Unexpected error code: 404"in VCF Operations
search cancel

Validating connection on the vCenter adapter fails with error "Unable to connect to VC: Unexpected error code: 404"in VCF Operations

book

Article ID: 433360

calendar_today

Updated On:

Products

VCF Operations

Issue/Introduction

  • The collection status of vCenter Adapter under "Administration -> Integrations" is in Warning state
  • Hovering on "Warning" yields error "Unable to connect to VC"
  • Validating the vCenter with "Administrator" credentials fails with "Unable to connect to VC: Unexpected error code: 404
  • An incorrect entry is added for the vCenter server in VCF Operations in /etc/hosts
  • Adapter logs (/logs/adapters/VMwareAdapter/VMwareAdapter_*.log) show entries as below :
    YYYY-MM-DDT:##:####ERROR VMwareAdapter 25254 [ops@4413 threadId="229" threadName="Collector worker thread 14" instanceId="63"] [(63) com.integrien.adapter.vmware.VMwareAdapter.onCollect] - Exception in onCollect calljava.lang.RuntimeException: Unable to connect to VC    at com.integrien.adapter.vmware.VMwareAdapter.prepareCollection(VMwareAdapter.java:1730) ~[vmwarevi_adapter3.jar:?]    at com.integrien.adapter.vmware.VMwareAdapter.onCollect(VMwareAdapter.java:1130) ~[vmwarevi_adapter3.jar:?]    at com.integrien.alive.common.adapter3.AdapterBase.collectBase(AdapterBase.java:775) ~[vrops-adapters-sdk.jar:?]    at com.integrien.alive.common.adapter3.AdapterBase.collect(AdapterBase.java:547) ~[vrops-adapters-sdk.jar:?]    at com.integrien.alive.collector.CollectorWorkItem3.run(CollectorWorkItem3.java:52) ~[vcops-collector-1.0-SNAPSHOT.jar:?]    at com.integrien.alive.common.util.ThreadPool$WorkerItem.run(ThreadPool.java:275) ~[vrops-adapters-sdk.jar:?]    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]    at 

Environment

VCF Operations 9.x

Cause

This happens due to an incorrectly altered /etc/hosts file contents in VCF Operations.

 

Resolution

  1. Ensure that the DNS records and network connectivity is in place for resolution/connectivity to work from VCF Operations to vCenter and vice versa.
  2. Revert any manual changes made to the /etc/hosts file on VCF Operations post deployment. An unaltered file should look as below:
    # vROps_EDIT_BEGIN
    # Generated by Vrops-Init service. Do not modify manually.
    127.0.0.1 localhost
    <IP> <VCF Operations shortname>
    ::1 <VCF Operations shortname> localhost ipv6-localhost ipv6-loopback
    # vROps_EDIT_END
  3. Retry adding the vCenter adapter.

Additionally, please note that manual changes to the appliance are not recommended/supported. ReferVMware Virtual Appliances and customizations to operating system and included packages