RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1622785 - [RFE] [v2v] Provide a tool/flag to estimate data size to be migrated
Summary: [RFE] [v2v] Provide a tool/flag to estimate data size to be migrated
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
Depends On: 1621895
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-28 03:15 UTC by Brett Thurber
Modified: 2019-08-06 12:45 UTC (History)
8 users (show)

Fixed In Version: libguestfs-1.40.1-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 12:44:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2019:2096 0 None None None 2019-08-06 12:45:45 UTC

Description Brett Thurber 2018-08-28 03:15:55 UTC
Description of problem:
Create an off-shoot tool that will provide the total data size for migration.  

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 6 Richard W.M. Jones 2018-08-28 10:28:43 UTC
Upstream in:

https://github.com/libguestfs/libguestfs/commit/9f678c3bde2bcb4cddf47841f286cf9ad868f558

 $ virt-v2v --print-estimate --machine-readable=file:estimates
 ...
 $ cat estimates
 {
  "disks": [ 100000, 200000 ],
  "total": 300000
 }

Available for testing in the 7.6 LP branch
(https://people.redhat.com/rjones/virt-v2v-RHEL-7.6-lp/)

Comment 7 Pino Toscano 2019-01-17 11:46:19 UTC
This bug will be fixed by the rebase scheduled for RHEL 7.7, see bug 1621895.

Comment 9 liuzi 2019-03-26 03:22:15 UTC
Test bug with builds:
libguestfs-1.40.2-1.el7.x86_64
virt-v2v-1.40.2-1.el7.x86_64
libvirt-4.5.0-10.el7_6.4.x86_64

1.Check the option --print-estimate in virt-v2v man page about.
--print-estimate
Print the estimated size of the data which will be copied from the source disk(s) and stop. One number (the size in bytes) is printed per disk, and a total:

$ virt-v2v --print-estimate
...
disk 1: 100000
disk 2: 200000
total: 300000

With the --machine-readable option you get JSON output which can be directed into a file or elsewhere:

$ virt-v2v --print-estimate --machine-readable=file:estimates
...
$ cat estimates
{ "disks": [ 100000, 200000 ], "total": 300000 }

Scenario 1
1.1 Convert a guest use --print-estimate option.
# virt-v2v -ic xen+ssh://root.3.21 Auto-xen-rhel6.7-cd-sndcrd -o null --print-estimate
[ 0.0] Opening the source -i libvirt -ic xen+ssh://root.3.21 Auto-xen-rhel6.7-cd-sndcrd
[ 0.7] Creating an overlay to protect the source from being modified
[ 1.5] Opening the overlay
[ 8.2] Inspecting the overlay
[ 28.6] Checking for sufficient free disk space in the guest
[ 28.6] Estimating space required on target for each disk
[ 28.6] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: warning: guest tools directory ‘linux/el6’ is missing from
the virtio-win directory or ISO.

Guest tools are only provided in the RHV Guest Tools ISO, so this can
happen if you are using the version of virtio-win which contains just the
virtio drivers. In this case only virtio drivers can be installed in the
guest, and installation of Guest Tools will be skipped.
virt-v2v: This guest has virtio drivers installed.
[ 145.1] Mapping filesystem data to avoid copying unused and blank areas
[ 146.8] Closing the overlay
disk 1: 3808231424
total: 3808231424

1.2 Compare the output info with original guest's disk info.

Result: The actual usage size of the disk is smaller than what --print-estimates writes.

Scenario 2
2.1 Convert a guest use --print-estimate --machine-readable=file:estimates option.
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel5.11-x64-bug1611690 --password-file /tmp/passwd -o null --print-estimate --machine-readable=file:estimates
[ 0.0] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel5.11-x64-bug1611690
[ 28.6] Creating an overlay to protect the source from being modified
[ 45.8] Opening the overlay
[ 103.5] Inspecting the overlay
[ 483.3] Checking for sufficient free disk space in the guest
[ 483.3] Estimating space required on target for each disk
[ 483.3] Converting Red Hat Enterprise Linux Server release 5.11 (Tikanga) to run on KVM
virt-v2v: warning: don't know how to install guest tools on rhel-5
virt-v2v: This guest has virtio drivers installed.
[1799.8] Mapping filesystem data to avoid copying unused and blank areas
[1814.1] Closing the overlay

2.2 Check the output file and compare the output info with original guest's disk info.
# cat estimates
{ "disks": [ 4948099072, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888 ], "total": 25316818944 }

Result: The actual usage size of the disk is smaller than what --print-estimates writes.

Additional info:
1.Some special disk formats have also been tested, such as: iscsi disks and encrypted disks.and all passed.

Comment 10 liuzi 2019-04-18 03:56:18 UTC
Verify bug with builds:
virt-v2v-1.40.2-3.el7.x86_64
libguestfs-1.40.2-3.el7.x86_64
libvirt-4.5.0-12.el7.x86_64

1.Check the option --print-estimate in virt-v2v man page about.
--print-estimate
Print the estimated size of the data which will be copied from the source disk(s) and stop. One number (the size in bytes) is printed per disk, and a total:

$ virt-v2v --print-estimate
...
disk 1: 100000
disk 2: 200000
total: 300000

With the --machine-readable option you get JSON output which can be directed into a file or elsewhere:

$ virt-v2v --print-estimate --machine-readable=file:estimates
...
$ cat estimates
{ "disks": [ 100000, 200000 ], "total": 300000 }

Scenario 1
1.1 Convert a guest use --print-estimate option.
# virt-v2v -ic xen+ssh://root.3.21 Auto-xen-rhel6.7-cd-sndcrd -o null --print-estimate
[ 0.0] Opening the source -i libvirt -ic xen+ssh://root.3.21 Auto-xen-rhel6.7-cd-sndcrd
[ 0.7] Creating an overlay to protect the source from being modified
[ 1.5] Opening the overlay
[ 8.2] Inspecting the overlay
[ 28.6] Checking for sufficient free disk space in the guest
[ 28.6] Estimating space required on target for each disk
[ 28.6] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: warning: guest tools directory ‘linux/el6’ is missing from
the virtio-win directory or ISO.

Guest tools are only provided in the RHV Guest Tools ISO, so this can
happen if you are using the version of virtio-win which contains just the
virtio drivers. In this case only virtio drivers can be installed in the
guest, and installation of Guest Tools will be skipped.
virt-v2v: This guest has virtio drivers installed.
[ 145.1] Mapping filesystem data to avoid copying unused and blank areas
[ 146.8] Closing the overlay
disk 1: 3808231424
total: 3808231424

1.2 Compare the output info with original guest's disk info.

Result 1: The actual usage size of the disk is smaller than what --print-estimates writes.

Scenario 2
2.1 Convert a guest use --print-estimate --machine-readable=file:estimates option.
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel5.11-x64-bug1611690 --password-file /tmp/passwd -o null --print-estimate --machine-readable=file:estimates
[ 0.0] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel5.11-x64-bug1611690
[ 28.6] Creating an overlay to protect the source from being modified
[ 45.8] Opening the overlay
[ 103.5] Inspecting the overlay
[ 483.3] Checking for sufficient free disk space in the guest
[ 483.3] Estimating space required on target for each disk
[ 483.3] Converting Red Hat Enterprise Linux Server release 5.11 (Tikanga) to run on KVM
virt-v2v: warning: don't know how to install guest tools on rhel-5
virt-v2v: This guest has virtio drivers installed.
[1799.8] Mapping filesystem data to avoid copying unused and blank areas
[1814.1] Closing the overlay

2.2 Check the output file and compare the output info with original guest's disk info.
# cat estimates
{ "disks": [ 4948099072, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888, 1072037888 ], "total": 25316818944 }

Result 2: The actual usage size of the disk is smaller than what --print-estimates writes.

Scenario 3
Convert a guest and specify different output mode
3.1 # virt-v2v -ic xen+ssh://root.3.21 Auto-xen-rhel6.7-cd-sndcrd -of raw --print-estimate
[   0.0] Opening the source -i libvirt -ic xen+ssh://root.3.21 Auto-xen-rhel6.7-cd-sndcrd
[   0.7] Creating an overlay to protect the source from being modified
[   1.4] Opening the overlay
[  35.5] Inspecting the overlay
[  55.5] Checking for sufficient free disk space in the guest
[  55.5] Estimating space required on target for each disk
[  55.5] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 130.0] Mapping filesystem data to avoid copying unused and blank area
[ 130.5] Closing the overlay
disk 1: 3808296960
total: 3808296960

3.2 # virt-v2v -ic xen+ssh://root.3.21 Auto-xen-rhel6.7-cd-sndcrd -of qcow2 --print-estimate
[   0.0] Opening the source -i libvirt -ic xen+ssh://root.3.21 Auto-xen-rhel6.7-cd-sndcrd
[   0.7] Creating an overlay to protect the source from being modified
[   1.4] Opening the overlay
[  15.5] Inspecting the overlay
[  35.5] Checking for sufficient free disk space in the guest
[  35.5] Estimating space required on target for each disk
[  35.5] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 110.0] Mapping filesystem data to avoid copying unused and blank area
[ 110.1] Closing the overlay
disk 1: 3808165888
total: 3808165888

Result 4: Virt-v2v conversion depends on the output mode.

Scenario 5
Convert a guest with Sparse/preallocated disk
5.1 Create two disks and set different preallocation parameter
# qemu-img create -f qcow2 -o preallocation=full test1-metadata.qcow2 2G
Formatting 'test1-metadata.qcow2', fmt=qcow2 size=2147483648 cluster_size=65536 preallocation=full lazy_refcounts=off refcount_bits=16

#  qemu-img create -f qcow2 -o preallocation=metadata test2-metadata.qcow2 2G
Formatting 'test2-metadata.qcow2', fmt=qcow2 size=2147483648 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16

5.2 Attach the disks to a guest and convert the guest with --print-estimate parameter
# virt-v2v disks --print-estimate
[   0.0] Opening the source -i libvirt disks
[   0.1] Creating an overlay to protect the source from being modified
[   1.3] Opening the overlay
[   6.5] Inspecting the overlay
[  45.3] Checking for sufficient free disk space in the guest
[  45.3] Estimating space required on target for each disk
[  45.3] Converting Red Hat Enterprise Linux Server 7.6 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 203.1] Mapping filesystem data to avoid copying unused and blank areas
[ 204.2] Closing the overlay
disk 1: 3962699776
disk 2: 2146828288
disk 3: 589824
total: 6110117888

Additional info:
1.Some special disk formats have also been tested, such as: iscsi disks and encrypted disks.and all passed.

Result:
Virt-v2v provides a tool/flag to estimate data size to be migrated,so change the bug from ON_QA to VERIFIED.

Comment 12 errata-xmlrpc 2019-08-06 12:44:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:2096


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