Control Linux Containers via Salt
depends: | lxc execution module |
---|
salt.runners.lxc.
cloud_init
(names, host=None, quiet=False, **kwargs)¶Wrapper for using lxc.init in saltcloud compatibility mode
salt.runners.lxc.
find_guest
(name, quiet=False)¶Returns the host for a container.
salt-run lxc.find_guest name
salt.runners.lxc.
find_guests
(names)¶Return a dict of hosts and named guests
salt.runners.lxc.
freeze
(name, quiet=False)¶Freeze the named container
salt-run lxc.freeze name
salt.runners.lxc.
info
(name, quiet=False)¶Returns information about a container.
salt-run lxc.info name
salt.runners.lxc.
init
(names, host=None, saltcloud_mode=False, quiet=False, **kwargs)¶Initialize a new container
salt-run lxc.init name host=minion_id [cpuset=cgroups_cpuset] \
[cpushare=cgroups_cpushare] [memory=cgroups_memory] \
[template=lxc template name] [clone=original name] \
[nic=nic_profile] [profile=lxc_profile] \
[nic_opts=nic_opts] [start=(true|false)] \
[seed=(true|false)] [install=(true|false)] \
[config=minion_config] [snapshot=(true|false)]
Extra options for network interfaces. E.g:
{"eth0": {"mac": "aa:bb:cc:dd:ee:ff", "ipv4": "10.1.1.1", "ipv6": "2001:db8::ff00:42:8329"}}
salt.runners.lxc.
list_
(host=None, quiet=False)¶List defined containers (running, stopped, and frozen) for the named (or all) host(s).
salt-run lxc.list [host=minion_id]
salt.runners.lxc.
purge
(name, delete_key=True, quiet=False)¶Purge the named container and delete its minion key if present. WARNING: Destroys all data associated with the container.
salt-run lxc.purge name
salt.runners.lxc.
start
(name, quiet=False)¶Start the named container.
salt-run lxc.start name
salt.runners.lxc.
stop
(name, quiet=False)¶Stop the named container.
salt-run lxc.stop name
salt.runners.lxc.
unfreeze
(name, quiet=False)¶Unfreeze the named container
salt-run lxc.unfreeze name