<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:large"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">пн, 7 февр. 2022 г. в 13:29, Michal Prívozník <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/7/22 09:22, Nikolay Shirokovskiy wrote:<br>
> Hi, all.<br>
> <br>
> Libvirt QEMU driver writes QEMU process log to<br>
> /var/log/libvirt/qemu/<VM_NAME>.log file. This file is owned by libvirt<br>
> that is no API client knows about it and no client will remove it. Thus<br>
> this file stays forever. I guess it does not cause harddisk space waste<br>
> in some deploys as the number of VMs thru node lifecycle is not very large. <br>
> <br>
> In Virtuozzo we have a service which checks VMs disks every 5 min using<br>
> guestfs. This generates about 100k files and about 400MiB disk usage per<br>
> VM per year. This is a lot. I guess we could refine the service to avoid<br>
> this issue yet I think the issue is general and need to be addressed.<br>
> <br>
> If this is agreed then in terms of architecture should we have a<br>
> distinct timer/service to cleanup log files or we'd better clean up in<br>
> scope of qemu driver itself?<br>
<br>
I believe that this was one the issues that virtlogd tried to solve. By<br>
doing log rotation and keeping the last three files (by default). This<br>
can be fine tuned in virtlogd.conf.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:large">Hi, Michal.</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">Yes virtlogd/logrotate can limit the size of logs for a single VM. But if we keep logs forever for every VM that existed at some point in time then the total size of logs can increase without any limit.</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">I should mention that when we check VMs disks using guestfs it creates a new transient VM every time. That is why we have so many logs left. But most of these logs are not of interest - a VM was deleted a long time ago.</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">So the suggestion is to keep logs for deleted VMs only for some period of time, say a month.</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">Nikolay</div></div></div>