From 5f373cb06204356cc1ad27c88daf3ff8e6ecaf39 Mon Sep 17 00:00:00 2001 From: Francesco Di Nucci Date: Mon, 8 Jul 2024 15:42:15 +0200 Subject: [PATCH] Review "Tool support for image creation" * Change title to "Tools to automate image creation" as more appropriate to the content * Divide tools in OpenStack and externals * Include TOC * Remove imagefactory (last commit 4 years ago) and VeeWee (last commit 6 years ago) * Replace Kiwi legacy with KIWI NG Change-Id: I6d3f92e5acbe32f1c61b8f2d58a7fcbcda821f33 --- .../source/create-images-automatically.rst | 151 +++++++++--------- 1 file changed, 72 insertions(+), 79 deletions(-) diff --git a/doc/image-guide/source/create-images-automatically.rst b/doc/image-guide/source/create-images-automatically.rst index 7087e466ad..380a3a2467 100644 --- a/doc/image-guide/source/create-images-automatically.rst +++ b/doc/image-guide/source/create-images-automatically.rst @@ -1,9 +1,14 @@ -=============================== -Tool support for image creation -=============================== +================================ +Tools to automate image creation +================================ There are several tools that are designed to automate image creation. +.. contents:: :depth: 3 + +OpenStack tools +--------------- + Diskimage-builder ~~~~~~~~~~~~~~~~~ @@ -36,6 +41,70 @@ More elements are available in the `git source directory and documented in the `diskimage-builder elements documentation `_. +External tools +-------------- + +image-bootstrap +~~~~~~~~~~~~~~~ + +`image-bootstrap `_ +is a command line tool that generates bootable virtual machine images +with support for Arch, Debian, Gentoo and Ubuntu, and is prepared for use +with OpenStack. + +KIWI +~~~~ + +The `KIWI appliance builder `_ +provides an operating system image builder for various Linux supported +hardware platforms as well as for virtualization and cloud systems. It +allows building of images based on openSUSE, SUSE Linux Enterprise, +and Red Hat Enterprise Linux. The `KIWI NG Documentation +`_ explains how to use it. + +openstack-debian-images +~~~~~~~~~~~~~~~~~~~~~~~ + +`openstack-debian-images `_ +is the tool Debian uses to create its official OpenStack image. It is made of +a single very simple shell script that is easy to understand and modify. +It supports Grub and Syslinux, BIOS or EFI, amd64 and arm64 arch. + +openstack-debian-images can also be used to create a bootable image directly +on a hard disk, instead of using the Debian installer. + +To build an image, type this: + +.. code-block:: console + + # build-openstack-debian-image --release stretch + +More parameters can be added to further customize the image: + +.. code-block:: console + + # build-openstack-debian-image --release stretch \ + --hook-script /root/my-hook-script.sh \ + --debootstrap-url http://ftp.fr.debian.org/debian \ + --sources.list-mirror http://ftp.fr.debian.org/debian \ + --login myusername \ + --extra-packages vim,emacs + +The file ``/root/my-hook-script.sh`` will recieve 2 environment variable: +``BODI_CHROOT_PATH`` path where the image is mounted, and ``BODI_RELEASE`` +which is the name of the Debian release that is being bootstraped. Here's +an example for customizing the motd: + +.. code-block:: console + + # #!/bin/sh + set -e + echo "My message" >${BODI_CHROOT_PATH}/etc/motd + +This hook script will conveniently be called at the correct moment of the +build process, when everything is installed, but before unmounting the +partition. + Oz ~~ @@ -132,45 +201,12 @@ For example: Oz will invoke libvirt to boot the image inside of KVM, then Oz will ssh into the instance and perform the customizations. -VeeWee -~~~~~~ - -`VeeWee `_ is often used -to build `Vagrant `_ boxes, -but it can also be used to build the KVM images. - Packer ~~~~~~ `Packer `_ is a tool for creating machine images for multiple platforms from a single source configuration. -image-bootstrap -~~~~~~~~~~~~~~~ - -`image-bootstrap `_ -is a command line tool that generates bootable virtual machine images -with support of Arch, Debian, Gentoo, Ubuntu, and is prepared for use -with OpenStack. - -imagefactory -~~~~~~~~~~~~ - -`imagefactory `_ is a newer tool designed -to automate the building, converting, and uploading images -to different cloud providers. It uses Oz as its back-end and -includes support for OpenStack-based clouds. - -KIWI -~~~~ - -The `KIWI OS image builder `_ -provides an operating system image builder for various Linux supported -hardware platforms as well as for virtualization and cloud systems. It -allows building of images based on openSUSE, SUSE Linux Enterprise, -and Red Hat Enterprise Linux. The `openSUSE Documentation -`_ explains how to use KIWI. - virt-builder ~~~~~~~~~~~~ @@ -200,49 +236,6 @@ To import it into libvirt with :command:`virsh`: # virt-install --name fedora --ram 2048 \ --disk path=image.qcow2,format=qcow2 --import -openstack-debian-images -~~~~~~~~~~~~~~~~~~~~~~~ - -`openstack-debian-images `_ -is the tool Debian uses to create its official OpenStack image. It is made of -a single very simple shell script that is easy to understand and modify. -It supports Grub and Syslinux, BIOS or EFI, amd64 and arm64 arch. - -openstack-debian-images can also be used to create a bootable image directly -on a hard disk, instead of using the Debian installer. - -To build an image, type this: - -.. code-block:: console - - # build-openstack-debian-image --release stretch - -More parameters can be added to further customize the image: - -.. code-block:: console - - # build-openstack-debian-image --release stretch \ - --hook-script /root/my-hook-script.sh \ - --debootstrap-url http://ftp.fr.debian.org/debian \ - --sources.list-mirror http://ftp.fr.debian.org/debian \ - --login myusername \ - --extra-packages vim,emacs - -The file ``/root/my-hook-script.sh`` will recieve 2 environment variable: -``BODI_CHROOT_PATH`` path where the image is mounted, and ``BODI_RELEASE`` -which is the name of the Debian release that is being bootstraped. Here's -an example for customizing the motd: - -.. code-block:: console - - # #!/bin/sh - set -e - echo "My message" >${BODI_CHROOT_PATH}/etc/motd - -This hook script will conveniently be called at the correct moment of the -build process, when everything is installed, but before unmounting the -partition. - windows-openstack-imaging-tools ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~