In exploring Foreman as a viable frontend for a large deployment of
libvirt-based hypervisors, the number one complaint I've received from
fellow engineers is how difficult it is to "see" the resource consumption
of libvirt hosts. That is, if I want to create a new VM, I want to choose a
host for the guest that isn't under heavy load, has disk space to spare,
enough memory for the new VM, and so on.
The solution I've relied on thus far has been to use virt-manager as a
centralized view for how heavily loaded individual hypervisors are, but
this isn't ideal. Centralizing all management through Foreman would be a
better solution (for most use cases - I understand that for other use
cases, other interfaces for libvirt are better suited for this.)
To that end, I'm plowing through Rails tutorials and the
foreman_plugin_template source code to create an at-a-glance view of
compute resource resource consumption and availability. It's slow going,
but the community is tremendously helpful and I've got enough direction to
figure it out from here (thanks for the help, Dominic!)
With that in mind, a few questions for the Foreman devs:
- Is this the right way to tackle the problem, or does Foreman handle
this in a way I haven't found yet? I know Foreman will withhold memory
options above the threshhold that the hypervisor can allocate, but I've
been bit by throwing VMs onto hypervisors without enough disk space (and
similar experiences) that it warrants some sort of solution like what I'm
talking about. - Are there any problems to this approach? The most apparent I've
thought of is latency: if I want to see all hypervisors at-a-glance and am
asking each in turn about their current memory, load, and disk space,
things would get slow (I'm playing with Rails caching to solve this, but
that's still seems like a lot of data to pull regardless) - Last, if this seems like a viable endeavor, are there examples of
extending the API? I've got enough to go on to create some new dashboards
and models, but I haven't seen a clear example demonstrating how to extend
the API yet.
Thank you all for such a great open source solution, the fact that I can
whip up a plugin for a need like this so easily is incredible. If there's
any interest I can share the github repo as well for feedback.