hi,: I am a new user of libvirt ,I asked a question about using libvirt to connect to esxi server. I got the answer is https://www.redhat.com/archives/libvir-list/2012-February/msg00860.html So,I try to make the change on the mailing list you just added. - * Add a dummy expect header to stop CURL from waiting for a response code + * Add an empty expect header to stop CURL from waiting for a response code - curl->headers = curl_slist_append(curl->headers, "Expect: nothing"); + curl->headers = curl_slist_append(curl->headers, "Expect:"); and I did the follow steps in my computer: 1../configure --with-esx 2.make 3.make install 4../autogen.sh --prefix=$HOME/usr 5.make 6.make install I complete installing the libvirt and run the command :virsh --version ,get the right answer 0.9.7 and I run the command :virsh -c esx://me at exampe.com/?tansport=http the error before I mentioned related to http did disappeared ,but and I still get a error like:error: internal error XPath evaluation of response for call to 'RetrieveServiceContent' failed I don't understand what does this error mean,or is my steps wrong ?so I hope you can help me to figure out the promble. thanks a lot and so sorry for trouble you too much .waiting for you reply on line. ps: I have another question about libvirt , I saw this :%if %{with_esx}%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6 in /libvirt0.9.7/livirt.spec,I want to know if libvirt esx driver only can be useful on fedora>=9||rhel>=6,and the other OS like centos 6.0 or redhat ,will disable the use of esx driver of libvirt. thanks again. best regards! ------------------ ???? ------------------ ???: "Matthias Bolte"<matthias.bolte at googlemail.com>; ????: 2012?2?21?(???) ??5:44 ???: "???"<453193368 at qq.com>; ??: "libvirt-users"<libvirt-users at redhat.com>; ??: Re: [libvirt-users] the probelm in using libvirt to connect esx server 2012/2/20 ??? <453193368 at qq.com>:> hi, > I am a new user of libvirt ,i really appreciate libvirt?and want to use it > in my work.I want to use it to conncet to a ESXi server.when I try to > connect to the server ,I use the command :virsh -c > esx://name at exmaple.com,And I get an > > 1.error :error: internal error curl_easy_perform() returned an error: > Couldn't connect to server (7) : couldn't connect to host > so I think maybe the firewall shutdown the 443 for https,so I used > command:virsh -c esx://name at example.com/?transport=http And I still get an > error like: > error: internal error HTTP response code 417 for call to > 'RetrieveServiceContent' > error: failed to connect to the hypervisorHTTP error code 417 is related to the Expect header. The error indicates that the server or a proxy in between doesn't handle the Expect header. I assume that the ESXi sever itself is not the problem, because it works for me here. Maybe there is a HTTP proxy between your computer and the ESXi server that returns this 417 error code. This problem is probably related to libvirt sending a dummy Expect header instead of sending no Expect at all. If you're building libvirt from source you can try this patch that I just send to the mailing list for review https://www.redhat.com/archives/libvir-list/2012-February/msg00860.html It fixes the Expect header problem and might fix your connection problem. -- Matthias Bolte http://photron.blogspot.com </:includetail> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120221/a1e7deda/attachment.htm>
[when replying to an existing thread, it helps to use proper In-Reply-To mail headers to keep it properly threaded. Also, top-posting on technical lists is discouraged] On 02/20/2012 08:15 PM, ??? wrote:> hi,: > I am a new user of libvirt ,I asked a question about using libvirt to connect to esxi server. I got the answer is https://www.redhat.com/archives/libvir-list/2012-February/msg00860.html > So,I try to make the change on the mailing list you just added. > - * Add a dummy expect header to stop CURL from waiting for a response code > + * Add an empty expect header to stop CURL from waiting for a response code > - curl->headers = curl_slist_append(curl->headers, "Expect: nothing"); > + curl->headers = curl_slist_append(curl->headers, "Expect:"); > and I did the follow steps in my computer: > 1../configure --with-esx > 2.make > 3.make install > 4../autogen.sh --prefix=$HOME/usr > 5.make > 6.make install > I complete installing the libvirt and run the command :virsh --version ,get the right answer 0.9.7The latest release is 0.9.10; if you still have problems, you might want to consider upgrading before re-trying that patch.> and I run the command :virsh -c esx://me at exampe.com/?tansport=http > the error before I mentioned related to http did disappeared ,but > and I still get a error like:error: internal error XPath evaluation of response for call to 'RetrieveServiceContent' failed > I don't understand what does this error mean,or is my steps wrong ?so I hope you can help me to figure out the promble. thanks a lot and so sorry for trouble you too much .waiting for you reply on line.Sorry, I don't know the answer to this one.> > ps: I have another question about libvirt , I saw this :%if %{with_esx}%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6 in /libvirt0.9.7/livirt.spec,I want to know if libvirt esx driver only can be useful on fedora>=9||rhel>=6,and the other OS like centos 6.0 or redhat ,will disable the use of esx driver of libvirt.But I do know this - that is just stating that when building the RPM files for the distro version of libvirt included in Fedora or RHEL, then those are the distro defaults. That is, Fedora will default to ESX support on, and RHEL 5 defaults to ESX off while RHEL 6 defaults to ESX on. But those are defaults, and you can override them if you are rebuilding the RPM yourself; furthermore, if you are building from the tarball via a direct configure rather than trying to rebuild an RPM, then the contents of the spec file don't matter (since they only affect an RPM build). -- Eric Blake eblake at redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 620 bytes Desc: OpenPGP digital signature URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120221/3877079a/attachment.sig>
2012/2/21 ??? <453193368 at qq.com>:> hi,: > I am a new user of libvirt ,I asked a question about using libvirt to > connect to esxi server. I got the answer is > https://www.redhat.com/archives/libvir-list/2012-February/msg00860.html > ? So,I try to make the change on the mailing list you just added. > ?-?? ? * Add a dummy expect header to stop CURL from waiting for a response > code > ?+?? ? * Add an empty expect header to stop CURL from waiting for a response > code > ? -? ? curl->headers = curl_slist_append(curl->headers, "Expect: nothing"); > ?+? ? curl->headers = curl_slist_append(curl->headers, "Expect:"); > and I did the follow steps in my computer: > 1../configure --with-esx > 2.make > 3.make install > 4../autogen.sh --prefix=$HOME/usr > 5.make > 6.make install > I complete installing the libvirt and run the command :virsh --version? ,get > the right answer 0.9.7 > and I run the command :virsh -c esx://me at exampe.com/?tansport=http > the error before I mentioned related to http did disappeared ,butOkay, this is good.> and I still get a error like:error: internal error XPath evaluation of > response for call to 'RetrieveServiceContent' failedThis is bad. This means that your ESXi server has send an response that libvirt does not understand.> ?I don't understand what does this error mean,or is ?my steps wrong ?so I > hope you can help me to figure out the promble. thanks a lot and so sorry > for trouble you too much .waiting for you reply on line.I don't have enough information at hand to tell what is going wrong here. You could provide more information by applying the attached patch to your libvirt source code and recompile it. The patch enables complete HTTP traffic logging. It makes libvirt output all its communication with the ESXi server to the log. Then run this command LIBVIRT_DEBUG=1 LIBVIRT_LOG_OUTPUTS=1:file:esx_traffic.log virsh -c esx://example.com/?transport=http It'll output the debug information to a file named esx_traffic.log in the current directory. If you mail me this log file I might be able to figure out what the problem is. Be aware that this log will contain your ESXi hostname, username and password in clear text, so you might want to remove this information from the log file before mailing it to the list.> ps: I have another question about libvirt , I saw this :%if %{with_esx}%if > 0%{?fedora} >= 9 || 0%{?rhel} >= 6 in /libvirt0.9.7/livirt.spec,I want to > know if libvirt esx driver only can be useful on fedora>=9||rhel>=6,and the > other OS like centos 6.0 or redhat ,will disable the use of esx driver of > libvirt.As Eric explained this is basically a policy decision and is not related to any problems with the ESX driver on older Fedora or RHEL version. I think your specific problem is in your specific network and/or ESXi server setup and the traffic log might allow to reveal and fix it. Regards, Matthias> ------------------ ???? ------------------ > ???:?"Matthias Bolte"<matthias.bolte at googlemail.com>; > ????:?2012?2?21?(???) ??5:44 > ???:?"???"<453193368 at qq.com>; > ??:?"libvirt-users"<libvirt-users at redhat.com>; > ??:?Re: [libvirt-users] the probelm in using libvirt to connect esx server > > 2012/2/20 ??? <453193368 at qq.com>: >> hi, >> I am a new user of libvirt ,i really appreciate libvirt?and want to use it >> in my work.I want to use it to conncet to a ESXi server.when I try to >> connect to the server ,I use the command :virsh -c >> esx://name at exmaple.com,And I get an >> >> 1.error :error: internal error curl_easy_perform() returned an error: >> Couldn't connect to server (7) : couldn't connect to host >> ?so I think maybe the firewall shutdown the 443 for https,so I used >> command:virsh -c esx://name at example.com/?transport=http And I still get an >> error like: >> error: internal error HTTP response code 417 for call to >> 'RetrieveServiceContent' >> error: failed to connect to the hypervisor > > HTTP error code 417 is related to the Expect header. The error > indicates that the server or a proxy in between doesn't handle the > Expect header. I assume that the ESXi sever itself is not the problem, > because it works for me here. Maybe there is a HTTP proxy between your > computer and the ESXi server that returns this 417 error code. > > This problem is probably related to libvirt sending a dummy Expect > header instead of sending no Expect at all. > > If you're building libvirt from source you can try this patch that I > just send to the mailing list for review > > https://www.redhat.com/archives/libvir-list/2012-February/msg00860.html > > It fixes the Expect header problem and might fix your connection problem. > > -- > Matthias Bolte > http://photron.blogspot.com > > _______________________________________________ > libvirt-users mailing list > libvirt-users at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users-------------- next part -------------- A non-text attachment was scrubbed... Name: esx_enable_traffic_debug.patch Type: text/x-patch Size: 384 bytes Desc: not available URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120221/e1437bf4/attachment.bin>