<div dir="ltr">Can you please open a bug?<div><a href="https://bugzilla.redhat.com/enter_bug.cgi?product=ovirt-guest-agent">https://bugzilla.redhat.com/enter_bug.cgi?product=ovirt-guest-agent</a><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><pre cols="72"><span style="font-family:arial,helvetica,sans-serif">Yaniv Dary
Technical Product Manager
Red Hat Israel Ltd.
34 Jerusalem Road
Building A, 4th floor
Ra'anana, Israel 4350109
Tel : +972 (9) 7692306
8272306
Email: <a href="mailto:ydary@redhat.com" target="_blank">ydary@redhat.com</a>
IRC : ydary</span></pre>
</div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Mar 18, 2016 at 6:20 PM, Martin Sivak <span dir="ltr"><<a href="mailto:msivak@redhat.com" target="_blank">msivak@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> Whats extremely prone to errors is the way the guest agent checks the active user in GuestAgentLinux2.py line 325:<br>
><br>
> users = os.popen('/usr/bin/users').read().split()<br>
<br>
</span>That is something we could probably improve. The maintainer is Vinzenz Feenstra.<br>
<br>
Martin<br>
<br>
<br>
On Fri, Mar 18, 2016 at 3:13 PM, Andreas Trawöger<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:andreas.trawoeger@qitasc.com">andreas.trawoeger@qitasc.com</a>> wrote:<br>
> Hi Martin,<br>
><br>
> Whats extremely prone to errors is the way the guest agent checks the active user in GuestAgentLinux2.py line 325:<br>
><br>
> users = os.popen('/usr/bin/users').read().split()<br>
><br>
> This creates a new subprocess every time it is executed and if that doesn't work for whatever reason the ovirt guest agent crashes instantly.<br>
><br>
> But I probably should make that suggestions on the devel list.<br>
><br>
> Regards<br>
><br>
> ________________________________________<br>
> Von: Martin Sivak <<a href="mailto:msivak@redhat.com">msivak@redhat.com</a>><br>
> Gesendet: Freitag, 18. März 2016 14:44<br>
> An: Andreas Trawöger<br>
> Cc: oVirt Userlist<br>
> Betreff: Re: [ovirt-users] MOM crashes ovirt-guest-agent<br>
><br>
> Hi,<br>
><br>
> it is not really a bug. You should give the VM more memory if you<br>
> expect that it will need it that fast. The ballooning mechanism has<br>
> its disadvantages and this is one of those. We do not react fast<br>
> enough when such a fast allocation happens.<br>
><br>
> There is really not much we can do from the mom / guest agent side. We<br>
> could slowly increase the available memory when the guest agent dies<br>
> (pretty easy to implement) and we might inform the system that a guest<br>
> agent is an important process (if that is even possible) so OOM killer<br>
> will avoid it. But that would not help with Cannot allocate memory<br>
> error as even the OOM killer takes time before it reacts.<br>
><br>
> Using low guaranteed memory values with ballooning for critical VMs is<br>
> probably not the best idea.<br>
><br>
> Regards<br>
><br>
> --<br>
> Martin Sivak<br>
> <a href="mailto:msivak@redhat.com">msivak@redhat.com</a><br>
> SLA / oVirt<br>
><br>
> On Fri, Mar 18, 2016 at 1:00 PM, Andreas Trawöger<br>
> <<a href="mailto:andreas.trawoeger@qitasc.com">andreas.trawoeger@qitasc.com</a>> wrote:<br>
>> Hi,<br>
>><br>
>><br>
>> I'm trying to track down why my Foreman Centos7 VM continuously crashes with<br>
>> out of Memory errors on my ovirt-3.6 hosts and what seems to happen is the<br>
>> following:<br>
>><br>
>><br>
>> 1. The Foreman VM only uses 1GB at the beginning and MOM over time reduces<br>
>> the memory size from 8GB Ram to the defined minimum of 2GB<br>
>><br>
>><br>
>> mom.log:<br>
>> 2016-03-18 12:25:42,669 - mom.Controllers.Balloon - INFO - Ballooning<br>
>> guest:qvie-foreman from 2210584 to 2100054<br>
>><br>
>><br>
>> 2. When the VM needs RAM very quickly like if you do an 'cp /dev/zero<br>
>> /run/zero' the ovirt guest agent crashes with an out of memory error.<br>
>><br>
>><br>
>> ovirt-guest-agent.log:<br>
>><br>
>> Traceback (most recent call last):<br>
>> File "/usr/share/ovirt-guest-agent/OVirtAgentLogic.py", line 239, in<br>
>> doWork<br>
>> self.sendUserInfo()<br>
>> File "/usr/share/ovirt-guest-agent/OVirtAgentLogic.py", line 355, in<br>
>> sendUserInfo<br>
>> cur_user = self.dr.getActiveUser()<br>
>> File "/usr/share/ovirt-guest-agent/GuestAgentLinux2.py", line 325, in<br>
>> getActiveUser<br>
>> users = os.popen('/usr/bin/users').read().split()<br>
>> OSError: [Errno 12] Cannot allocate memory<br>
>><br>
>> 3. Resulting in an MOM warning that it can't get any memory stats from the<br>
>> VM. Leaving the memory size at its minimum size:.<br>
>><br>
>><br>
>> mom.log:<br>
>><br>
>> mom.Collectors.GuestMemory - WARNING - getVmMemoryStats() error: The<br>
>> ovirt-guest-agent is not active<br>
>><br>
>><br>
>> Any chances to prevent that from happening? Or is this a bug in MOM /<br>
>> ovirt-guest-agent that should be fixed?<br>
>><br>
>><br>
>> Greetings<br>
>><br>
>> Andreas<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
>> <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
>><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>