<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Well the code to generate diagnostics under xen is in nova/virt/xenapi/vm_utils.py:<div><br></div><div><div>887 def compile_diagnostics(cls, session, record):</div><div> 888 """Compile VM diagnostics data"""</div><div> 889 try:</div><div> 890 host = session.get_xenapi_host()</div><div> 891 host_ip = session.call_xenapi("host.get_record", host)["address"]</div><div> 892 except (cls.XenAPI.Failure, KeyError) as e:</div><div> 893 return {"Unable to retrieve diagnostics": e}</div><div> 894 </div><div> 895 try:</div><div> 896 diags = {}</div><div> 897 xml = get_rrd(host_ip, record["uuid"])</div><div> 898 if xml:</div><div> 899 rrd = minidom.parseString(xml)</div><div> 900 for i, node in enumerate(rrd.firstChild.childNodes):</div><div> 901 # We don't want all of the extra garbage</div><div> 902 if i >= 3 and i <= 11:</div><div> 903 ref = node.childNodes</div><div> 904 # Name and Value</div><div> 905 if len(ref) > 6:</div><div> 906 diags[ref[0].firstChild.data] = \</div><div> 907 ref[6].firstChild.data</div><div> 908 return diags</div><div> 909 except cls.XenAPI.Failure as e:</div><div> 910 return {"Unable to retrieve diagnostics": e}</div><div> 911 </div><div><br></div><div>Example RRD is here: <a href="http://community.citrix.com/display/xs/Using+XenServer+RRDs">http://community.citrix.com/display/xs/Using+XenServer+RRDs</a></div><div><br></div><div>Perhaps someone could paste the actual data from an install running xen so we can see what the extracted data looks like?</div><div><br></div><div>Then it is as easy as adding a call like the following to nova/virt/libvirt/connection.py:</div><div><br></div><div>def get_diagnostics(self, instance_name):</div><div> # look up the domain by instance name</div><div> virt_dom = self._lookup_by_name(instance_name)</div><div> # get info from the domain using libvirt calls</div><div> # map the data into the proper dictionary format</div><div> # return the data</div><div> return diag</div><div><br></div><div>Vish</div><div><br></div><div><div>On Jan 26, 2012, at 2:56 AM, Leander Bessa wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Could you give me some references on how i could implement the diagnostics call for kvm/libvirt?<div><br>Regards,</div><div><br></div><div>Leander<br><br><div class="gmail_quote">On Wed, Jan 25, 2012 at 7:39 PM, Vishvananda Ishaya <span dir="ltr"><<a href="mailto:vishvananda@gmail.com">vishvananda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">There are currently no plans for such of thing. It seems easier to rely on existing plugins for monitoring. That said, it shouldn't be too hard to implement the diagnostics call for kvm/libvirt if someone wants to tackle it.<div>
<br></div><div>Vish</div><div><div class="h5"><div><br><div><div>On Jan 25, 2012, at 8:21 AM, Leander Bessa wrote:</div><br><blockquote type="cite">Are there any plans to add support for monitoring instances which run libvirt? Does XEN also use libvirt?<div>
<br><div class="gmail_quote">On Wed, Jan 25, 2012 at 2:01 PM, Leander Bessa <span dir="ltr"><<a href="mailto:leanderbb@gmail.com" target="_blank">leanderbb@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok i'll look into that, thank you for the answers.<div><br>Regards,</div><div><br></div><div>Leander<div><div>
<br><div><div><div><br><div class="gmail_quote">On Tue, Jan 24, 2012 at 11:16 PM, Vishvananda Ishaya <span dir="ltr"><<a href="mailto:vishvananda@gmail.com" target="_blank">vishvananda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Monitoring can be done through libvirt monitoring plugins. For example:<div><br></div>
<div><a href="http://honk.sigxcpu.org/projects/libvirt/" target="_blank">http://honk.sigxcpu.org/projects/libvirt/</a></div><div><br></div><div>Vish</div><div><br><div><div><div>On Jan 24, 2012, at 2:01 PM, Leander Bessa wrote:</div>
<br></div><div><div><blockquote type="cite">How exactly do i install that particular extension and what can i use as an alternative to monitor instances with KVM?<div><br></div><div><br><div><div><div class="gmail_quote">
On Tue, Jan 24, 2012 at 6:11 PM, Kiall Mac Innes <span dir="ltr"><<a href="mailto:kiall@managedit.ie" target="_blank">kiall@managedit.ie</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've just verified this against my install, but since the diagnostics is unsupported when using libvirt/kvm, it still errors out (but with a 500, rather than 404)<div>
<br>Thanks,<br>Kiall<div><div><br>
<br><br><div class="gmail_quote">On Tue, Jan 24, 2012 at 5:56 PM, Brian Waldon <span dir="ltr"><<a href="mailto:brian.waldon@rackspace.com" target="_blank">brian.waldon@rackspace.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Actually the diagnostics command was not added in Essex, but it was converted to a true extension. However it is part of the Admin API, which means for Diablo you need to set the allow_admin_api flag on your nova-api node.<div>
<div><div><br></div><div><br><div><div><div>On Jan 24, 2012, at 9:41 AM, Kiall Mac Innes wrote:</div><br><blockquote type="cite"><p>Hi,</p><p>The diagnostics command was added in Essex, my packages are using the stable Diablo version.</p><p>Novaclient sadly shows these options even though they can't be used with Diablo.</p><p>Kiall</p><p>Sent from my mobile - Sorry for being short.</p>
<div class="gmail_quote">On Jan 24, 2012 5:04 p.m., "Leander Bessa" <<a href="mailto:leanderbb@gmail.com" target="_blank">leanderbb@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<div><br></div><div>I've setup a single node configuration with keystone using the packages from <a href="https://launchpad.net/~managedit/+archive/openstack" target="_blank">https://launchpad.net/~managedit/+archive/openstack</a>.</div>
<div><br></div><div>I've managed to launch an instance, however when i run the commando nova diagnostics <server> i get this:</div><div><br></div><div><div>REQ: curl -i <a href="http://127.0.0.1:5000/tokens" target="_blank">http://127.0.0.1:5000/tokens</a> -X POST -H "Content-Type: application/json" -H "User-Agent: python-novaclient"</div>
<div><br></div><div>REQ BODY: {"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "admin"}}}</div><div>
<br></div><div>RESP:{'date': 'Tue, 24 Jan 2012 16:56:24 GMT', 'status': '200', 'content-length': '1119', 'content-type': 'application/json; charset=UTF-8'} {"access": {"token": {"expires": "2015-02-05T00:00:00", "id": "999888777666", "tenant": {"id": "1", "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "<a href="http://127.0.0.1:8774/v1.1/1" target="_blank">http://127.0.0.1:8774/v1.1/1</a>", "region": "RegionOne", "internalURL": "<a href="http://127.0.0.1:8774/v1.1/1" target="_blank">http://127.0.0.1:8774/v1.1/1</a>", "publicURL": "<a href="http://127.0.0.1:8774/v1.1/1" target="_blank">http://127.0.0.1:8774/v1.1/1</a>"}], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "<a href="http://127.0.0.1:8774/v1.0" target="_blank">http://127.0.0.1:8774/v1.0</a>", "region": "RegionOne", "internalURL": "<a href="http://127.0.0.1:8774/v1.0" target="_blank">http://127.0.0.1:8774/v1.0</a>", "publicURL": "<a href="http://127.0.0.1:8774/v1.0/" target="_blank">http://127.0.0.1:8774/v1.0/</a>"}], "type": "compute", "name": "nova_compat"}, {"endpoints": [{"adminURL": "<a href="http://127.0.0.1:9292/v1.1/1" target="_blank">http://127.0.0.1:9292/v1.1/1</a>", "region": "RegionOne", "internalURL": "<a href="http://127.0.0.1:9292/v1.1/1" target="_blank">http://127.0.0.1:9292/v1.1/1</a>", "publicURL": "<a href="http://127.0.0.1:9292/v1.1/1" target="_blank">http://127.0.0.1:9292/v1.1/1</a>"}], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "<a href="http://127.0.0.1:35357/v2.0" target="_blank">http://127.0.0.1:35357/v2.0</a>", "region": "RegionOne", "internalURL": "<a href="http://127.0.0.1:5000/v2.0" target="_blank">http://127.0.0.1:5000/v2.0</a>", "publicURL": "<a href="http://127.0.0.1:5000/v2.0" target="_blank">http://127.0.0.1:5000/v2.0</a>"}], "type": "identity", "name": "identity"}], "user": {"id": "1", "roles": [{"tenantId": "1", "id": "1", "name": "Admin"}, {"id": "1", "name": "Admin"}], "name": "admin"}}}</div>
<div><br></div><div>REQ: curl -i <a href="http://127.0.0.1:8774/v1.1/1/servers/3/diagnostics" target="_blank">http://127.0.0.1:8774/v1.1/1/servers/3/diagnostics</a> -X GET -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "X-Auth-Token: 999888777666"</div>
<div><br></div><div>REQ: curl -i <a href="http://127.0.0.1:8774/v1.1/1/servers/3/diagnostics" target="_blank">http://127.0.0.1:8774/v1.1/1/servers/3/diagnostics</a> -X GET -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "X-Auth-Token: 999888777666"</div>
<div><br></div><div>RESP:{'date': 'Tue, 24 Jan 2012 16:56:24 GMT', 'status': '404', 'content-length': '52', 'content-type': 'text/plain; charset=UTF-8'} 404 Not Found</div>
<div><br></div><div>The resource could not be found.</div><div><br></div><div> </div><div><br></div><div>RESP:{'date': 'Tue, 24 Jan 2012 16:56:24 GMT', 'status': '404', 'content-length': '52', 'content-type': 'text/plain; charset=UTF-8'} 404 Not Found</div>
<div><br></div><div>The resource could not be found.</div><div><br></div><div> </div><div>n/a (HTTP 404)</div></div><div><br></div><div><br>Any ideas?</div><div><br></div><div>Regards,</div><div><br>Leander</div>
<br>_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br></blockquote></div>
_______________________________________________<br>Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</blockquote></div><br></div></div></div></div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
_______________________________________________<br>Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</blockquote></div></div></div><br></div></div></blockquote></div><br></div></div></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></body></html>