VirtualLyfe
Contributor
Contributor

Unable to connect to vcenter using PowerCLI

The web interface works fine, but when I attempt to connect via powershell, I get the following error:

PS C:\WINDOWS\system32> connect-viserver [redacted]

connect-viserver : 8/16/2018 5:16:00 PM Connect-VIServer                Could not resolve the requested VC server.

Additional Information: There was no endpoint listening at https:/[redacted]/sdk that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

At line:1 char:1

Here is the results from running "service-control --status" on vcenter:

Running:

applmgmt lwsmd pschealth vmafdd vmcad vmdird vmdnsd vmonapi vmware-cis-license vmware-cm vmware-content-library vmware-eam vmware-perfcharts vmware-psc-client vmware-rbd-watchdog vmware-rhttpproxy vmware-sca vmware-sps vmware-statsmonitor vmware-sts-idmd vmware-stsd vmware-updatemgr vmware-vapi-endpoint vmware-vmon vmware-vpostgres vmware-vpxd vmware-vpxd-svcs vmware-vsan-health vmware-vsm vsphere-client vsphere-ui

Stopped:

vmcam vmware-imagebuilder vmware-mbcs vmware-netdumper vmware-vcha

Previously, it crashed and stopped booting, but after some support engineering, it started working again. I think this may be related because previously, the PowerCLI has worked fine.

Tags (2)
0 Kudos
12 Replies
daphnissov
Immortal
Immortal

Some basic questions: What version of vCenter and what version of PowerCLI?

0 Kudos
IRIX201110141
Virtuoso
Virtuoso

"Could not resolve" sounds like a DNS problem on your maschine. Can you try a nslookup to see if you can resolve the name into the right IP? Does the problem exists when you try the IP adress rather than the FQDN of your vCenter? Same problem when connecting to a Host?

Regards,

Joerg

0 Kudos
VirtualLyfe
Contributor
Contributor

I am running vsphere 6.5 and PowerCLI 6.5.1. I am certain it is not a dns issue, because I am able to resolve the DNS name and the web app works fine.

0 Kudos
golddiggie
Champion
Champion

What version of PowerShell are you running?? Should be at least 5. Use "$PSVersionTable.PSVersion" to get the installed version. You also might want to update PowerCLI to a more recent release (latest is 10.1.1). Or make sure you have the modules fully active in your current installation.

Some additional information can be found here: How to install and configure VMware PowerCLI version 10 | The Solving http://thesolving.com/virtualization/how-to-install-and-configure-vmware-powercli-version-10/

I recall that some additional tweaks are typically performed with new installs of PowerCLI to make it work fully. If you're not 100% sure that these were made, you might want to do them again.

Read your opening post again and saw the part about how it was working and then stopped after the work was done on the vCenter Server. I'd suggest reaching out to VMware support again to get this resolved. Depending on the environment, it might be cleaner to redeploy the vCSA to get things back to 100%. If the environment is complex, then that might be a last ditch effort. If your vCSA has an upgrade path to a newer release, that could be a better model.

Hosted Systems Engineer IV (VMware environment)
Brewing beer again!
0 Kudos
SupreetK
Commander
Commander

Now that you have already ruled out any DNS issues, check if the PowerShell is using any proxy to connect. If yes, you might have to set it to NoProxy (For reference, try to connect to the same vCenter using PowerCLI from a different system within the same network. If it connects, check it's PowerShell proxy settings) -

PowerCLI not connecting to vCenter in another domain | vKARPS

Please consider marking this answer as "correct" or "helpful" if you think your questions have been answered.

Cheers,

Supreet

VirtualLyfe
Contributor
Contributor

It is not using a proxy. I am using powershell 5.0. Accessing the url "https://[redacted]/sdk" gives a 404 error. It has worked before the crash, and it has not been updated since, so I strongly suspect the service is down or not working on the vcenter server.

0 Kudos
SupreetK
Commander
Commander

Ohkay! Did you check if it is working from another machine? If yes, then there should be something wrong with the PowerShell module on the current machine.

Cheers,

Supreet

0 Kudos
karps
Contributor
Contributor

Have you tried restarting the vmware-vapi-endpoint service?

Ive had that fix issues for me in the past when I had issues with the api. It might be worth restarting the vcsa if that does not help.

Out of curiosity, which build of 6.5 are you on ?

0 Kudos
VirtualLyfe
Contributor
Contributor

Yes, I have tested, and I am certain it is not a problem with the client.

I am on 6.5.0.20000

0 Kudos
karps
Contributor
Contributor

Yeah I am with you on that, it does seem like an issue with the vcsa. I’ve seen similar behaviour in the past. So a restart of the appliance or the api service does not help ?

Do the logs show anything useful around the same time you’re trying to connect with PowerCli?

0 Kudos
VirtualLyfe
Contributor
Contributor

Yes I have tried restarting many times without success. It appear the vapi logs are displaying some issues:

2018-08-22T17:47:21.288-04:00 | WARN  | state-manager1            | ApiInterfacesFactory           | Retrieving interfaces for service bebfb03b-f20e-4b25-b5f9-57b1dd3cb9f2\com.vmware.cis.vdcs.vapi has failed.

com.vmware.vapi.client.exception.TransportProtocolException: HTTP response with status code 404 (enable debug logging for details): <!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/8.5.23</h3></body></html>

        at com.vmware.vapi.internal.protocol.client.rpc.http.ApacheHttpUtil.validateHttpResponse(ApacheHttpUtil.java:71)

        at com.vmware.vapi.internal.protocol.client.rpc.http.ApacheHttpAsyncClientTransport$SingleResponseConsumer.responseCompleted(ApacheHttpAsyncClientTransport.java:467)

        at com.vmware.vapi.internal.protocol.client.rpc.http.ApacheHttpAsyncClientTransport$DecoratorConsumer.responseCompleted(ApacheHttpAsyncClientTransport.java:333)

        at org.apache.http.impl.nio.client.MainClientExec.responseCompleted(MainClientExec.java:418)

        at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:164)

        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:355)

        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:242)

        at org.apache.http.impl.nio.client.LoggingAsyncRequestExecutor.inputReady(LoggingAsyncRequestExecutor.java:87)

        at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:264)

        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:73)

        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:37)

        at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:113)

        at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:159)

        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:338)

        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)

        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)

        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)

        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:584)

        at java.lang.Thread.run(Thread.java:748)

2018-08-22T17:47:21.290-04:00 | WARN  | state-manager1            | ApiInterfacesFactory           | The cache does not contain entry for service bebfb03b-f20e-4b25-b5f9-57b1dd3cb9f2\com.vmware.cis.vdcs.vapi. The interfaces will be skipped.

2018-08-22T17:47:21.290-04:00 | WARN  | state-manager1            | ApiInterfacesFactory           | The cache does not contain entry for service bebfb03b-f20e-4b25-b5f9-57b1dd3cb9f2\com.vmware.cis.vdcs.vapi. The interfaces will be skipped.

2018-08-22T17:47:21.290-04:00 | INFO  | state-manager1            | HealthStatusCollectorImpl      | HEALTH YELLOW Failed to connect to bebfb03b-f20e-4b25-b5f9-57b1dd3cb9f2\com.vmware.cis.vdcs.vapi vAPI provider.

2018-08-22T17:47:21.325-04:00 | WARN  | state-manager1            | ApiInterfacesFactory           | Retrieving interfaces for service 8acd5b44-ffcd-4ddb-b7eb-ead46bc48fc2\com.vmware.cis.ts.vapi has failed.

java.nio.charset.UnsupportedCharsetException: plain

        at java.nio.charset.Charset.forName(Charset.java:531)

        at org.apache.http.entity.ContentType.<init>(ContentType.java:111)

        at org.apache.http.entity.ContentType.create(ContentType.java:210)

        at org.apache.http.entity.ContentType.get(ContentType.java:258)

        at org.apache.http.entity.ContentType.getOrDefault(ContentType.java:277)

        at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.responseReceived(AbstractAsyncResponseConsumer.java:128)

        at com.vmware.vapi.internal.protocol.client.rpc.http.ApacheHttpAsyncClientTransport$DecoratorConsumer.responseReceived(ApacheHttpAsyncClientTransport.java:318)

        at com.vmware.vapi.internal.protocol.client.rpc.http.ApacheHttpAsyncClientTransport$MainConsumer.responseReceived(ApacheHttpAsyncClientTransport.java:433)

        at org.apache.http.impl.nio.client.MainClientExec.responseReceived(MainClientExec.java:332)

        at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseReceived(DefaultClientExchangeHandlerImpl.java:148)

        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.responseReceived(HttpAsyncRequestExecutor.java:224)

        at org.apache.http.impl.nio.client.LoggingAsyncRequestExecutor.responseReceived(LoggingAsyncRequestExecutor.java:112)

        at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:254)

        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:73)

        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:37)

        at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:113)

        at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:159)

        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:338)

        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)

        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)

        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)

        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:584)

        at java.lang.Thread.run(Thread.java:748)

2018-08-22T17:47:21.326-04:00 | WARN  | state-manager1            | ApiInterfacesFactory           | The cache does not contain entry for service 8acd5b44-ffcd-4ddb-b7eb-ead46bc48fc2\com.vmware.cis.ts.vapi. The interfaces will be skipped.

2018-08-22T17:47:21.326-04:00 | INFO  | state-manager1            | HealthStatusCollectorImpl      | HEALTH YELLOW Failed to connect to 8acd5b44-ffcd-4ddb-b7eb-ead46bc48fc2\com.vmware.cis.ts.vapi vAPI provider.

2018-08-22T17:47:21.375-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild metadata-sync-builder

2018-08-22T17:47:21.376-04:00 | INFO  | state-manager1            | MetadataSynchronizationBuilder | rebuild

2018-08-22T17:47:21.553-04:00 | INFO  | state-manager1            | MetadataSynchronizationBuilder | rebuild finished.

2018-08-22T17:47:21.554-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild api-metadata-builder

2018-08-22T17:47:21.590-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild diagnostic-state-builder

2018-08-22T17:47:21.591-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild security-dispatcher-builder

2018-08-22T17:47:21.592-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild endpoint-service-builder

2018-08-22T17:47:21.637-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild data-service-builder

2018-08-22T17:47:21.780-04:00 | INFO  | state-manager1            | DataServiceHelper              | Found 1 data service endpoints.

2018-08-22T17:47:21.780-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild inventory-service-builder

2018-08-22T17:47:21.831-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild router-builder

2018-08-22T17:47:21.832-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild public-api-builder

2018-08-22T17:47:21.832-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild request-filter-builder

2018-08-22T17:47:21.833-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild vapi-servlet-builder

2018-08-22T17:47:21.833-04:00 | INFO  | state-manager1            | DefaultStateManager            | Invoking rebuild rest-builder

2018-08-22T17:47:21.834-04:00 | INFO  | state-manager1            | RestBuilder                    | Publishing REST servlet rest-servlet.

2018-08-22T17:47:21.834-04:00 | INFO  | state-manager1            | RestBuilder                    | Publishing REST servlet rest-servlet-public.

2018-08-22T17:47:21.834-04:00 | INFO  | state-manager1            | HealthStatusCollectorImpl      | HEALTH GREEN Current vApi Endpoint health status is created between 2018-08-22T17:47:19EDT and 2018-08-22T17:47:21EDT.

2018-08-22T17:47:21.834-04:00 | INFO  | state-manager1            | HealthConfigurationEventListener | Computed health status is = YELLOW

2018-08-22T17:47:21.834-04:00 | INFO  | state-manager1            | HealthConfigurationEventListener | HEALTH Failed to connect to bebfb03b-f20e-4b25-b5f9-57b1dd3cb9f2\com.vmware.cis.vdcs.vapi vAPI provider.

2018-08-22T17:47:21.835-04:00 | INFO  | state-manager1            | HealthConfigurationEventListener | HEALTH Failed to connect to 8acd5b44-ffcd-4ddb-b7eb-ead46bc48fc2\com.vmware.cis.ts.vapi vAPI provider.

2018-08-22T17:47:21.835-04:00 | INFO  | state-manager1            | HealthConfigurationEventListener | HEALTH Current vApi Endpoint health status is created between 2018-08-22T17:47:19EDT and 2018-08-22T17:47:21EDT.

2018-08-22T17:47:21.835-04:00 | INFO  | state-manager1            | DefaultStateManager            | No changes. Skip rebuilding state.



0 Kudos
VirtualLyfe
Contributor
Contributor

Furthermore, I see that the VMware vAPI is running when I do service-control --list

0 Kudos