Bug 1622785
| Summary: | [RFE] [v2v] Provide a tool/flag to estimate data size to be migrated | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Brett Thurber <bthurber> |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.6 | CC: | juzhou, mtessun, mxie, mzhan, ptoscano, tzheng, xiaodwan, zili |
| Target Milestone: | rc | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | V2V | ||
| Fixed In Version: | libguestfs-1.40.1-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-08-06 12:44:27 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1621895 | ||
| Bug Blocks: | |||
|
Description
Brett Thurber
2018-08-28 03:15:55 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/) This bug will be fixed by the rebase scheduled for RHEL 7.7, see bug 1621895. 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.
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.
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 |