Commit 7dfcf976 authored by Nikos Skalkotos's avatar Nikos Skalkotos

docs: Update the "supported images" section

snf-image-creator can work with different image formats nowadays.
parent d1000f25
...@@ -2,8 +2,12 @@ Overview ...@@ -2,8 +2,12 @@ Overview
^^^^^^^^ ^^^^^^^^
snf-image-creator is a simple command-line tool for creating OS images. The snf-image-creator is a simple command-line tool for creating OS images. The
original media the image is created from, can be a block device, a regular original media, the image is created from, can be:
file that represents a hard disk or the host system itself.
* a block device, representing a hard disk
* a disk image file, representing a hard disk (supports all image file formats
supported by QEMU)
* the host system itself
Snapshotting Snapshotting
============ ============
...@@ -318,102 +318,17 @@ Choosing *YES* will create and upload the image to your cloud account. ...@@ -318,102 +318,17 @@ Choosing *YES* will create and upload the image to your cloud account.
Working with different image formats Working with different image formats
==================================== ====================================
*snf-image-creator* works on raw image files. If you have an image file with a *snf-image-creator* is able to work with the most popular disk image formats.
different image format you can either convert it to raw using It has been successfully tested with:
*qemu-img convert* command or use the *blktap* toolkit that provides a
user-level disk I/O interface and use the exposed *tapdev* block device as
input on *snf-image-creator*.
Converting images to raw * Raw disk images
------------------------ * VMDK (VMware)
* VHD (Microsoft Hyper-V)
Converting between images with *qemu-img convert* is generally straightforward. * VDI (VirtualBox)
All you need to provide is the output format (*-O raw*) and an output filename. * qcow2 (QEMU)
You may use the *-f* option to define the input format, but in most cases this
is guessed automatically. The table below shows a list of supported image
formats and the equivalent argument you may pass to the *-f* flag.
|Image Format |-f argument|
|qcow2 (QEMU Copy On Write)|qcow2 |
|VHD (Mircosoft Hyper-V) |vpc |
|VMDK (VMware) |vmdk |
With the following commands we demonstrate how to download and convert an
official Ubuntu 14.04 *qcow2* image to raw:
.. code-block:: console
$ wget
$ qemu-img convert -f qcow2 -O raw trusty-server-cloudimg-amd64-disk1.img ubuntu.raw
Working on .vhd disk images using blktap/tapdisk
If the source image format is *Microsoft VHD* [#f1]_, we can use blktap/tapdisk
to connect it to a block device and use this block device as input in
*snf-image-creator* without having to convert the image to raw format.
Assuming that you work on a recent Debian GNU/Linux, you can install the
needed tools by giving the following command:
.. code-block:: console
# apt-get install blktap-utils
# modprobe blktap
Please refer to your distribution's documentation on how to install the blktap
user-space tools and the corresponding kernel module.
After you have successfully installed blktap, do the following to attack the
source image (*/tmp/Centos-6.2-x86_64-minimal-dist.vhd*) to a block device:
Allocate a minor number in the kernel:
.. code-block:: console
# tap-ctl allocate
Then, spawn a tapdisk process:
.. code-block:: console
# tap-ctl spawn
tapdisk spawned with pid 14879
Now, attach them together:
.. code-block:: console
# tap-ctl attach -m 0 -p 14879
And finally, open the VHD image:
.. code-block:: console
# tap-clt open -m 0 -p 14879 -a vhd:/tmp/Centos-6.2-x86_64-minimal-dist.vhd
Now you can open the associated block device with *snf-image-creator* like
.. code-block:: console
# snf-image-creator /dev/xen/blktap-2/tapdev
When done, you may release the allocated resources by giving the following
.. code-block:: console
# tap-ctl close -m 0 -p 14879
# tap-ctl detach -m 0 -p 14879
# tap-ctl free -m 0
It can support any image format QEMU supports as long as it represents a
bootable hard drive.
Limitations Limitations
=========== ===========
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment