NasirOm
Contributor
Contributor

Unable to connect vcenter using powerCLI

Hi

I am trying to access the vcenter from powerCLI and getting the error "The hostname could not be parsed". The vcenter version is 6.7. Encountering the same error when trying with the ip or the FQDN.

Any ideas.

Thanks..

Tags (2)
Reply
0 Kudos
asajm
Expert
Expert

Hi @NasirOm 

Check this maybe help

VIServer-Invalid-URI 

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM
Reply
0 Kudos
NasirOm
Contributor
Contributor

Thanks.. For me i am not able to connect the vcenter even when just running the command Connect-VIserer -Server Servename:port

I checked the Vimuri in vcenter settings and it has the correct FQDN.

Reply
0 Kudos
asajm
Expert
Expert

Are you tried with IP?

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM
Reply
0 Kudos
NasirOm
Contributor
Contributor

Yes i tried that too, getting the same error. i am able to access with fqdn and IP in vsphere web client. Only the powercli i am encountering the issue.

Reply
0 Kudos
NasirOm
Contributor
Contributor

Hi

This is the error screenshot just in case you need more info.

ww.jpg

Reply
0 Kudos
asajm
Expert
Expert

Try to connect without HTTPS or port

Just FQDN "yourserver.yourdomain"

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM
Reply
0 Kudos
NasirOm
Contributor
Contributor

Without mentioning the port and https the error is could not resolve the requester Vserver and no endpoint listening. Port must be mentioned for a successful connection i guess..

i tried connecting with the port but removing the https and i am getting the same hostname could not be parsed error.

Reply
0 Kudos
berndweyand
Expert
Expert

if nslookup <vcenterFQDN> resolves correct then "connect-viserver <vcenterFQDN> " should work.

connect-viserver <ip> should work always

Reply
0 Kudos
NasirOm
Contributor
Contributor

nslookup is working fine... but connect-viserver is not working.. I tried in various machines but still the same issue.

Reply
0 Kudos
berndweyand
Expert
Expert

what powercli-version do you have ? ("get-module vmware*" or "get-powercliversion")

what is your actual error when trying to connect?

Reply
0 Kudos
NasirOm
Contributor
Contributor

Powercli version is 12.4.0. Please see the screenshot of the error below.

NasirOm_0-1633937111340.jpeg

 

Reply
0 Kudos
berndweyand
Expert
Expert

did you really read the previous posts ?

try "connect-viserver <yourvcenterfqdn"

NO LEADING https, NO TRAILING port, just fqdn!

Reply
0 Kudos
NasirOm
Contributor
Contributor

Yes i read and i replied after trying.. i am getting the below error without port and https .

Could not resolve the requested VC server.
Additional Information: There was no endpoint listening at https://fqdn.com/sdk that could accept
the message. This is often caused by an incorrect address or SOAP action

 

Reply
0 Kudos
berndweyand
Expert
Expert

to eliminate dns problems try with  "connect-viserver x.x.x.x"

Reply
0 Kudos
NasirOm
Contributor
Contributor

Sorry i should have mentioned in my previous post.. I tried with just IP also without port and https and i am getting the same error message in my previous reply.

Just for your information, i am not using the default port for the vcenter connection. That is the reason i am entering the port number while trying to connect.

Reply
0 Kudos
berndweyand
Expert
Expert

ok thats a brand new info - then try connect-viserver x.x.x.x -port yyy

View solution in original post

NasirOm
Contributor
Contributor

Thanks.. Found what i was doing wrong.. i was typing x.x.x.x:portnumber instead of what you suggested.. Thanks a lot friend. Kudos...

So it should be fqdn -port yyy or x.x.x.x -port yyy.

Reply
0 Kudos