salt.modules.genesis

Module for managing container and VM images

New in version 2014.7.0.

salt.modules.genesis.avail_platforms()

Return which platforms are available

CLI Example:

salt myminion genesis.avail_platforms
salt.modules.genesis.bootstrap(platform, root, img_format='dir', fs_format='ext2', arch=None, flavor=None, repo_url=None, static_qemu=None)

Create an image for a specific platform.

Please note that this function MUST be run as root, as images that are created make files belonging to root.

platform
Which platform to use to create the image. Currently supported platforms are rpm, deb and pacman.
root
Local path to create the root of the image filesystem.
img_format
Which format to create the image in. By default, just copies files into a directory on the local filesystem (dir). Future support will exist for sparse.
fs_format
When using a non-dir img_format, which filesystem to format the image to. By default, ext2.
arch
Architecture to install packages for, if supported by the underlying bootstrap tool. Currently only used for deb.
flavor
Which flavor of operating system to install. This correlates to a specific directory on the distribution repositories. For instance, wheezy on Debian.
repo_url
Mainly important for Debian-based repos. Base URL for the mirror to install from. (e.x.: http://ftp.debian.org/debian/)
static_qemu
Local path to the static qemu binary required for this arch. (e.x.: /usr/bin/qemu-amd64-static)
pkg_confs
The location of the conf files to copy into the image, to point the installer to the right repos and configuration.

CLI Examples:

salt myminion genesis.bootstrap pacman /root/arch
salt myminion genesis.bootstrap rpm /root/redhat
salt myminion genesis.bootstrap deb /root/wheezy arch=amd64             flavor=wheezy static_qemu=/usr/bin/qemu-x86_64-static
salt.modules.genesis.pack(name, root, path=None, pack_format='tar', compress='bzip2')

Pack up a directory structure, into a specific format

CLI Examples:

salt myminion genesis.pack centos /root/centos
salt myminion genesis.pack centos /root/centos pack_format='tar'
salt.modules.genesis.unpack(name, dest=None, path=None, pack_format='tar', compress='bz2')

Unpack an image into a directory structure

CLI Example:

salt myminion genesis.unpack centos /root/centos