<div dir="ltr"><div>libvirt cannot inspect memory usage because some condition is not satisfied.<br><br></div>But the AttributeError exception is ugly, Ceilometer should add basic check for return value, otherwise the unnecessary exception will bother cloud operator.  I have reported a bug in Ceilometer for this issue, see <a href="https://bugs.launchpad.net/ceilometer/+bug/1393415">https://bugs.launchpad.net/ceilometer/+bug/1393415</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 17, 2014 at 5:51 PM, Rao Dingyuan <span dir="ltr"><<a href="mailto:raodingyuan@chinacloud.com.cn" target="_blank">raodingyuan@chinacloud.com.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="#0563C1" vlink="#954F72" lang="ZH-CN"><div><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">As described in the document: <a href="http://docs.openstack.org/developer/ceilometer/measurements.html#measurements" target="_blank">http://docs.openstack.org/developer/ceilometer/measurements.html#measurements</a><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">“””<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:7.5pt;margin-bottom:3.75pt;margin-left:0cm;line-height:18.0pt"><b><span style="font-size:13.5pt;font-family:"Arial","sans-serif";color:#3e4349" lang="EN-US">Note<u></u><u></u></span></b></p><p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Arial","sans-serif";color:#3e4349;background:#eeeeee" lang="EN-US"> </span><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal" style="line-height:18.0pt"><span style="font-size:13.5pt;font-family:"Arial","sans-serif";color:#3e4349" lang="EN-US">To enable the libvirt memory.usage supporting, you need libvirt version 1.1.1+, qemu version 1.5+, and you need to prepare suitable balloon driver in the image, particularly for Windows guests, most modern Linuxes have it built in. The memory.usage meters can’t be fetched without image balloon driver.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">“””<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:Wingdings;color:#1f497d" lang="EN-US">J</span><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><div class="MsoNormal" style="line-height:150%;background:white"><span style="font-size:10.5pt;line-height:150%;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><hr style="width:157.8pt" align="left" noshade size="1" width="263"></span></div><p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph;layout-grid-mode:char"><span style="font-size:10.0pt;font-family:"\005fae\008f6f\0096c5\009ed1","sans-serif";color:#1f497d" lang="EN-US">E_mail: <a href="mailto:raodingyuan@chinacloud.com.cn" target="_blank"><span style="color:blue">raodingyuan@chinacloud.com.cn</span></a><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"\005fae\008f6f\0096c5\009ed1","sans-serif"">发件人<span lang="EN-US">:</span></span></b><span style="font-size:11.0pt;font-family:"\005fae\008f6f\0096c5\009ed1","sans-serif"" lang="EN-US"> Du Jun [mailto:<a href="mailto:dj199008@gmail.com" target="_blank">dj199008@gmail.com</a>] <br></span><b><span style="font-size:11.0pt;font-family:"\005fae\008f6f\0096c5\009ed1","sans-serif"">发送时间<span lang="EN-US">:</span></span></b><span style="font-size:11.0pt;font-family:"\005fae\008f6f\0096c5\009ed1","sans-serif"" lang="EN-US"> 2014</span><span style="font-size:11.0pt;font-family:"\005fae\008f6f\0096c5\009ed1","sans-serif"">年<span lang="EN-US">11</span>月<span lang="EN-US">17</span>日<span lang="EN-US"> 16:57<br></span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> OpenStack Development Mailing List (not for usage questions)<br></span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> [openstack-dev] Ceilometer memory.usage can not get info from libvirt<u></u><u></u></span></span></p><div><div class="h5"><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Hi all,<br><br>2014-11-17 16:04:01.563 5162 INFO ceilometer.agent [-] Polling pollster memory.usage in the context of meter_source                              <br>140000 2014-11-17 16:04:01.564 5162 DEBUG ceilometer.compute.pollsters.memory [-] Checking memory usage for instance 7e53172c-f05f-4fda-9855-af6775c1f4a8 get_samples /opt/stack/ceilometer/ceilometer/compute/pollsters/memory.py:31<br>140002 2014-11-17 16:04:01.573 5162 WARNING ceilometer.compute.virt.libvirt.inspector [-] Failed to inspect memory usage of instance-00000002, can not get info from libvirt<br><span style="color:red">140003 2014-11-17 16:04:01.574 5162 ERROR ceilometer.compute.pollsters.memory [-] Could not get Memory Usage for 7e53172c-f05f-4fda-9855-af6775c1f4a8: 'NoneType' object has no attribute 'usage'</span><br>140004 2014-11-17 16:04:01.574 5162 TRACE ceilometer.compute.pollsters.memory Traceback (most recent call last):<br>140005 2014-11-17 16:04:01.574 5162 TRACE ceilometer.compute.pollsters.memory   File "/opt/stack/ceilometer/ceilometer/compute/pollsters/memory.py", line 37, in get_samples<br>140006 2014-11-17 16:04:01.574 5162 TRACE ceilometer.compute.pollsters.memory     'usage': memory_info.usage}))<br>140007 2014-11-17 16:04:01.574 5162 TRACE ceilometer.compute.pollsters.memory AttributeError: 'NoneType' object has no attribute 'usage'<u></u><u></u></span></p></div><p class="MsoNormal"><span lang="EN-US">When <u></u><u></u></span></p></div></div></div></div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>blog: <a href="http://zqfan.github.com" target="_blank">zqfan.github.com</a><br></div>git: <a href="http://github.com/zqfan" target="_blank">github.com/zqfan</a><br></div></div>
</div>