VMware Communities > Developer Community > VMware Virtual Machine Automation APIs (VIX API) > Discussions

This Question is Not Answered

1 "correct" answer available (10 pts)
4 Replies Last post: Jun 24, 2008 10:42 PM by baldeep8
Reply

Problem with VMware Server 2.0 Beta and VIX API 1.5 (Vix Perl)

Jun 22, 2008 12:00 AM

Click to view baldeep8's profile Novice baldeep8 5 posts since
Jun 10, 2008

I am working on Windows XP. I have VMware Server 2.0 Beta and the Vix Api that comes with that. I have successfully compiled on Visual C++ Toolkit 2003 as well as on Visual Studio 2005 the Vix Perl package. I am using Active Perl 5.8.0.802 build. I am getting the following error when i run findhosttest.pl:

VmhsHostInfoPopulateSystem: Could not get model of host.
VmhsHostInfoPopulateSystem: Could not get vendor of host.
Connect failed, 1 Unknown error

I have modifies the following variables in findhosttest.pl:(The hostname and connType/hostHandle entries are as per some of the previous discussions in the Community forum)

$connType = VIX_SERVICEPROVIDER_VMWARE_VI_SERVER;

my $hostname = "http://127.0.0.1:8307/sdk";
my $hostport = 0;
my $username = undef;
my $password = undef;

When the actual username and password for the current user on the localhost are given as

my $username = "username" ; my $password = "passwd";

with the hostport and hostname being the same as above then i get the following error:

VmhsHostInfoPopulateSystem: Could not get model of host.
VmhsHostInfoPopulateSystem: Could not get vendor of host.
vimService.wsdl:1: parser error : Opening and ending tag mismatch: HR line 1 and body
able.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.17</h3></body>
^
vimService.wsdl:1: parser error : Opening and ending tag mismatch: HR line 1 and html
u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.17</h3></body></html>
^
vimService.wsdl:1: parser error : Premature end of data in tag body line 1
u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.17</h3></body></html>
^
vimService.wsdl:1: parser error : Premature end of data in tag html line 1
u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.17</h3></body></html>
^
noname.xml:1: parser error : Opening and ending tag mismatch: HR line 1 and body
able.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.17</h3></body>
^
noname.xml:1: parser error : Opening and ending tag mismatch: HR line 1 and html
u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.17</h3></body></html>
^
noname.xml:1: parser error : Premature end of data in tag body line 1
u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.17</h3></body></html>
^
noname.xml:1: parser error : Premature end of data in tag html line 1
u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.17</h3></body></html>
^
Connect failed, 1 Unknown error

I am not able to debug the vimService.wsdl file (as i am totally new to WebServices) located for me in C:\Program Files\VMware\VMware Server\hostd\docroot\sdk. It reads as follows:

<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2005-2008 VMware, Inc. All rights reserved.
-->
<definitions targetNamespace="urn:vimuberService"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:interface="urn:vimuber"

<import location="vim.wsdl" namespace="urn:vimuber" />
<service name="VimService">
<port binding="interface:VimBinding" name="VimPort">
<soap:address location="https://localhost/sdk/vimService" />
</port>
</service>
</definitions>

I am trying to connect to my localhost as the current user. But when i actually try to get the url http://127.0.0.1:8307/sdk its not able to connect to that page in Explorer. It gives the Page Cannot be displayed error. I have actually tried to use various combinations of ports and ip's (including localhost, machine name ip https/http) without much success in terms of both connecting directly to the /sdk url and also by giving it in the perl code. I got the 8307 port number by looking at the proxy.xml and config.xml files by looking in E:\Documents and Settings\All Users\Application Data\VMware\VMware Server\hostd. Normally i am able to connect to VMware Server UI : http://127.0.0.1:8308/ui. I am able to manually do all operations like starting and stopping VMs etc.

I dont know if the VI sdk is fully installed. I have as of now tried out only what has been the default installation of VMware Server 2.0. It seems by going thorugh the docs that VI sdk is for VMware Virtual Center and ESX Server. I am using only VMware Server 2.0 in my machine and no Virtual Center/ ESX Server.

I have also tried using the Vix Perl that gets installed when i try to run the VMware Vix exp installer.(Vix API 1.5) I built and compiled the package without errors on Visual Studio 2005. But when i run the Perl code i get the same results. The reason why i am now using the Vix Perl which comes bundled with the VMware Server 2.0 is that for previuos VMware Server 1.0 versions i have been able to successfully run the sample scripts on both Linux and Windows only if i use the one which comes with the Servers. If i install Vix API 1.1.4 it seems to give problems.

Any help in this regard is appreciated. I am new to VMware Server 2.0 and dont know what other changes to make in the perl scripts vimServiice file.

Reply Re: Problem with VMware Server 2.0 Beta and VIX API 1.5 (Vix Perl) Jun 23, 2008 10:14 AM
Click to view lemke's profile Hot Shot lemke 157 posts since
Mar 30, 2006
VMware
I've never seen that Tomcat spew before, which makes me suspect that something isn't quite right with the Server installation.
As for the proper port to try, look at proxy.xml and the definitions for httpPort and httpsPort. My box shows:
<ConfigRoot>
<httpPort>8222</httpPort>
<httpsPort>8333</httpsPort>
<EndpointList>
so the URL I pass to HostConnect() is https://localhost:8333/sdk
Reply Re: Problem with VMware Server 2.0 Beta and VIX API 1.5 (Vix Perl) Jun 24, 2008 12:11 AM
Click to view baldeep8's profile Novice baldeep8 5 posts since
Jun 10, 2008

Thanks for the reply lemke.

My proxy.xml file reads as follows:

<ConfigRoot>
<httpPort>8222</httpPort>
<httpsPort>8333</httpsPort>
<EndpointList>
<_length>5</_length>
<_type>vim.ProxyService.EndpointSpec[]</_type>
<e id="0">
<_type>vim.ProxyService.NamedPipeServiceSpec</_type>
<accessMode>httpAndHttps</accessMode>
<pipeName>\\.\pipe\vmware-proxy-webserver</pipeName>
<serverNamespace>/</serverNamespace>
</e>
<e id="1">
<_type>vim.ProxyService.LocalServiceSpec</_type>
<!--accessMode>httpsWithRedirect</accessMode-->
<accessMode>httpAndHttps</accessMode>
<port>8307</port>
<serverNamespace>/sdk</serverNamespace>
</e>
<e id="2">
<_type>vim.ProxyService.LocalServiceSpec</_type>
<accessMode>httpsWithRedirect</accessMode>
<port>8308</port>
<serverNamespace>/ui</serverNamespace>
</e>
<e id="3">
<_type>vim.ProxyService.NamedPipeServiceSpec</_type>
<accessMode>httpsOnly</accessMode>
<pipeName>\\.\pipe\vmware-proxy-vpxa</pipeName>
<serverNamespace>/vpxa</serverNamespace>
</e>
<e id="4">
<_type>vim.ProxyService.NamedPipeServiceSpec</_type>
<accessMode>httpsWithRedirect</accessMode>
<pipeName>\\.\pipe\vmware-proxy-mob</pipeName>
<serverNamespace>/mob</serverNamespace>
</e>
</EndpointList>
</ConfigRoot>

I tried passing

my $hostname = "https://localhost:8333/sdk";

my $hostname = "http://localhost:8222/sdk";

In both cases i get the same error as before:

VmhsHostInfoPopulateSystem: Could not get model of host.
VmhsHostInfoPopulateSystem: Could not get vendor of host.
Connect failed, 1 Unknown error

I am not able to connect to the above urls when i manually run it on my Web browser. (or to any /sdk url for that matter when i run manually). It gives the "Page Cannot be displayed" error. Any ideas on what could be the problem with the server installation?

Thanks.

Reply Re: Problem with VMware Server 2.0 Beta and VIX API 1.5 (Vix Perl) Jun 24, 2008 6:28 PM
in response to: baldeep8
Click to view mattrich's profile Expert mattrich 468 posts since
Nov 29, 2006
VMware
Can you try with the new port
my $hostname = "http://localhost:8222/sdk";

and with setting a valid username and password for the localhost?
Reply Re: Problem with VMware Server 2.0 Beta and VIX API 1.5 (Vix Perl) Jun 24, 2008 10:42 PM
in response to: mattrich
Click to view baldeep8's profile Novice baldeep8 5 posts since
Jun 10, 2008
Thanks for the reply mattrich.

I gave :

my $hostname = http://localhost:8222/sdk;

my $username = "user";

my $password = "passwd";

I mean i gave my actual localhost username and password. I then get the error:

VmhsHostInfoPopulateSystem: Could not get model of host.
VmhsHostInfoPopulateSystem: Could not get vendor of host.
Connect failed, 1 Unknown error

I also tried giving https://localhost:8333/sdk for the $hostname with the valid username and password. I get the same error which i have displayed above. But it no longer gives the Tomcat errors with regard to the vim.wsdl file which i have mentioned about in the beginnning of the thread.

Actions