Hi Michal, <br><br>That resolved the issue! Thank you very much for the quick resolution, I appreciate it.<br><br>Best regards,<br>Koen<br><br><div class="gmail_quote">On Wed, Jun 29, 2011 at 4:00 PM, Michal Novotny <span dir="ltr"><<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Koen,<br>
please try this patch. I can't test it myself since it's logging<br>
automatically in my setup but I *think* I may have found the problem.<br>
Could you please apply attached patch (revert the patch I sent to you<br>
before) and provide me the test results?<br>
<br>
Thanks,<br>
Michal<br>
<div class="im"><br>
On 06/29/2011 03:47 PM, Koen Calliauw wrote:<br>
> Hi Michal,<br>
><br>
</div><div><div></div><div class="h5">> Here's the output. Please note that special characters were visible<br>
> when opening the file with vi, though not with a cat on the console,<br>
> so this is a copy/paste out of vi.<br>
><br>
> [2011-06-29 15:43:58 libvirt-php/core]: libvirt_connect: credentials<br>
> index 2<br>
> [2011-06-29 15:43:58 libvirt-php/core]: libvirt_connect: credentials<br>
> index 5<br>
> [2011-06-29 15:43:58 libvirt-php/core]: libvirt_connect: Found 2<br>
> elements for credentials<br>
> [2011-06-29 15:43:58 libvirt-php/core]:<br>
> libvirt_virConnectAuthCallback: cred 0, type 2, prompt Enter username<br>
> for 10.9.0.2 [root] challenge 10.9.0.2<br>
> [2011-06-29 15:43:58 libvirt-php/core]:<br>
> libvirt_virConnectAuthCallback: result rootV^? (4)<br>
> [2011-06-29 15:43:58 libvirt-php/core]:<br>
> libvirt_virConnectAuthCallback: cred 0, type 5, prompt Enter rootV^?'s<br>
> password for 10.9.0.2 challenge 10.9.0.2<br>
> [2011-06-29 15:43:58 libvirt-php/core]:<br>
> libvirt_virConnectAuthCallback: result fakepass (12)<br>
> [Wed Jun 29 15:44:00 2011] [error] [client 10.9.1.10] PHP Warning:<br>
> libvirt_connect(): internal error HTTP response code 500 for call to<br>
> 'Login'. Fault: ServerFaultCode - Cannot complete login due to an<br>
> incorrect user name or password. in /var/www/virt.php on line 9,<br>
> referer: <a href="http://10.9.0.3/" target="_blank">http://10.9.0.3/</a><br>
> [2011-06-29 15:44:00 libvirt-php/core]: libvirt_connect: Cannot<br>
> establish connection to esx://<a href="http://10.9.0.2?transport=http" target="_blank">10.9.0.2?transport=http</a><br>
</div></div><div class="im">> <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>><br>
><br>
> Best regards,<br>
> Koen Calliauw<br>
><br>
><br>
><br>
</div><div class="im">> On Wed, Jun 29, 2011 at 3:35 PM, Michal Novotny <<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>>> wrote:<br>
><br>
> Hi Koen,<br>
</div><div class="im">> that's bad. I don't have logging of username and password length here.<br>
> I'll try to work on this. You can try attached patch to extend logging<br>
> by username and password in the mean time and provide me the full<br>
> resulting log file? Please review whether there is no password and if<br>
> there is then please change it to fakepass.<br>
><br>
> Thanks,<br>
> Michal<br>
><br>
> On 06/29/2011 03:19 PM, Koen Calliauw wrote:<br>
> > Hi Michal,<br>
> ><br>
> > Here's what appears in the logfile when using libvirt_logfile_set:<br>
> ><br>
> > [Wed Jun 29 15:18:00 2011] [error] [client 10.9.1.10] PHP Warning:<br>
> > libvirt_connect(): internal error HTTP response code 500 for call to<br>
> > 'Login'. Fault: ServerFaultCode - Cannot complete login due to an<br>
> > incorrect user name or password. in /var/www/virt.php on line 9,<br>
> > referer: <a href="http://10.9.0.3/" target="_blank">http://10.9.0.3/</a><br>
> > [2011-06-29 15:18:00 libvirt-php/core]: libvirt_connect: Cannot<br>
> > establish connection to esx://<a href="http://10.9.0.2?transport=http" target="_blank">10.9.0.2?transport=http</a><br>
> <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>><br>
> > <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>><br>
> ><br>
> > Best regards,<br>
> > Koen Calliauw<br>
> ><br>
> > On Wed, Jun 29, 2011 at 3:10 PM, Michal Novotny<br>
> <<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>><br>
</div><div><div></div><div class="h5">> > <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>>>> wrote:<br>
> ><br>
> > Hi Koen,<br>
> > thanks for you e-mail. I don't know what exactly is going on<br>
> here but<br>
> > could you please try to enable debug logging using<br>
> ><br>
> > libvirt_logfile_set($filename, $maxsize)<br>
> ><br>
> > API function? The maxsize parameter is optional and it<br>
> defaults to<br>
> > 1024<br>
> > KiB (1M). The file have to have write permissions so you can<br>
> touch the<br>
> > file, e.g. debug.log and change it's permissions to 777 to allow<br>
> > logging. Once you try to login using the script you<br>
> mentioned with<br>
> > debug<br>
> > set you will get the debug output into the debug.log file which<br>
> > could be<br>
> > send to us for further analysis.<br>
> ><br>
> > Thanks,<br>
> > Michal<br>
> ><br>
> ><br>
> > On 06/29/2011 03:03 PM, Koen Calliauw wrote:<br>
> > > Hi all,<br>
> > ><br>
> > > I've started playing with libvirt-php yesterday and with<br>
> the help of<br>
> > > Michal Novotny got it running quite painlessly. However,<br>
> the login<br>
> > > from PHP to my testing ESXi server seems to be failing. I've<br>
> > > wiresharked the HTTP traffic with a virsh -c (which works) and<br>
> > > compared that to the traffic I see when using the libvirt-php<br>
> > > extension, here's the difference I see (mind the username)<br>
> > ><br>
> > > Not working (libvirt-php)<br>
> > ><br>
> > > <Login xmlns="urn:vim25"><_this xmlns="urn:vim25"<br>
> > > xsi:type="ManagedObjectReference"<br>
> > > type="SessionManager">ha-sessionmgr</_this><userName<br>
> > xmlns="urn:vim25"<br>
> > > xsi:type="xsd:string">root8.</userName><password<br>
> xmlns="urn:vim25"<br>
> > > xsi:type="xsd:string">fakepass</password></Login><br>
> > ><br>
> > > Working (virsh -c)<br>
> > ><br>
> > > <Login xmlns="urn:vim25"><_this xmlns="urn:vim25"<br>
> > > xsi:type="ManagedObjectReference"<br>
> > > type="SessionManager">ha-sessionmgr</_this><userName<br>
> > xmlns="urn:vim25"<br>
> > > xsi:type="xsd:string">root</userName><password<br>
> xmlns="urn:vim25"<br>
> > > xsi:type="xsd:string">fakepass</password></Login><br>
> > ><br>
> > > So for some reason something gets appended (8.) or encoded<br>
> wrong or<br>
> > > something when I use the PHP extension. This is the<br>
> testing code<br>
> > I run:<br>
> > ><br>
> > > <?php<br>
> > > $credentials =<br>
> > ><br>
> array(VIR_CRED_AUTHNAME=>'root',VIR_CRED_PASSPHRASE=>'fakepass');<br>
> > > $conn = libvirt_connect("esx://<a href="http://10.9.0.2?transport=http" target="_blank">10.9.0.2?transport=http</a><br>
> <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>><br>
> > <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>><br>
> > > <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>>", FALSE, $credentials);<br>
> > > if($conn) {<br>
> > > print_r(libvirt_connect_get_hypervisor($conn));<br>
> > ><br>
> > > } else {<br>
> > > echo "Connection failed: ".libvirt_get_last_error();<br>
> > > }<br>
> > ><br>
> > > Any help with this issue would be greatly appreciated. Thanks!<br>
> > ><br>
> > > Best regards,<br>
> > > Koen Calliauw<br>
> ><br>
> ><br>
> > --<br>
> > Michal Novotny <<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a><br>
</div></div>> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a><br>
<div><div></div><div class="h5">> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>>>>,<br>
> > RHCE, Red Hat<br>
> > Virtualization | libvirt-php bindings | <a href="http://php-virt-control.org" target="_blank">php-virt-control.org</a><br>
> <<a href="http://php-virt-control.org" target="_blank">http://php-virt-control.org</a>><br>
> > <<a href="http://php-virt-control.org" target="_blank">http://php-virt-control.org</a>><br>
> ><br>
> ><br>
><br>
><br>
> --<br>
> Michal Novotny <<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>>>,<br>
> RHCE, Red Hat<br>
> Virtualization | libvirt-php bindings | <a href="http://php-virt-control.org" target="_blank">php-virt-control.org</a><br>
> <<a href="http://php-virt-control.org" target="_blank">http://php-virt-control.org</a>><br>
><br>
><br>
<br>
<br>
--<br>
Michal Novotny <<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>>, RHCE, Red Hat<br>
Virtualization | libvirt-php bindings | <a href="http://php-virt-control.org" target="_blank">php-virt-control.org</a><br>
<br>
</div></div></blockquote></div><br>