Bug 1301815 - Guest image occured error in qemu-img check after enlarge a small lvm to resume installing guest.
Guest image occured error in qemu-img check after enlarge a small lvm to resu...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
x86_64 Unspecified
medium Severity medium
: rc
: ---
Assigned To: Kevin Wolf
Virtualization Bugs
Depends On:
Blocks: 1302929 1302930
  Show dependency treegraph
Reported: 2016-01-25 22:28 EST by xiagao
Modified: 2016-02-16 14:49 EST (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1302929 1302930 (view as bug list)
Last Closed: 2016-02-16 14:49:02 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description xiagao 2016-01-25 22:28:51 EST
Description of problem:
Install rhel6.7 guest on a small lvm based iscsi storage, and enlarge lvm to resume installing guest when there is no space. After installation, check guest image with error info.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.login iscsi server and create lvm on host.
# iscsiadm -m node -T iqn.2016-01.com.xiagao:server.target0 -p --login
# vgcreate vgtest /dev/sdc
# lvcreate -L 3g -n lvtest vgtest
# lvs
 lvtest vgtest       -wi-a-----   3.00g

2.Create a large enough qcow2 file on lvm .
# qemu-img create -f qcow2 /dev/vgtest/lvtest 80G

3.Install rhel6.7.z guest with -drive file=...,format=qcow2...., using pxe installaion method
/usr/libexec/qemu-kvm \
    -S  \
    -name 'virt-tests-vm1' \
    -machine rhel6.6.0  \
    -nodefaults  \
    -vga cirrus \
    -drive file=/dev/vgtest/lvtest,if=none,id=drive-virtio-disk0,boot=on,format=qcow2,cache=none,werror=stop,rerror=stop \
    -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 \
    -device virtio-net-pci,mac=9a:d5:d6:d7:d8:d9,id=idnNqY2H,vectors=4,netdev=idz3Tned,bus=pci.0,addr=05  \
    -netdev tap,id=idz3Tned  \
    -m 4096  \
    -smp 4,cores=4,threads=1,sockets=1 \
    -cpu 'Conroe' \
    -vnc :0  \
    -enable-kvm \
    -monitor stdio

4.wait until vm pause on no space

5.extend the lvm. 
# lvextend -L +50M /dev/vgtest/lvtest

6.in qmp monitor . issue cont.
for qmp : {"execute":"cont"}

7. repeat 4~6.

8. after installation, check guest image

Actual results:
#qemu-img check /dev/vgtest/lvtest
Leaked cluster 49092 refcount=1 reference=0
Leaked cluster 49093 refcount=1 reference=0
Leaked cluster 49094 refcount=1 reference=0
Leaked cluster 49095 refcount=1 reference=0
Leaked cluster 49096 refcount=1 reference=0


Leaked cluster 69715 refcount=1 reference=0
Leaked cluster 69716 refcount=1 reference=0
Leaked cluster 69717 refcount=1 reference=0
Leaked cluster 69718 refcount=1 reference=0
Leaked cluster 69719 refcount=1 reference=0
Leaked cluster 69720 refcount=1 reference=0

4595 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
Image end offset: 4759093248

Expected results:
no error.

Additional info:
1.host cpu info
processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 15
model		: 107
model name	: AMD Athlon(tm) Dual Core Processor 5400B
stepping	: 2
cpu MHz		: 1000.000
cache size	: 512 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good extd_apicid pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch lbrv

2.after installation,check lvm
# lvs
lvtest vgtest       -wi-a-----   4.74g

3.guest can boot normally.

4.guest imag info
# qemu-img info /dev/vgtest/lvtest
image: /dev/vgtest/lvtest
file format: qcow2
virtual size: 80G (85899345920 bytes)
disk size: 0
cluster_size: 65536
Comment 2 xiagao 2016-01-26 03:26:27 EST
Can reproduce it on rhel6.7 release version.

pkg version:

When trigger cont after extend lvm at the first time, the image occured error.

Note You need to log in before you can comment on or make changes to this bug.