GitHub user RyanP-Testing added a comment to the discussion: CloudStack 4.19.3
KVM Agent Slow Operations on Ubuntu 24.04
Hello @shakibshalim74,
Thank you for the detailed report — this is a really helpful description of the
issue. I've analyzed your logs and the environment details, and I believe I can
pinpoint what's happening here.
### Root Cause Analysis
**The primary issue is a known performance bug in libvirt on Ubuntu 24.04.**
The version of libvirt that ships with Ubuntu 24.04 LTS (versions **10.0.0,
10.2.0, and 10.4.0**) has a confirmed performance regression that causes the
CloudStack Agent to hang or become extremely slow when accessing storage pools,
particularly with Ceph-backed pools . This perfectly matches your symptoms: the
agent repeatedly tries to fetch storage pools with delays of several seconds to
tens of seconds.
**The "Couldn't retrieve free memory" warning** is a secondary issue likely
caused by the agent struggling to parse memory statistics on Ubuntu 24.04, and
should resolve once the primary libvirt issue is fixed .
### The Fix
The good news is this problem is already well-documented in the CloudStack
community. Users have confirmed that **libvirt version 10.6.0** resolves the
performance issues . After upgrading, the agent behaves correctly and the
slowdowns disappear.
**Here's my recommended approach:**
1. **Identify the specific libvirt version** on your affected KVM hosts:
```bash
dpkg -l | grep libvirt
```
2. **Upgrade libvirt** to version 10.6.0 or newer. Since Ubuntu 24.04's
default repositories may not yet include this version, you may need to:
- Check if a backport is available from the official Ubuntu repositories
- Build from source, or
- Consider using a different distribution like Debian 12 (Bookworm) for new
hosts, which uses libvirt 9.0.0 and does not exhibit this issue
3. **Restart the CloudStack Agent** after the upgrade:
```bash
sudo systemctl restart cloudstack-agent
```
### Temporary Workaround
If you cannot upgrade libvirt immediately, you can configure a **daily cron job
to restart the CloudStack Agent** (e.g., during a maintenance window). The
community has confirmed this clears the stuck state and restores normal
operation .
### Important Context
The issue is **not** CloudStack 4.19.3 compatibility with Ubuntu 24.04 in
general — it's specifically a libvirt regression. The CloudStack agent itself
works fine once the underlying libvirt issue is addressed .
Please let me know what libvirt version you find on your hosts, and whether
this solution resolves the problem for you. The community would also appreciate
any feedback on whether libvirt 10.6.0 resolves the issue in your Ceph-backed
environment.
Regards,
Ryan P.
Cloud &DevOps Engineer
AccuWeb.Cloud
GitHub link:
https://github.com/apache/cloudstack/discussions/14065#discussioncomment-18313784
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]