From Fedora Project Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 17: Line 17:
=== Who's available ===
=== Who's available ===


[[User:Crobinso|Cole Robinson]] and [[User:Kwolf|Kevin Wolf]] (IRC nick kwolf, GMT+2h) are your hosts for today.
[[User:Crobinso|Cole Robinson]] and [[User:Kwolf|Kevin Wolf]] are your hosts for today.


The following people have also agreed to be available for testing, workarounds, bug fixes, and general discussion:
The following people have also agreed to be available for testing, workarounds, bug fixes, and general discussion:
Line 29: Line 29:


=== Test Cases ===
=== Test Cases ===
{|


! TEST !! METHOD
Things to test, roughly in dependency order:


|-
# [[QA:Testcase virt-install using qcow2]]
| virt-install w/ qcow2
# [[QA:Testcase virt-manager install using qcow2]]
||
# [[QA:Testcase qemu-img convert from raw to qcow2]]
 
# [[QA:Testcase qemu-img create snapshot]]
virt-install can create qcow2 images at install time via the '--disk format='
option:
 
virt-install --connect qemu:///system \
              --name rawhide-qcow2 \
              --ram 1024 \
              --disk path=/var/lib/libvirt/images/rawhide.qcow2,format=qcow2,size=6 \
              --location http://download.fedoraproject.org/pub/fedora/linux/development/x86_64/os \
              --os-variant fedora12
 
virt-install can only create QCOW2 images in a libvirt managed directory
(storage pool), so trying to create /home/foouser/myvm.qcow2 may error unless
you have taught libvirt about your home directory. You can do this via
virt-manager: Edit->Host Details->Storage-> '+' Button to add a directory
storage pool. QCOW2 images can also be provisioned from the 'Storage' section
by selecting 'New Volume'
 
|-
| virt-manager w/ qcow2
||
 
Similarly, a qcow2 install can be done with virt-manager.
 
# Open virt-manager, click 'New'
# Enter options as necessary until you reach the 'Storage' screen
# Click 'Select managed or existing storage', then click 'Browse'
# Select storage pool 'default', then click 'New Volume'
# Enter a new filename and size, but select Format 'qcow2', click 'Create Volume'
# Select the newly created volume and click 'Choose Volume'
# Continue with the installation
 
|-
| qemu-img convert from raw to qcow2
||
 
An existing disk image can be converted to qcow2 using 'qemu-img':
 
cd /var/lib/libvirt/images
qemu-img convert -O qcow2 <original image> <new image name>
virsh pool-refresh default
 
This will not alter or remove the original disk image. 'pool-refresh' is
required for libvirt to notice the change. To point your VM at the qcow2 image,
you can use 'virsh edit <vm name>', and change the disk paths.
 
|-
| Backing files
||
 
An existing disk image can be used as a readonly 'backing store' for a new
image. The new image provides COW access to the original image: only changes
are stored in the new image (the original image is NOT altered in anyway).
This is useful if a user wants to test possibly dangerous changes to a valuable
disk image.
 
This can be done via libvirt. You will need to create an XML file for the new image:
 
cat << __EOF__ >> new.xml
<volume>
  <name>new.img</name>
  <!-- Amount of space to store changes -->
  <capacity>1000000000</capacity>
  <allocation>0</allocation>
  <target>
    <format type='qcow2'/>
  </target>
  <backingStore>
    <path>/var/lib/libvirt/images/youroriginal.img</path>
  </backingStore>
</volume>
__EOF__
 
Then run:
virsh vol-create --pool default new.xml
 
You can then create a VM pointing at 'new.img', or repoint an existing image at the new file using 'virsh edit <vm name>'
 
|}
 
=== Advanced aspects ===
 
If you want to play a bit more with qcow2 and the test cases suggested above are not enough for you, there are some additional features that cannot be accessed with the management tools (so they are not top priority to be tested), but you still can use them by invoking qemu-img and qemu manually.
 
When creating images with qemu-img, you can change some default options using the -o parameter. For example you could create a fairly non-standard image using <code>qemu-img create -f qcow2 -o encryption,cluster_size=32k,backing_file=base.vmdk image.qcow2 10G</code>. To get an overview of the supported options, you can use <code>qemu-img create -f qcow2 -o ?</code>.
 
The following list contains some suggestions on what you could test:
* Encrypted images (<code>-o encryption</code>)
* Varying cluster sizes (<code>-o cluster_size=size</code> where size is between 512 and 64k). Smaller cluster can save some space on almost empty disks, larger clusters are faster usually.
* Backing files (<code>-o backing_file=file</code>). The new image is based on the given backing file and only differences are saved into the qcow2 file. Try usinh different formats for the backing file, it doesn't need to be qcow2.
* Commit back the changes from a qcow2 image to its backing file (<code>qemu-img commit</code> or the <code>commit</code> command in the qemu monitor)
* Snapshots: You can either snapshot the disk of a turned off VM (<code>qemu-img snapshot -c my_snapshot disk.qcow2</code>) or use the qemu monitor to save the state of a running VM (<code>savevm my_snapshot</code>). In the former case, you can revert the disk to the saved state using <code>qemu-img snapshot -a my_snapshot.qcow2</code>. Using the qemu monitor (<code>loadvm my_snapshot</code>) you restore the complete VM state as it was when you saved the snapshot. Alternatively, you can also use the -loadvm option on the qemu command line to start a VM using a previously saved snapshot.
* Compressed images: When converting an image, you can have the resulting qcow2 image compressed (<code>qemu-img convert -O qcow2 -c ...</code>)
* Combine things: Snapshots on an encrypted image with a compressed backing file...
 
If you suspect that something has gone wrong with your image and you want to check it, you can try <code>qemu-img check disk.qcow2</code>.


=== Issues that were identified ===
=== Issues that were identified ===
Line 138: Line 42:
|-style="color: white; background-color: #3074c2; font-weight: bold"  
|-style="color: white; background-color: #3074c2; font-weight: bold"  
| Tester || Description || Bug references || Status
| Tester || Description || Bug references || Status
|-
|-  
| phan || VM cannot boot from the disk converted by qemu-img || [http://bugzilla.redhat.com/523948 #523948] || '''NEEDINFO'''
| || || [http://bugzilla.redhat.com/XXXXXX #XXXXX] || '''ASSIGNED'''
|-
|}
| jbao ||  VM cannot boot from the backing disk img || [http://bugzilla.redhat.com/525362 #525362] || '''NEEDINFO'''
|
 


[[Category:Fedora_12_Test_Days]]
[[Category:Test Days]]
[[Category:Virtualization]]
[[Category:Virtualization]]
Please note that all contributions to Fedora Project Wiki are considered to be released under the Attribution-Share Alike 4.0 International (see Fedora Project Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please solve the following task below and enter the answer in the box (more info):

Cancel Editing help (opens in new window)