Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-image-creator
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-image-creator
Commits
93d1b2cb
Commit
93d1b2cb
authored
10 years ago
by
Nikos Skalkotos
Browse files
Options
Downloads
Patches
Plain Diff
docs: Add a different image formats section
Add a section on how to use snf-image-creator on non-raw format images
parent
0d89fb60
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/usage.rst
+105
-4
105 additions, 4 deletions
docs/usage.rst
with
105 additions
and
4 deletions
docs/usage.rst
+
105
−
4
View file @
93d1b2cb
...
...
@@ -315,6 +315,106 @@ confirm the provided data.
Choosing *YES* will create and upload the image to your cloud account.
Working with different image formats
====================================
*snf-image-creator* works on raw image files. If you have an image file with a
different image format you can either convert it to raw using
*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
------------------------
Converting between images with *qemu-img convert* is generally straightforward.
All you need to provide is the output format (*-O raw*) and an output filename.
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 http://uec-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
$ 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
/dev/xen/blktap-2/tapdev0
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
this:
.. code-block:: console
# snf-image-creator /dev/xen/blktap-2/tapdev
When done, you may release the allocated resources by giving the following
commands:
.. code-block:: console
# tap-ctl close -m 0 -p 14879
# tap-ctl detach -m 0 -p 14879
# tap-ctl free -m 0
Limitations
===========
...
...
@@ -331,7 +431,7 @@ Logical Volumes
---------------
The program cannot work on input media that contain LVM partitions inside
[#f
1
]_. The input media may only contain primary or logical partitions.
[#f
2
]_. The input media may only contain primary or logical partitions.
Para-virtualized drivers
------------------------
...
...
@@ -347,7 +447,7 @@ ramdisk, otherwise the VM won't be able to boot.
Many popular Linux distributions, like Ubuntu and Debian, will automatically
create a generic initial ramdisk file that contains many different modules,
including the VirtIO drivers. Others that target more experienced users, like
Slackware, won't do that [#f
2
]_. *snf-image-creator* cannot resolve this kind
Slackware, won't do that [#f
3
]_. *snf-image-creator* cannot resolve this kind
of problems and it's left to the user to do so. Please refer to your
distribution's documentation for more information on this. You can always check
if a system can boot with para-virtualized disk controller by launching it with
...
...
@@ -399,5 +499,6 @@ supported by both *snf-image-creator* and *snf-mkimage*.
.. rubric:: Footnotes
.. [#f1] http://sourceware.org/lvm2/
.. [#f2] http://mirrors.slackware.com/slackware/slackware-14.0/README.initrd
.. [#f1] http://technet.microsoft.com/en-us/library/bb676673.aspx
.. [#f2] http://sourceware.org/lvm2/
.. [#f3] http://mirrors.slackware.com/slackware/slackware-14.0/README.initrd
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment