0

I've a Windows 2008 virtual machine whose IP address is 192.168.3.150, on which I have installed the vCenter Server. As I am not expert on vSphere, I have just done a Simple Install. Then on my laptop whose IP is 192.168.2.36, I can open the Web Client in my browser.

Both machines can ping each other, so I think the network connection is OK.

However when I tried to run the Java samples of SDK package, they can't connect to the vCenter.

run.bat com.vmware.general.SimpleClient --url https://192.168.3.150/sdk --username Administrator@vsphere.local --password blablabla --ignorecert ignorecert

I got an error message:

WARNING: Java is now set to trust all SSL certificates. -- VMware samples in Java -- The server at https://192.168.3.150:7444/ims/STSService did not respond as expec ted. Is this a valid URL?Note: SSO connections only work on vCenter SSO enabled products. Use the --basic-connection switch if you know this is an ESX host. See the connection.properties file for more instructions. No valid connection available. Exiting now. Done.

I have tried to run the samples in the virtual machine, same problem.

Any idea please ?

vesontio
  • 381
  • 1
  • 7
  • 19
  • Make sure the time is correct on your vcenter/sso server and that all the services are started – vbranden Apr 21 '15 at 01:02
  • Also administrator@vsphere.local is generally all lowercase – vbranden Apr 21 '15 at 01:03
  • @vbranden All the services are running. I have tried **a**dministrator@vsphere.local, but no, it doesn't work, the account **A**dministrator was created during vCenter installation. I think it is the the Windows default administrator account. I can login the Web Client by using the account **A**dministrator@vsphere.local. – vesontio Apr 21 '15 at 01:39

2 Answers2

1

This solution works perfectly fine for VI java SDK. Pass 'true' in new ServiceInstance as last parameter to ignoreCert.

        URL serviceUrl = new URL("https://192.168.3.150/sdk");
        return new ServiceInstance(serviceUrl, "Administrator@vsphere.local","blablabla", true);
Rishi Anand
  • 280
  • 1
  • 4
  • 15
0

Well, I've solved the program by following the tutorial Getting Started With the vSphere Management SDK. I can finally connect to my vCenter by using its code. It turns out to be a certificate verification issue. I don't know why the option --ignorecert of the SDK samples doesn't work.

vesontio
  • 381
  • 1
  • 7
  • 19