openstack-manuals/doc/image-guide/ch_converting.xml
Diane Fleming 64b6c9261e Folder rename, file rename, flattening of directories
Current folder name	New folder name	        Book title
----------------------------------------------------------
basic-install 	        DELETE
cli-guide	        DELETE
common	                common
NEW	                admin-guide-cloud	Cloud Administrators Guide
docbkx-example	        DELETE
openstack-block-storage-admin 	DELETE
openstack-compute-admin 	DELETE
openstack-config 	config-reference	OpenStack Configuration Reference
openstack-ha 	        high-availability-guide	OpenStack High Availabilty Guide
openstack-image	        image-guide	OpenStack Virtual Machine Image Guide
openstack-install 	install-guide	OpenStack Installation Guide
openstack-network-connectivity-admin 	admin-guide-network 	OpenStack Networking Administration Guide
openstack-object-storage-admin 	DELETE
openstack-security 	security-guide	OpenStack Security Guide
openstack-training 	training-guide	OpenStack Training Guide
openstack-user 	        user-guide	OpenStack End User Guide
openstack-user-admin 	user-guide-admin	OpenStack Admin User Guide
glossary	        NEW        	OpenStack Glossary

bug: #1220407

Change-Id: Id5ffc774b966ba7b9a591743a877aa10ab3094c7
author: diane fleming
2013-09-08 15:15:50 -07:00

66 lines
3.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="ch_converting">
<title>Converting between image formats</title>
<para>Converting images from one format to another is generally straightforward.</para>
<simplesect>
<title>qemu-img convert: raw, qcow2, VDI, VMDK</title>
<para>The <command>qemu-img convert</command> command can do conversion between multiple
formats, including raw, qcow2, VDI (VirtualBox), VMDK (VMWare) and VHD (Hyper-V).</para>
<table
rules="all">
<caption>qemu-img format strings</caption>
<thead>
<tr>
<th>Image format</th>
<th>Argument to qemu-img</th>
</tr>
</thead>
<tbody>
<tr>
<td>raw</td>
<td><literal>raw</literal></td>
</tr>
<tr>
<td>qcow2</td>
<td><literal>qcow2</literal></td>
</tr>
<tr>
<td>VDI (VirtualBox)</td>
<td><literal>vdi</literal></td>
</tr>
<tr>
<td>VMDK (VMWare)</td>
<td><literal>vmdk</literal></td>
</tr>
<tr>
<td>VHD (Hyper-V)</td>
<td><literal>vpc</literal></td>
</tr>
</tbody>
</table>
<para>This example will convert a raw image file named centos63.dsk to a qcow2 image file.</para>
<para>
<screen><prompt>$</prompt> <userinput>qemu-img convert -f raw -O qcow2 centos64.dsk centos64.qcow2</userinput></screen>
</para>
<para>To convert from vmdk to raw, you would do:
<screen><prompt>$</prompt> <userinput>qemu-img convert -f vmdk -O raw centos64.vmdk centos64.img</userinput></screen></para>
<para>
<note>
<para>The <literal>-f <replaceable>format</replaceable></literal> flag is optional.
If omitted, qemu-img will try to infer the image format.</para>
</note>
</para>
</simplesect>
<simplesect>
<title>VBoxManage: VDI (VirtualBox) to raw</title>
<para>If you've created a VDI image using VirtualBox, you can convert it to raw format using
the <command>VBoxManage</command> command-line tool that ships with VirtualBox. On Mac
OS X, VirtualBox stores images by default in the <filename>~/VirtualBox VMs/</filename>
directory. The following example creates a raw image in the current directory from a
VirtualBox VDI
image.<screen><prompt>$</prompt> <userinput>VBoxManage clonehd ~/VirtualBox\ VMs/fedora18.vdi fedora18.img --format raw</userinput></screen></para>
</simplesect>
</chapter>