From cc17246d2bddcace579d0c33cab9cf8027985cd8 Mon Sep 17 00:00:00 2001
From: Kaifeng Wang <kaifeng.w@gmail.com>
Date: Mon, 9 Mar 2020 16:38:07 +0800
Subject: [PATCH] Expand user-image doc

Adds some text on the general instruction on how to build
user-image by virtual machine software.

See also: https://review.opendev.org/#/c/710966/

Change-Id: Ic84bc14ff0bce609009455c644a1601f990a7b45
---
 doc/source/install/creating-images.rst | 34 ++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/doc/source/install/creating-images.rst b/doc/source/install/creating-images.rst
index f6155142f6..10a8c16df0 100644
--- a/doc/source/install/creating-images.rst
+++ b/doc/source/install/creating-images.rst
@@ -26,6 +26,9 @@ the end user. There are two types of user images:
 Building user images
 ^^^^^^^^^^^^^^^^^^^^
 
+disk-image-builder
+------------------
+
 The `disk-image-builder`_ can be used to create user images required for
 deployment and the actual OS which the user is going to run.
 
@@ -63,3 +66,34 @@ If you want to use Fedora image, replace ``ubuntu`` with ``fedora`` in the
 chosen command.
 
 .. _disk-image-builder: https://docs.openstack.org/diskimage-builder/latest/
+
+Virtual machine
+---------------
+
+Virtual machine software can also be used to build user images. There are
+different software options available, qemu-kvm is usually a good choice on
+linux platform, it supports emulating many devices and even building images
+for architectures other than the host machine by software emulation.
+VirtualBox is another good choice for non-linux host.
+
+The procedure varies depending on the software used, but the steps for
+building an image are similar, the user creates a virtual machine, and
+installs the target system just like what is done for a real hardware. The
+system can be highly customized like partition layout, drivers or software
+shipped, etc.
+
+Usually libvirt and its management tools are used to make interaction with
+qemu-kvm easier, for example, to create a virtual machine with
+``virt-install``::
+
+    $ virt-install --name centos8 --ram 4096 --vcpus=2 -f centos8.qcow2 \
+    > --cdrom CentOS-8-x86_64-1905-dvd1.iso
+
+Graphic frontend like ``virt-manager`` can also be utilized.
+
+The disk file can be used as user image after the system is set up and powered
+off. The path of the disk file varies depending on the software used, usually
+it's stored in a user-selected part of the local file system. For qemu-kvm or
+GUI frontend building upon it, it's typically stored at
+``/var/lib/libvirt/images``.
+