Brilliant! I was not building with ESX support.<div><br></div><div>Thanks.<br><br><div class="gmail_quote">On Thu, Mar 4, 2010 at 2:31 PM, Matthias Bolte <span dir="ltr"><<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">2010/3/4 Jonathan Kelley <<a href="mailto:jkelley@vm-labs.com">jkelley@vm-labs.com</a>>:<br>
</div><div class="im">> I must be missing something here so I don't need to install anything but<br>
> using esx requires what looks like TLS configured along with libvirtd<br>
> running on ESX.<br>
> When I do esx:// I get the following:<br>
> 14:07:44.736: debug : virConnectOpenAuth:1355 : name=esx://test?no_verify=1,<br>
> auth=0x7f4512a6e5a0, flags=0<br>
> 14:07:44.736: debug : do_open:1110 : name "esx://test?no_verify=1" to URI<br>
> components:<br>
>   scheme esx<br>
>   opaque (null)<br>
>   authority (null)<br>
>   server test<br>
>   user (null)<br>
>   port 0<br>
>   path ?no_verify=1<br>
<br>
</div>Your libxml2 version expects a / before the query parameters. you<br>
should use esx://test/?no_verify=1 as URI.<br>
<div class="im"><br>
> 14:07:44.736: debug : do_open:1120 : trying driver 0 (Test) ...<br>
> 14:07:44.736: debug : do_open:1126 : driver 0 Test returned DECLINED<br>
> 14:07:44.736: debug : do_open:1120 : trying driver 1 (OPENVZ) ...<br>
> 14:07:44.736: debug : do_open:1126 : driver 1 OPENVZ returned DECLINED<br>
> 14:07:44.736: debug : do_open:1120 : trying driver 2 (VBOX) ...<br>
> 14:07:44.736: debug : do_open:1126 : driver 2 VBOX returned DECLINED<br>
<br>
</div>Here libvirt should probe the ESX driver, but it doesn't, and because<br>
no driver accepted the URI until here libvirt probes the remote<br>
driver. The remote driver then tries to connect to a libvirtd on the<br>
ESX server but fails.<br>
<br>
Sorry, I should have spotted this problem in your previous mail.<br>
<div class="im"><br>
> 14:07:44.736: debug : do_open:1120 : trying driver 3 (remote) ...<br>
> 14:07:44.736: debug : doRemoteOpen:564 : proceeding with name =<br>
> esx://%3Fno_verify=1<br>
> 14:07:44.737: debug : initialise_gnutls:1143 : loading CA file<br>
> /apps/etc/pki/CA/cacert.pem<br>
> 14:07:44.737: debug : initialise_gnutls:1156 : loading client cert and key<br>
> from files /apps/etc/pki/libvirt/clientcert.pem and<br>
> /apps/etc/pki/libvirt/private/clientkey.pem<br>
> 14:07:44.739: error : doRemoteOpen:644 : unable to connect to libvirtd at<br>
> 'test': Connection refused<br>
> 14:07:44.739: debug : do_open:1126 : driver 3 remote returned ERROR<br>
> 14:07:44.739: debug : virUnrefConnect:259 : unref connection 0x1f3bd10 1<br>
> 14:07:44.739: debug : virReleaseConnect:216 : release connection 0x1f3bd10<br>
> -Jon<br>
<br>
</div>The problems here is that your libvirt doesn't have ESX support<br>
enabled. The ESX driver requires libcurl 7.18.0 or newer. The<br>
configure script tests if libcurl is available and disables ESX<br>
support if it's missing. Check the summary at the end of the configure<br>
script output and make sure it says 'ESX: yes'.<br>
<br>
The libvirt error reporting in the case of known but disabled drivers<br>
is not so useful. You're not the first one that struggles with this<br>
problem. I've a half finished patch lying around that addresses this<br>
problem and improves the error reporting in this situation.<br>
<font color="#888888"><br>
Matthias<br>
</font><div><div></div><div class="h5"><br>
> On Thu, Mar 4, 2010 at 1:54 PM, Matthias Bolte<br>
> <<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>> wrote:<br>
>><br>
>> Ah, don't use esx+ssh://, just use esx://<br>
>><br>
>> The scheme format <driver>+<transport>:// implies that you want to use<br>
>> the libvirt remote mechanisms via the libvirt daemon (libvirtd) or the<br>
>> server side, but the ESX driver doesn't use this. It directly connects<br>
>> to the ESX server using HTTPS.<br>
>><br>
>> You do not need to have or install netcat on the ESX server, as said<br>
>> before an out-of-the-box ESX installation is sufficient.<br>
>><br>
>> Matthias<br>
>><br>
>> 2010/3/4 Jonathan Kelley <<a href="mailto:jkelley@vm-labs.com">jkelley@vm-labs.com</a>>:<br>
>> > I built it from the 0.7.6 sources but it still shows me that it is<br>
>> > running<br>
>> > the 'nc' command on the ESX server (which does not exist). Is netcat<br>
>> > required to be on ESX?<br>
>> ><br>
>> > 13:24:26.765: debug : do_open:1110 : name "esx+ssh://test" to URI<br>
>> > components:<br>
>> >  scheme esx+ssh<br>
>> >  opaque (null)<br>
>> >  authority (null)<br>
>> >  server test<br>
>> >  user (null)<br>
>> >  port 0<br>
>> >  path<br>
>> ><br>
>> > 13:24:26.765: debug : do_open:1120 : trying driver 0 (Test) ...<br>
>> > 13:24:26.765: debug : do_open:1126 : driver 0 Test returned DECLINED<br>
>> > 13:24:26.765: debug : do_open:1120 : trying driver 1 (OPENVZ) ...<br>
>> > 13:24:26.765: debug : do_open:1126 : driver 1 OPENVZ returned DECLINED<br>
>> > 13:24:26.765: debug : do_open:1120 : trying driver 2 (VBOX) ...<br>
>> > 13:24:26.765: debug : do_open:1126 : driver 2 VBOX returned DECLINED<br>
>> > 13:24:26.765: debug : do_open:1120 : trying driver 3 (remote) ...<br>
>> > 13:24:26.765: debug : doRemoteOpen:564 : proceeding with name = esx://<br>
>> > 13:24:26.765: debug : virExecWithHook:640 : ssh test nc -U<br>
>> > /apps/var/run/libvirt/libvirt-sock<br>
>> > 13:24:26.769: debug : remoteIO:8429 : Do proc=66 serial=0 length=28<br>
>> > wait=(nil)<br>
>> > 13:24:26.769: debug : remoteIO:8491 : We have the buck 66 0x7fc565c4b010<br>
>> > 0x7fc565c4b010<br>
>> > 13:24:31.384: error : remoteIOReadBuffer:7707 : server closed connection<br>
>> > 13:24:31.384: debug : remoteIOEventLoop:8376 : Giving up the buck due to<br>
>> > I/O<br>
>> > error 66 0x7fc565c4b010 (nil)<br>
>> > 13:24:31.384: debug : do_open:1126 : driver 3 remote returned ERROR<br>
>> > 13:24:31.384: debug : virUnrefConnect:259 : unref connection 0x1146d20 1<br>
>> > 13:24:31.384: debug : virReleaseConnect:216 : release connection<br>
>> > 0x1146d20<br>
>> ><br>
>> ><br>
>> > Thanks,<br>
>> > Jon<br>
>> ><br>
>> > On Thu, Mar 4, 2010 at 12:26 PM, Matthias Bolte<br>
>> > <<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>> wrote:<br>
>> >> 2010/3/4 Jonathan Kelley <<a href="mailto:jkelley@vm-labs.com">jkelley@vm-labs.com</a>>:<br>
>> >>> Hello,<br>
>> >>><br>
>> >>> I am trying to access an ESXi host using libvirt but it seems that it<br>
>> >>> requires netcat to be running on the ESX server.<br>
>> >>><br>
>> >>> My ESX 4 does not have this installed and I am wondering if this is<br>
>> >>> required or is there some other way to get this working?<br>
>> >>><br>
>> >>> Thanks,<br>
>> >>> Jon<br>
>> >>><br>
>> >><br>
>> >> No, you do not have to install anything on the ESX or ESXi server.<br>
>> >> libvirt works with an out-of-the-box installation of ESX.<br>
>> >><br>
>> >> Make sure your libvirt version is new enough (0.7.0 or newer) and that<br>
>> >> the ESX support is enabled. For example if you've installed libvirt<br>
>> >> from Debian packages then you'll need to build libvirt from source,<br>
>> >> because Debian explicitly disables ESX support in their packages for<br>
>> >> some unknown reason.<br>
>> >><br>
>> >> See <a href="http://libvirt.org/drvesx.html" target="_blank">http://libvirt.org/drvesx.html</a> if you haven't yet.<br>
>> >><br>
>> >> Matthias<br>
>> >><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>