<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 12pt; color: #000000'><P>Thank you Matthias.</P>
<P> </P>
<P>I addressed the issues that you mentioned below. </P>
<P>Now i have my libvirt built for esx.</P>
<P>I followed the instructions <A href="http://libvirt.org/remote.html#Remote_TLS_CA">http://libvirt.org/remote.html#Remote_TLS_CA</A> to generate the CA key/cert and client key/cert.</P>
<P> </P>
<P>However, the connect still fails, with "error: internal error curl_easy_perform() returned an error: Peer certificate cannot be authenticated with known CA certificates (60)".</P>
<P> </P>
<P>Trace is below:</P>
<P> </P>
<P> </P>
<P><A href="mailto:root@u904-110:~/testLibVirt/example">root</A># <STRONG>virsh -c esx://a.b.c.d</STRONG></P>
<P>14:21:29.771: debug : virInitialize:336 : register drivers<BR>14:21:29.772: debug : virRegisterDriver:837 : registering Test as driver 0<BR>14:21:29.772: debug : virRegisterNetworkDriver:675 : registering Test as network driver 0<BR>14:21:29.772: debug : virRegisterInterfaceDriver:706 : registering Test as interface driver 0<BR>14:21:29.772: debug : virRegisterStorageDriver:737 : registering Test as storage driver 0<BR>14:21:29.772: debug : virRegisterDeviceMonitor:768 : registering Test as device driver 0<BR>14:21:29.772: debug : virRegisterSecretDriver:799 : registering Test as secret driver 0<BR>14:21:29.773: debug : virRegisterDriver:837 : registering Xen as driver 1<BR>14:21:29.773: debug : virRegisterDriver:837 : registering OPENVZ as driver 2<BR>14:21:29.774: debug : vboxRegister:109 : VBoxCGlueInit failed, using dummy driver<BR>14:21:29.774: debug : virRegisterDriver:837 : registering VBOX as driver 3<BR>14:21:29.774: debug : virRegisterNetworkDriver:675 : registering VBOX as network driver 1<BR>14:21:29.774: debug : virRegisterStorageDriver:737 : registering VBOX as storage driver 1<BR>14:21:29.774: debug : virRegisterDriver:837 : registering ESX as driver 4<BR>14:21:29.775: debug : virRegisterDriver:837 : registering remote as driver 5<BR>14:21:29.775: debug : virRegisterNetworkDriver:675 : registering remote as network driver 2<BR>14:21:29.775: debug : virRegisterInterfaceDriver:706 : registering remote as interface driver 1<BR>14:21:29.775: debug : virRegisterStorageDriver:737 : registering remote as storage driver 2<BR>14:21:29.775: debug : virRegisterDeviceMonitor:768 : registering remote as device driver 1<BR>14:21:29.775: debug : virRegisterSecretDriver:799 : registering remote as secret driver 1<BR>14:21:29.775: debug : virConnectOpenAuth:1337 : name=esx://a.b.c.d, auth=0xb7f41678, flags=0<BR>14:21:29.776: debug : do_open:1106 : name "esx://a.b.c.d" to URI components:<BR>  scheme esx<BR>  opaque (null)<BR>  authority (null)<BR>  server a.b.c.d<BR>  user (null)<BR>  port 0<BR>  path (null)</P>
<P>14:21:29.776: debug : do_open:1116 : trying driver 0 (Test) ...<BR>14:21:29.776: debug : do_open:1122 : driver 0 Test returned DECLINED<BR>14:21:29.776: debug : do_open:1116 : trying driver 1 (Xen) ...<BR>14:21:29.776: debug : do_open:1122 : driver 1 Xen returned DECLINED<BR>14:21:29.776: debug : do_open:1116 : trying driver 2 (OPENVZ) ...<BR>14:21:29.776: debug : do_open:1122 : driver 2 OPENVZ returned DECLINED<BR>14:21:29.777: debug : do_open:1116 : trying driver 3 (VBOX) ...<BR>14:21:29.777: debug : do_open:1122 : driver 3 VBOX returned DECLINED<BR>14:21:29.777: debug : do_open:1116 : trying driver 4 (ESX) ...<BR>Enter username for a.b.c.d [root]:<BR>Enter root password for a.b.c.d:<BR>14:21:33.416: debug : do_open:1122 : driver 4 ESX returned ERROR<BR>14:21:33.416: debug : virUnrefConnect:259 : unref connection 0x931f698 1<BR>14:21:33.417: debug : virReleaseConnect:216 : release connection 0x931f698<BR>error: internal error curl_easy_perform() returned an error: Peer certificate cannot be authenticated with known CA certificates (60)<BR>error: failed to connect to the hypervisor<BR></P>
<P> </P>
<P>BTW, I observed that any modification to the /etc/libvirt/libvirt.conf does not take effect when. Isn't this the default conf file for libvirt/virsh? The changes i am talking about are:</P>
<P>- for default path for the CA key/cert and clinet key/cert </P>
<P>- uncommented #tls_no_verify_certificate = 1<BR></P>
<P># ls /etc/pki/CA/<BR>cacert.pem  cakey.pem<BR># ls /etc/pki/libvirt/<BR>clientcert.pem  private<BR># ls /etc/pki/libvirt/private/<BR>clientkey.pem<BR></P>
<P>Thank you in advance for any comments/suggestions.</P>
<P> </P>
<P>Antonela</P>
<P><BR>----- Original Message -----<BR>From: "Matthias Bolte" <matthias.bolte@googlemail.com><BR>To: "antonela_other@yahoo.com" <antonela@comcast.net><BR>Cc: libvirt-users@redhat.com<BR>Sent: Wednesday, February 10, 2010 4:59:18 AM GMT -05:00 US/Canada Eastern<BR>Subject: Re: [libvirt-users] error: unable to connect to libvirtd at  'a.b.c.d': Connection refused<BR><BR>2010/2/9 antonela_other@yahoo.com <antonela@comcast.net>:<BR>> Greetings:<BR>><BR><BR>Hello.<BR><BR>><BR>> I have an issue with connecting to the esx hypervisor from my guest Vm. The<BR>> purpose of the connection is to obtain host related information (like<BR>> network, devices etc).<BR>><BR><BR>Unfortunately network and device enumeration is not implemented yet<BR>for the ESX driver.<BR><BR>><BR>> I am not sure what is it that rejects the connect at the server side, and<BR>> what i am missing.<BR>><BR>> I am running lib0.7.5, i have libvirtd running on guest-vm.<BR><BR>ESX support was added in 0.7.0, so your libvirt version is new enough.<BR>For ESX you don't need an libvirtd, neither on the client side nor on<BR>the server side, see http://libvirt.org/drvesx.html#prereq<BR><BR>> The host ESX has the ip address a.b.c.d.<BR>><BR>><BR>><BR>> Any thoughts?<BR>><BR><BR>Are you sure that your libvirt was build with ESX support enabled? If<BR>you're using the Debian/Ubuntu packages that could be your problem,<BR>because they are build without ESX support. So you'll either need to<BR>file a bugreport with Debian/Ubuntu about the excluded ESX support, or<BR>build libvirt from source. If you're already building from source make<BR>sure to install the libcurl development package version 7.18.0 or<BR>newer, otherwise configure will disable ESX support.<BR><BR>><BR>> Below the error with some debug output from libvirt.<BR>><BR>><BR>><BR>> root > virsh -c esx://a.b.c.d/system<BR>><BR>>  ......................<BR>><BR>> 17:06:16.065: debug : virConnectOpenAuth:1337 :<BR>> name=esx://10.59.56.109/system, auth=0xb80ac638, flags=0<BR>><BR>> 17:06:16.065: debug : do_open:1106 : name "esx://10.59.56.109/system" to URI<BR>> components:<BR>><BR>>   scheme esx<BR>><BR>>   opaque (null)<BR>><BR>>   authority (null)<BR>><BR>>   server 10.59.56.109<BR>><BR>>   user (null)<BR>><BR>>   port 0<BR>><BR>>   path /system<BR>><BR>><BR>><BR>> 17:06:16.065: debug : do_open:1116 : trying driver 0 (Test) ...<BR>><BR>> 17:06:16.066: debug : do_open:1122 : driver 0 Test returned DECLINED<BR>><BR>> 17:06:16.066: debug : do_open:1116 : trying driver 1 (Xen) ...<BR>><BR>> 17:06:16.066: debug : do_open:1122 : driver 1 Xen returned DECLINED<BR>><BR>> 17:06:16.066: debug : do_open:1116 : trying driver 2 (OPENVZ) ...<BR>><BR>> 17:06:16.066: debug : do_open:1122 : driver 2 OPENVZ returned DECLINED<BR>><BR>> 17:06:16.066: debug : do_open:1116 : trying driver 3 (VBOX) ...<BR>><BR>> 17:06:16.066: debug : do_open:1122 : driver 3 VBOX returned DECLINED<BR><BR>Yep, your libvirt is build without ESX support. If it is enabled it<BR>would be probed before the remote driver.<BR><BR>> 17:06:16.066: debug : do_open:1116 : trying driver 4 (remote) ...<BR>><BR>> 17:06:16.067: debug : doRemoteOpen:564 : proceeding with name =<BR>> esx:///system<BR>><BR>> 17:06:16.069: debug : initialise_gnutls:1145 : loading CA file<BR>> /etc/pki/CA/cacert.pem<BR>><BR>> 17:06:16.070: debug : initialise_gnutls:1158 : loading client cert and key<BR>> from files /etc/pki/libvirt/clientcert.pem and<BR>> /etc/pki/libvirt/private/clientkey.pem<BR>><BR>> 17:06:16.074: debug : do_open:1122 : driver 4 remote returned ERROR<BR>><BR>> 17:06:16.074: debug : virUnrefConnect:259 : unref connection 0x903e078 1<BR>><BR>> 17:06:16.074: debug : virReleaseConnect:216 : release connection 0x903e078<BR>><BR>> error: unable to connect to libvirtd at a.b.c.d': Connection refused<BR><BR>The error message could be more explicit about the missing ESX<BR>support, I'll try to improve this.<BR><BR>> error: failed to connect to the hypervisor<BR>><BR>><BR>><BR>><BR>><BR>> I tried to use uri like: esx://a.b.c.d/, esx://a.b.c.d,<BR>> esxi://a.b.c.d/system etc. They all give same issue.<BR>><BR><BR>See http://libvirt.org/drvesx.html#uri for the URI format understood<BR>by the ESX driver, there is no distinction between /system and<BR>/session as with some other drivers.<BR><BR>Matthias<BR></P></div></body></html>