Bug 676323

Summary: It is not possible to create a RHEV template from a v2v-converted guest
Product: Red Hat Enterprise Linux 6 Reporter: Matthew Booth <mbooth>
Component: virt-v2vAssignee: Matthew Booth <mbooth>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1CC: dallan, mshao, rwu, whuang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-v2v-0.7.1-3.el6 Doc Type: Bug Fix
Doc Text:
It was not possible to create a Red Hat Enterprise Virtualization template from a guest that was converted by virt-v2v. Guests imported with this updated package can now be used to create templates.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:54:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Booth 2011-02-09 14:27:44 UTC
Although a guest will be imported correctly into RHEV and will run correctly, attempting to create a template from it will result in the following error in RHEV-M's Events log:

Failed to complete creation of Template Test from VM rhel6.

vdsm.log contains:

e7c2c09e-e224-4ba0-a551-67015f1b677e::ERROR::2011-02-09 11:24:12,041::image::738::Storage.Image::(copy) Unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/image.py", line 733, in copy
    dstVol.extend(newsize)
  File "/usr/share/vdsm/storage/blockVolume.py", line 300, in extend
    lvm.extendLV(self.sdUUID, self.volUUID, sizemb)
  File "/usr/share/vdsm/storage/lvm.py", line 904, in extendLV
    raise se.VolumeGroupSizeError("%s/%s %d > %d" % (vgName, lvName, int(size) * MEGAB, free_size))
VolumeGroupSizeError: Volume Group not big enough: ('b00de9fd-25e4-45f5-95b5-8292921395c4/b0a7664a-30a2-4037-bc57-4d63a4d51147 1099511627776 > 101267275776',)

earlier in the logs reveals:

Thread-639::INFO::2011-02-09 11:24:11,128::volume::628::Storage.Volume::(getInfo) b00de9fd-25e4-45f5-95b5-8292921395c4/e6fa620e-535f-4912-bbc0-a4b8d43faac0/9d4040b9-22d6-4602-
88d1-c9f670cf3183 info is {'status': 'OK', 'domain': 'b00de9fd-25e4-45f5-95b5-8292921395c4', 'truesize': '2147483648', 'voltype': 'LEAF', 'uuid': '9d4040b9-22d6-4602-88d1-c9f6
70cf3183', 'parent': '00000000-0000-0000-0000-000000000000', 'format': 'RAW', 'description': 'Exported by virt-v2v', 'children': [], 'ctime': '1297250566', 'disktype': '1', 'l
egality': 'LEGAL', 'mtime': '1297250567', 'capacity': '1099511627776', 'apparentsize': '2147483648', 'type': 'PREALLOCATED', 'image': 'e6fa620e-535f-4912-bbc0-a4b8d43faac0', '

Note that capacity == apparentsize * 512, and the template is attempting to create a new volume of size <capacity>.

I believe that this is caused by incorrect units for SIZE in the .meta file for the volume originally created by virt-v2v. virt-v2v currently assumes units of bytes. Trial and error suggests the units should be 512 byte sectors.

I am currently looking for confirmation of this:

http://post-office.corp.redhat.com/mailman/private/rhev-devel/2011-February/msg00106.html

Comment 1 Matthew Booth 2011-02-11 16:00:49 UTC
I've pushed a fix for this upstream.

Comment 2 Huang Wenlong 2011-02-15 06:43:24 UTC
Hi,Matt

I test the bug in rhel6 : 
virt-v2v-0.7.1-3.el6.x86_64
libguestfs-1.7.17-12.el6.x86_64
libguestfs-*-1.7.17-12.el6.x86_64
libvirt-0.8.7-6.el6.x86_64
febootstrap-2.11-6.el6.x86_64
hivex-1.2.4-3.el6.x86_64
libguestfs-winsupport-1.0-5.el6.x86_64
augeas-libs-0.7.2-4.el6.x86_64 

I convert two guest win2k8-r2 and rhel5u6 from xen host  to rhev-m 
it can not be reproduced ,the disk info is correct .
this bug is verified.

Comment 3 Matthew Booth 2011-02-15 08:49:10 UTC
*** Bug 673466 has been marked as a duplicate of this bug. ***

Comment 6 Laura Bailey 2011-04-27 07:04:29 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
It was not possible to create a Red Hat Enterprise Virtualization template from a guest that was converted by virt-v2v. Guests imported with this updated package can now be used to create templates.

Comment 7 errata-xmlrpc 2011-05-19 13:54:14 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0650.html