[systemd-devel] Should user mode linux register with machined?

Lennart Poettering lennart at poettering.net
Fri Oct 10 09:41:11 PDT 2014


On Tue, 16.09.14 17:31, Thomas Meyer (thomas at m3y3r.de) wrote:

Heya,

> I wrote a small patch for user-mode linux to register with machined by
> calling "CreateMachine". Is this a good idea to do so?

Well, this depends, how UML positions itself. If it's just a tool that
other management software should wrap and manage then the
CreateMachine() invocation should probably be in that other
management software. However, if it is mostly used outside of any such
management context, and usually invoked stand-alone, then doing
CreateMachine from UML itself certainly makes sense.

> I think machined gives you a nice overview over all running UML
> instances, also you get the scope unit and the control groups with above
> registration to machined. anything else on the plus side?

Most of the benefits of doing CreateMachine() you get for containers,
not for UML-style virtualization, however, there are some benefits for
UML-style stuff too:

"ps -e" knows a column "machine" for the UML processes, and so does
gnome-system-monitor. I am pretty sure there are a number of other
process management tools too this day that make use of this
information.

Also, after registration with machined we provide local name
resolution on the host for IP addresses of all local machines without
any further doing. This works for containers only right now (since we
simply enter the container's network namespace to gather the IP
config), but I want to open this up for real VMs too (by looking into
the DHCP pool of networkd for the same information).

> PS: I wonder what happens when I write a service unit file that starts
> an user mode linux instance and that instance will register with
> machined? won't both control groups overlap, i.e. the scope unit and the
> service unit? or is this not a problem?

THis should work fine, but we have a RegisterMachine() call precisely
for this case, but it's a bit, well, ... "underdocumented" right now ;-)

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list