Mailing List Archive

Authentication on XenAPi
Hi,

I'm making a Webmin module to monitor my Xen servers, based on a perl script, writed by Ingard Mevåg (thank a lot).

But I am not able to connect me on a XenApi session, because I don't understand how to configure xend-config.sxp file.

Here the lines i'm using to connect to a session on my perl script :

##### CONFIG ######
my %xenhosts = ("192.168.0.12" => {"port" => "9363"},"localhost" => {"port" => "9363"} );
##### CONFIG END ###

##### STATIC VARS #####
my %host_info;
#######################
my $xen = RPC::XML::Client->new("http://$xenhost:$xenhosts{$xenhost}{'port'}");
my $session = $xen->simple_request("session.login_with_password", " "," ");
if (! $session)
{
print "Can't connect to $xenhost :(\n";
$xenhosts{$xenhost} = {'xen' => $xen, 'session' => ""};
}
else
{
$xenhosts{$xenhost} = {'xen' => $xen, 'session' => $session->{'Value'}};
print "Connected successfully to $xenhost..\n";
}

When I Launch my script, there result "Can't connect to $xenhost :(".

Where are the loggin and password authentication,in which file?
Could you help me to choose the good parameter in :
(xend-http-server no)
(xend-unix-server no)
(xend-tcp-xmlrpc-server no)
(xend-unix-xmlrpc-server yes)
(xend-relocation-server no)
(xend-relocation-server yes)
(xend-unix-path /var/lib/xend/xend-socket)
...

Thanks

=


--
Powered by Outblaze

_______________________________________________
xen-api mailing list
xen-api@lists.xensource.com
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
Re: Authentication on XenAPi [ In reply to ]
In the file /etc/xen/xend-config.sxp, append the following:

(xen-api-server ((9363 'none' '' )(unix none)))

and restart the xend service. This will allow you to connect to the
api-server on port 9363 (unconditional access, no authentication.... you
can modify this for conditional access/authentication as per your
requirements, which is explained at the top of the same file)....

Verify by "telnet <xenhost> 9363", and see if you are able to connect..

You will not need any other configuration (for http/tcp xmlrpc-server
etc.), and may very well comment them out...
Just make sure, there are no more uncommented lines in the file which
specify some other service to use the port 9363....

I'm not very much sure about perl as such, but at the first look:
new("http://$xenhost:$xenhosts{$xenhost}{'port'}");
seems to be not what you want.... your url must be of the format
"http://xenhost:port"...

Saurabh.

lestat thor wrote:
> Hi,
>
> I'm making a Webmin module to monitor my Xen servers, based on a perl script, writed by Ingard Mevåg (thank a lot).
>
> But I am not able to connect me on a XenApi session, because I don't understand how to configure xend-config.sxp file.
>
> Here the lines i'm using to connect to a session on my perl script :
>
> ##### CONFIG ######
> my %xenhosts = ("192.168.0.12" => {"port" => "9363"},"localhost" => {"port" => "9363"} );
> ##### CONFIG END ###
>
> ##### STATIC VARS #####
> my %host_info;
> #######################
> my $xen = RPC::XML::Client->new("http://$xenhost:$xenhosts{$xenhost}{'port'}");
> my $session = $xen->simple_request("session.login_with_password", " "," ");
> if (! $session)
> {
> print "Can't connect to $xenhost :(\n";
> $xenhosts{$xenhost} = {'xen' => $xen, 'session' => ""};
> }
> else
> {
> $xenhosts{$xenhost} = {'xen' => $xen, 'session' => $session->{'Value'}};
> print "Connected successfully to $xenhost..\n";
> }
>
> When I Launch my script, there result "Can't connect to $xenhost :(".
>
> Where are the loggin and password authentication,in which file?
> Could you help me to choose the good parameter in :
> (xend-http-server no)
> (xend-unix-server no)
> (xend-tcp-xmlrpc-server no)
> (xend-unix-xmlrpc-server yes)
> (xend-relocation-server no)
> (xend-relocation-server yes)
> (xend-unix-path /var/lib/xend/xend-socket)
> ...
>
> Thanks
>
> =
>
>
>


_______________________________________________
xen-api mailing list
xen-api@lists.xensource.com
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api