Bug 710350

Summary: cant create snapshot with LVM based image
Product: Red Hat Enterprise Linux 5 Reporter: Xiaoqing Wei <xwei>
Component: kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.7CC: juzhang, kwolf, michen, mkenneth, shuang, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-07 12:55:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Xiaoqing Wei 2011-06-03 06:49:05 UTC
Description of problem:

cant create snapshot with LVM based image
Version-Release number of selected component (if applicable):
kvm-qemu-img-83.235.el5

How reproducible:
always

Steps to Reproduce:

1.Create a LVM based image :
qemu-img create -f qcow2 /dev/VolGroup00/image 20G

2.check the image :
#qemu-img info /dev/VolGroup00/image
image: /dev/VolGroup00/image
file format: host_device
virtual size: 23G (25098715136 bytes)
disk size: 0

3.create a snapshot :
# qemu-img snapshot -c helo /dev/VolGroup00/image
qemu-img: Could not create snapshot 'helo': -95 (Operation not supported)
  

Actual results:
could not create snapshot with LVM based image

Expected results:
snapshot created successfully 


Additional info:
use  qemu-img  shipped with RHEL6 ,run same cmd as above,snapshot created successfully.

Comment 1 Xiaoqing Wei 2011-06-03 07:28:38 UTC
create a live snapshot can success(in qemu monitor),
qemu-img create -f qcow2 /dev/VolGroup00/image
qemu-kvm .... -drive file=/dev/VolGroup00/image,index=0,if=virtio,media=disk
 ...other arguments omitted ....
(qemu)savevm  first_snap

####### wait for cmd finish
(qemu)info sanpshot
Snapshot devices: virtio0
Snapshot list (from virtio0):
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         first_snap             4.8M 2011-06-03 15:15:43   00:00:30.604

####### can see a snapshot created.


but if check the image offline,cant see any snapshot.

# qemu-img info /dev/VolGroup00/image
image: /dev/VolGroup00/image
file format: host_device
virtual size: 23G (25098715136 bytes)
disk size: 0

#qemu-img snapshot -l /dev/VolGroup00/image

didn't return a word

Comment 2 Kevin Wolf 2011-06-07 12:55:35 UTC
(In reply to comment #0)
> 2.check the image :
> #qemu-img info /dev/VolGroup00/image
> image: /dev/VolGroup00/image
> file format: host_device
> virtual size: 23G (25098715136 bytes)
> disk size: 0

The problem is that RHEL 5 always treats block devices as host_device instead of guessing the image format. Therefore the image is treated as raw instead of qcow2, and raw doesn't support snapshots.

We can't fix this easily in RHEL 5, internal snapshots are not supported anyway, and RHEL 6 gets it right already. Closing.