<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span><br></span></div><div>Thanks Matthias. I have found out the issue. Yes, issue was Java was referring to different libvirt binary.<br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Matthias Bolte <matthias.bolte@googlemail.com><br> <b><span style="font-weight: bold;">To:</span></b> D e e p a k <deepakmits@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "libvirt-users@redhat.com" <libvirt-users@redhat.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, 6 May 2013 6:07 PM<br> <b><span style="font-weight:
 bold;">Subject:</span></b> Re: [libvirt-users] hyperv connection failing with libvirt 1.0.4 virsh.<br> </font> </div> <div class="y_msg_container"><br>Hi,<br><br>It looks to me as virsh and your Java program are using different<br>versions of the libvirt binary. The one used by virsh has Hyper-V<br>support compiled in and the one used by your Java program doesn't.<br><br>Make sure that your Java program uses the same libvirt binary as virsh does.<br><br><br>2013/5/6 D e e p a k <<a ymailto="mailto:deepakmits@yahoo.com" href="mailto:deepakmits@yahoo.com">deepakmits@yahoo.com</a>>:<br>> Hi Matthias,<br>> Now without making any changes,through virsh hyperv connection is going<br>> through.<br>> On same setup, but when I am trying to connect using java binding to hyperv<br>> , it is throwing ---<br>><br>> libvir: error : invalid argument: libvirt was built without the 'hyperv'<br>> driver<br>> exception
 caught:org.libvirt.LibvirtException: invalid argument: libvirt was<br>> built without the 'hyperv' driver<br>> level:VIR_ERR_ERROR<br>> code:VIR_ERR_INVALID_ARG<br>> domain:VIR_FROM_NONE<br>> hasConn:false<br>> hasDom:false<br>> hasNet:false<br>> message:invalid argument: libvirt was built without the 'hyperv' driver<br>> str1:invalid argument: %s<br>> str2:libvirt was built without the 'hyperv' driver<br>> str3:null<br>> int1:-1<br>> int2:-1<br>><br>> I think libvirt is built correctly as virsh is able to connect to hyperv<br>> correct me if I am wrong.<br>> but using java binding it says "libvirt was built without the 'hyperv'<br>> driver".<br>> Can you pls. tell what I am missing when I am doing it through java binding<br>> or is there any setting/configuration which I am missing.<br>> Java code - I am using -<br>><br>> String hypervURI = "hyperv://<a
 ymailto="mailto:administrator@SBRWINPR" href="mailto:administrator@SBRWINPR">administrator@SBRWINPR</a>/?transport=http";<br>>                 ConnectAuth ca1 = new ConnectAuthDefault();<br>>                 hypervconn = new Connect(hypervURI,ca1,0);<br>>                 System.out.println("HYPERV:"+hypervconn.getCapabilities());<br>><br>><br>> Regards,<br>> Deepak<br>><br>><br>> ________________________________<br>> From: D e e p a k <<a ymailto="mailto:deepakmits@yahoo.com" href="mailto:deepakmits@yahoo.com">deepakmits@yahoo.com</a>><br>> To: Matthias Bolte <<a ymailto="mailto:matthias.bolte@googlemail.com" href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>>;<br>> "<a ymailto="mailto:libvirt-users@redhat.com"
 href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a>" <<a ymailto="mailto:libvirt-users@redhat.com" href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a>><br>> Sent: Friday, 3 May 2013 9:52 AM<br>><br>> Subject: Re: [libvirt-users] hyperv connection failing with libvirt 1.0.4<br>> virsh.<br>><br>> Hi Matthias,<br>> Thanks for your reply.<br>> After checking all the required configuration. I found that firewall was not<br>> enabled and rules for WMI was not enabled. I made these changes.<br>> But now I am getting this -<br>><br>> virsh # connect hyperv://172.168.1.111/transport=http<br>> Enter username for 172.168.1.111 [administrator]: administrator<br>> Enter administrator's password for 172.168.1.111:<br>> 2013-05-03 09:42:48.387+0000: 7235: info : libvirt version: 1.0.4<br>> 2013-05-03 09:42:48.387+0000: 7235: error : hypervDebugHandler:1444 :<br>> openwsman error:
 NULL response<br>> error: Failed to connect to the hypervisor<br>> error: internal error Transport error during enumeration: Could not connect<br>> (7)<br>><br>> Any idea what is going wrong here .<br>><br>> Regards,<br>> Deepak<br>><br>> ________________________________<br>> From: Matthias Bolte <<a ymailto="mailto:matthias.bolte@googlemail.com" href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>><br>> To: D e e p a k <<a ymailto="mailto:deepakmits@yahoo.com" href="mailto:deepakmits@yahoo.com">deepakmits@yahoo.com</a>><br>> Cc: "<a ymailto="mailto:libvirt-users@redhat.com" href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a>" <<a ymailto="mailto:libvirt-users@redhat.com" href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a>><br>> Sent: Wednesday, 1 May 2013 4:41 PM<br>> Subject: Re: [libvirt-users] hyperv connection failing with libvirt
 1.0.4<br>> virsh.<br>><br>> 2013/4/29 D e e p a k <<a ymailto="mailto:deepakmits@yahoo.com" href="mailto:deepakmits@yahoo.com">deepakmits@yahoo.com</a>><br>>><br>>> Trying to use virsh for hyperv and getting this.<br>>><br>>> virsh # connect hyperv://172.168.1.111:5985/?transport=http<br>>> Enter username for 172.168.1.111 [administrator]: administrator<br>>> Enter administrator's password for 172.168.1.111:<br>>> 2013-04-29 10:36:48.690+0000: 13991: error : hypervDebugHandler:1444 :<br>>> openwsman error: NULL response<br>>> error: Failed to connect to the hypervisor<br>>> error: internal error Transport error during enumeration: User, password<br>>> or similar was not accepted (26)<br>>><br>>> Using libvirt 1.0.4 from source code.<br>>> What is going wrong in this hyperv connection ?<br>><br>> A bit of a guess, but did you configure your Hyper-V
 server as described?<br>><br>> <a href="http://libvirt.org/drvhyperv.html#auth" target="_blank">http://libvirt.org/drvhyperv.html#auth</a><br><br>--<br>Matthias Bolte<br><a href="http://photron.blogspot.com/" target="_blank">http://photron.blogspot.com</a><br><br><br></div> </div> </div>  </div></body></html>