VMware {code} Community
slayedbylucifer
Enthusiast
Enthusiast

Error connecting to server at 'https://<my-vCenter_hostname>/sdk/webService': Bad hostname

Hello,

This a newby question so must be an easier one for most of you to answer. I am learning perl SDK for vSphere 5. I have written a simple script to get the list of VMs on a perticular datastore. This is the command I run:

# perl test.pl --server <my_vCenter_hostname> --username <username> --datacenter <datacenter_name>

but my script fails right in the beginning as below:

Enter password:
Error connecting to server at 'https://<my_vCetner>/sdk/webService': Bad hostname
If I try to access https://<my_vCetner>/sdk/webService, I get a blank page. So Could you help me udnerstand what is going wrong here?
I am not specifying the whole URL anywhere in the scipt. I am just passing the hostsname of my vCetner as one of hte parameters.
It is quite evident that this is my 1st perl script in vSphere SDK Smiley Happy
Many thnaks.
Tags (1)
0 Kudos
1 Reply
slayedbylucifer
Enthusiast
Enthusiast

so the  hostname I was using was alias to the vCenter. I used the actual hostname of the vCetner and it worked.

i need to see why DNS is failing on the alias.

Thnaks.

0 Kudos