<div><div dir="auto">Hi Martin,</div></div><div dir="auto"><br></div><div dir="auto">Could you please help me with below issue, I am not sure what’s wrong here.</div><div dir="auto">Please find below code and error snippet.</div><div dir="auto"><br></div><div dir="auto">Thanks for help.</div><div dir="auto"><br></div><div dir="auto"><div style="font-family:Calibri,Helvetica,sans-serif" dir="auto"><div style="direction:ltr">Code Snippet: - </div><div style="direction:ltr"><br></div><div>from __future__ import print_function</div><div>import sys</div><div>import libvirt</div><div>SASL_USER = <username></div><div>SASL_PASS = <password></div><div>def request_cred(credentials, user_data):</div><div>    for credential in credentials:</div><div>        if credential[0] == libvirt.VIR_CRED_AUTHNAME:</div><div>            credential[4] = SASL_USER</div><div>        elif credential[0] == libvirt.VIR_CRED_PASSPHRASE:</div><div>            credential[4] = SASL_PASS</div><div>    return 0</div><div>auth = [[libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_PASSPHRASE], request_cred, None]</div><div>conn = libvirt.openAuth("esx://<vm name>?no_verify=1", auth, 0)</div><div>if conn == None:</div><div>    print('Failed to open connection to qemu+tcp://localhost/system', file=sys.stderr)</div><div>    exit(1)</div><div>conn.close()</div><div><br></div><br></div><div style="font-family:Calibri,Helvetica,sans-serif;direction:ltr" dir="auto">Error Snippet: -</div><div style="font-family:Calibri,Helvetica,sans-serif" dir="auto">File "/usr/software/pkgs/Python-3.4.3/lib/python3.4/site-packages/libvirt.py", line 105, in openAuth</div><div style="font-family:Calibri,Helvetica,sans-serif" dir="auto">if ret is None:raise libvirtError('virConnectOpenAuth() failed')</div><div style="font-family:Calibri,Helvetica,sans-serif" dir="auto">libvirt.libvirtError: internal error: HTTP response code 404 for call to 'RetrieveServiceContent'</div><br class="Apple-interchange-newline" style="font-family:-webkit-standard"></div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto">Rohit Singh</div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, 29 Nov 2018 at 11:13 PM, ROHIT SINGH <<a href="mailto:rohit.singh0908@gmail.com">rohit.singh0908@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="auto">Thanks a lot Martin for help.</div></div><div dir="auto">Really appreciate it. You’re life saver.</div><div dir="auto"><br></div><div dir="auto">I will go through these links and will get back to you in case I need anymore information.</div><div dir="auto"><br></div><div dir="auto">Once again, thanks for help.</div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto">Rohit Singh</div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, 29 Nov 2018 at 2:34 PM, Martin Kletzander <<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Nov 28, 2018 at 10:24:55PM +0530, ROHIT SINGH wrote:<br>
>Hi Martin,<br>
><br>
>Could you please point me to any example codes in python present for esx?<br>
>Suppose, I have to power off and power on esx virtual machine, can i get<br>
>this code somewhere on python to develop some understanding.<br>
><br>
<br>
<a href="https://www.mail-archive.com/libvir-list@redhat.com/msg17903.html" rel="noreferrer" target="_blank">https://www.mail-archive.com/libvir-list@redhat.com/msg17903.html</a><br>
<br>
>Actually, I am not able to find sample code related to esx in python,<br>
>please point me if any such link available.<br>
><br>
<br>
<a href="https://github.com/libvirt/libvirt-python/blob/master/examples/esxlist.py" rel="noreferrer" target="_blank">https://github.com/libvirt/libvirt-python/blob/master/examples/esxlist.py</a><br>
<br>
and all other examples:<br>
<br>
<a href="https://github.com/libvirt/libvirt-python/tree/master/examples" rel="noreferrer" target="_blank">https://github.com/libvirt/libvirt-python/tree/master/examples</a><br>
<br>
The point of libvirt is that the code doesn't have to be (way) different<br>
depending on the hypervisor.<br>
<br>
>Appreciate your help !!<br>
><br>
>Thanks.<br>
><br>
>Regards<br>
>Rohit Singh<br>
><br>
>On Wed, 28 Nov 2018 at 9:54 PM, ROHIT SINGH <<a href="mailto:rohit.singh0908@gmail.com" target="_blank">rohit.singh0908@gmail.com</a>><br>
>wrote:<br>
><br>
>> Thanks, I'll check it out.<br>
>><br>
>> On Wed, 28 Nov 2018 at 9:31 PM, Martin Kletzander <<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>><br>
>> wrote:<br>
>><br>
>>> On Mon, Nov 26, 2018 at 04:11:20PM +0530, ROHIT SINGH wrote:<br>
>>> >Hi,<br>
>>> ><br>
>>> >I am doing poc for using libvirt api for implementation of esx in python.<br>
>>> ><br>
>>> >I tried researching through module but did not find a way how it works<br>
>>> for<br>
>>> >esx.<br>
>>> >Any help on how to proceed specifically for esx would be of great help.<br>
>>> ><br>
>>><br>
>>> See <a href="https://libvirt.org/drvesx.html" rel="noreferrer" target="_blank">https://libvirt.org/drvesx.html</a> for ESX-related stuff.  But mainly<br>
>>> it is the<br>
>>> URI you need to use.  Then look at <a href="https://libvirt.org/hvsupport.html" rel="noreferrer" target="_blank">https://libvirt.org/hvsupport.html</a><br>
>>> where you<br>
>>> can see what APIs are available for that HV driver.<br>
>>><br>
>>> >Please let me know as soon as possible, lagging on deliverables.<br>
>>> ><br>
>>> >Thanks for help!!<br>
>>> ><br>
>>> >Regards<br>
>>> >Rohit Singh<br>
>>><br>
>>> >_______________________________________________<br>
>>> >libvirt-users mailing list<br>
>>> ><a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
>>> ><a href="https://www.redhat.com/mailman/listinfo/libvirt-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
>>><br>
>>><br>
</blockquote></div></div>
</blockquote></div></div>