|fai-diskimage(8)||System Manager's Manual||fai-diskimage(8)|
NAME¶fai-diskimage - create a disk image for booting a VM
DESCRIPTION¶fai-diskimage creates a disk image that can be used with Qemu/KVM, VirtualBox, VMware, Xen, Android device or by your cloud infrastructure. It runs the Fully Automatic Installation using a list of FAI classes. In the end you have a bootable disk image. Following formats are supported: .raw.xz, .raw.zst, .qcow2, .vdi, .vhdx, .vmdk, .simg.
- -c, --class CLASS[,CLASS]
- Define list of FAI classes
- -h, --help
- Print help
- -N, --new
- This option will be passed to the fai call. It then executes the scripts in class/[0-9]* for defining classes.
- -S, --size SIZE
- Set size of raw image (suffixes k M G T are supported)
- -s, --cspace URI
- Location of the config space. If location starts with /, the prefix file:// will be added. See fai.conf(5) for all supported protocols. Default is /srv/fai/config.
- -u, --hostname name
- Set hostname to name
- -v, --verbose
- Be verbose
EXAMPLES¶First, setup the configuration space. You will get an initial configuration including several examples.
You can now build your fist disk image.
# export FAI_BASEFILEURL=https://fai-project.org/download/basefiles/ # cl="DEBIAN,STRETCH64,AMD64,FAIBASE,GRUB_PC,DHCPC,DEMO,CLOUD,LAST" # fai-diskimage -vu cloud3 -S2G -c$cl cloud.raw
Creates a Debian system with a small set of software packages without graphical desktop. The disk image cloud.raw will be of size 2 GB and the host is called cloud3.
# export FAI_BASEFILEURL=https://fai-project.org/download/basefiles/ # cl=DHCPC,UBUNTU,XENIAL,XENIAL64,AMD64,XORG,LAST # fai-diskimage -vNu ubuntu -S7G -c$cl ubuntu.qcow2
Creates a disk image of size 7GB called ubuntu.qcow2 for a Ubuntu 16.04 desktop.
NOTES¶fai-diskimage will use zerofree if it's available on the host for getting better compression of the raw images.
Before creating an image, make sure you have the configuration space available. Create the config space for FAI by using the examples from the fai-doc package.
fai-diskimage is not limited to creating images for virtual machines. The raw images can also be copied (via dd) onto a real disk for booting bare metal hosts.
You can start fai-diskimage in a clean shell environment by calling:
# env -i /usr/sbin/fai-diskimage -vNu cloudhost -S5G -cSTRETCH64,GCE disk.raw
You can also build cross-architecture disk images using fai-disimage. See the chapter "Building cross-architecture disk images" in the FAI guide for details.
SEE ALSO¶This program is part of FAI (Fully Automatic Installation). See the FAI manual for more information on how to use fai-monitor. The FAI homepage is https://fai-project.org.
AUTHOR¶Thomas Lange <firstname.lastname@example.org>
|September 2018||FAI 5.7|