[systemd-devel] FR: machine unit

Lennart Poettering lennart at poettering.net
Fri Apr 3 04:38:29 PDT 2015


On Fri, 03.04.15 14:31, Alexey Shabalin (a.shabalin at gmail.com) wrote:

> Hi.
> 
> I have several containers with different setting.
> For example:
> systemd-nspawn at server1.service:
> ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot
> --link-journal=try-guest --network-bridge=br140
> --bind=/srv/node:/srv/node --machine=%i
> 
> systemd-nspawn at server2.service:
> ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot
> --link-journal=try-guest --network-bridge=br20
> --bind=/mnt/BACKDISK/backup:/var/backup
> --bind=/mnt/BACKDISK/ALTLinux:/var/ftp/ALTLinux --machine=%i
> 
> By default, systemd-nspawn at .service contain only one network type.
> ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot
> --link-journal=try-guest --network-veth --machine=%I
> And i can not use machinect enable|disable
> What default way for redefine ExecStart for systemd-nspawn?
> 
> 
> I want unit type "machine".
> For example, server1.machine:
> Directory=foo (/var/lib/machines/ if not defined)
> Machine=server1 (or Name=server1)
> NetworkPrivate=yes|no
> NetworkType=bridge|veth|ipvlan|macvlan  or other options NetworkBridge=br140
> Capability= ...
> Bind=/srv/node (for same path)
> Bind=/mnt/BACKDISK/ALTLinux:/var/ftp/ALTLinux
> and other options from systemd-nspawn
> 
> Systemd maybe native support machine unit or over generator.
> generator could generate systemd-nspawn at foo.service unit with specific
> options for systemd-nspawn in ExecStart=

My plan is to add a concept of .nspawn files that may accompany
machine directories and contain additional settings that may then be
omitted on the command line. It has been on the TODO list for a while now.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list