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 1935810 - Fix progress bar of disk clone operation
Summary: Fix progress bar of disk clone operation
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: virt-manager
Version: 9.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1929519
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-05 15:50 UTC by Jaroslav Suchanek
Modified: 2022-09-05 07:27 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1929519
Environment:
Last Closed: 2022-09-05 07:27:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jaroslav Suchanek 2021-03-05 15:50:15 UTC
+++ This bug was initially created as a clone of Bug #1929519 +++

Description of problem:
libvirt does own calculations of the progress of
'qemu-img convert -f qcow2 -O qcow2 -o preallocation=falloc,compat=1.1,lazy_refcounts'
operations.  That fails with xfs' preallocations.  It seems like utilizing qemu-img provided
progress counter should fix this.

Version-Release number of selected component (if applicable):
libvirt-6.0.0-28.module+el8.3.0+7827+5e65edd7 (from rhel8.3GA),
but the issue is also in rhel8.4 libvirt versions

How reproducible:
always

Steps to Reproduce:
https://bugzilla.redhat.com/show_bug.cgi?id=1877163#c6 and
https://bugzilla.redhat.com/show_bug.cgi?id=1877163#c7 should be usable.

Additional info, background:
- A partner opened bz1877163,
  "The progress bar of the "virt-clone --nonsparse" command shows the progress rate exceeding 100%"
- The flow seen in that bz seems to be (refer to https://bugzilla.redhat.com/show_bug.cgi?id=1877163#c16 ff)
  - virt-clone calls into libvirt APIs to clone the disk
  - libvirt calls:
    qemu-img convert -f qcow2 -O qcow2 -o preallocation=falloc,compat=1.1,lazy_refcounts [..]
  - virt-clone then queries libvirt API in a loop to get the "disk size",
    compares against requested disk size and computes progress
  - libvirt is by itself computing progress based on xfs details.
    xfs is doing preallocation
    ( https://bugzilla.redhat.com/show_bug.cgi?id=1877163#c19 ), rendering
    libvirts calculation incorrect
- From the research in bz1877163, it seems like libvirt could utilize
  the progress data from qemu-img, and simply make that available
  ( https://bugzilla.redhat.com/show_bug.cgi?id=1877163#c38 )

Comment 2 Hongzhou Liu 2022-08-03 02:10:35 UTC
I try the latest virt-manager on RHEL9.1 Here are my steps:

Packages:

virt-manager-4.0.0-1.el9.noarch
virt-install-4.0.0-1.el9.noarch
libvirt-8.5.0-1.el9.x86_64

Step 1: Prepare a vm with virt-install
#virt-install --osinfo detect=on -l http://download.eng.pek2.redhat.com/rhel-8/composes/RHEL-8/RHEL-8.7.0-20220727.0/compose/BaseOS/x86_64/os/ --disk  /home/vm.img,size=20

Step 2: Use virt-clone --nonsparse to check the proccess bar
# virt-clone --file /tmp/rhel-clone.qcow2 --original rhel8 --name rhel-clone --nonsparse
Allocating 'rhel-clone.qcow2'                                                                                              |  20 GB  00:00:00 !!! 
Allocating 'rhel-clone_VARS.fd'                                                                                            |    0 B  00:00:00 ... 

Clone 'rhel-clone' created successfully.

Expect result : The process bar should shows the status correctly

Actual result : The process bar is 100% all the time

Comment 3 Hongzhou Liu 2022-08-04 02:25:18 UTC
(In reply to Hongzhou Liu from comment #2)
> I try the latest virt-manager on RHEL9.1 Here are my steps:
> 
> Packages:
> 
> virt-manager-4.0.0-1.el9.noarch
> virt-install-4.0.0-1.el9.noarch
> libvirt-8.5.0-1.el9.x86_64
> 
> Step 1: Prepare a vm with virt-install
> #virt-install --osinfo detect=on -l
> http://download.eng.pek2.redhat.com/rhel-8/composes/RHEL-8/RHEL-8.7.0-
> 20220727.0/compose/BaseOS/x86_64/os/ --disk  /home/vm.img,size=20
> 
> Step 2: Use virt-clone --nonsparse to check the proccess bar
> # virt-clone --file /tmp/rhel-clone.qcow2 --original rhel8 --name rhel-clone
> --nonsparse
> Allocating 'rhel-clone.qcow2'                                               
> |  20 GB  00:00:00 !!! 
> Allocating 'rhel-clone_VARS.fd'                                             
> |    0 B  00:00:00 ... 
> 
> Clone 'rhel-clone' created successfully.
> 
> Expect result : The process bar should shows the status correctly
> 
> Actual result : The process bar is 100% all the time

@jjongsma @crobinso Hello, Please take a look for this, I am not sure is a bug or the process just too fast.
Thanks.

Comment 4 Jonathon Jongsma 2022-08-05 15:41:33 UTC
It does look a bit odd, but fairly low priority. Cole, do you have any time to take a quick look since you know the code much better than me? Otherwise it'll probably be pretty low on my todo list.

Comment 6 Cole Robinson 2022-08-10 16:39:50 UTC
This is arguably not an issue on virt-install side. For virt-clone operations we are typically using libvirt's BuildVolFrom API, and then polling the new volume's info/XML to get updated information. So we are just processing information we get from libvirt in this case.

Fixing libvirt to scrape qemu-img here would be substantial work I think, for a corner of the code that is rarely used except for virt-install. Maybe there's some simpler fix to get libvirt to report accurate <allocation> during this process, but it would need investigating.

The simplest UI fix I can think of would be to turn off the progress reporting when --nonsparse is used, internally when we set `cloneflags |= libvirt.VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA` . I don't have a setup handy to test this though

Comment 7 RHEL Program Management 2022-09-05 07:27:38 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


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