Bug 1970753

Summary: Can't get correct cluster size when vol-create-from with an cluster size in target volume
Product: Red Hat Enterprise Linux 9 Reporter: Meina Li <meili>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
libvirt sub component: Storage QA Contact: Meina Li <meili>
Status: CLOSED MIGRATED Docs Contact:
Severity: medium    
Priority: medium CC: hhan, jsuchane, lmen, phrdina, virt-maint, xuzhang, yalzhang
Version: 9.0Keywords: MigratedToJIRA, Reopened, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-22 16:19:54 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:

Description Meina Li 2021-06-11 06:20:36 UTC
Description of problem:
Can't get correct cluster size when vol-create-from with an cluster size in target volume

Version-Release number of selected component (if applicable):
libvirt-7.4.0-1.module+el8.5.0+11218+83343022.x86_64
qemu-kvm-6.0.0-18.module+el8.5.0+11243+5269aaa1.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a dir pool and a volume xml.
# virsh pool-list --all
 Name      State    Autostart
-------------------------------
 default   active   yes
# cat volume.xml
  <volume>
    <name>cluster.img</name>
    <key>/var/lib/libvirt/images/cluster.img</key>
    <capacity unit="G">2</capacity>
    <allocation>294912</allocation>
    <target>
      <path>/var/lib/libvirt/images/cluster.img</path>
      <format type='qcow2'/>
    </target>
 </volume>

2. Create a volume with vol-create.
# virsh vol-create --pool default volume.xml
Vol cluster created from volume.xml
# virsh vol-list default
 Name            Path
--------------------------------------------------------
 cluster.img         /var/lib/libvirt/images/cluster.img

3. Vol-create-from target volume with cluster size.
# cat dest-volume.xml
  <volume>
    <name>cluster1.img</name>
    <key>/var/lib/libvirt/images/cluster1.img</key>
    <capacity unit="G">2</capacity>
    <allocation>294912</allocation>
    <target>
      <path>/var/lib/libvirt/images/cluster1.img</path>
      <format type='qcow2'/>
    </target>
    <clusterSize unit='KiB'>512</clusterSize>
 </volume>
# virsh vol-create-from default dest-volume.xml cluster.img  --inputpool default
Vol cluster1.img created from input vol cluster.img

4. Check the cluster size in the new volume.
# virsh vol-dumpxml --pool default cluster1.img | grep clusterSize
------Can't get the cluster size

# systemctl restart libvirtd
# virsh vol-dumpxml --pool default cluster1.img | grep clusterSize
    <clusterSize unit='B'>65536</clusterSize>
------Get the incorrect cluster size even though restart the libvirtd

Actual results:
As above step 4.

Expected results:
Can get the correct cluster size.

Additional info:

Comment 1 Han Han 2021-06-17 10:44:39 UTC
(In reply to Meina Li from comment #0)
> Description of problem:
> Can't get correct cluster size when vol-create-from with an cluster size in
> target volume
> 
> Version-Release number of selected component (if applicable):
> libvirt-7.4.0-1.module+el8.5.0+11218+83343022.x86_64
> qemu-kvm-6.0.0-18.module+el8.5.0+11243+5269aaa1.x86_64
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. Prepare a dir pool and a volume xml.
> # virsh pool-list --all
>  Name      State    Autostart
> -------------------------------
>  default   active   yes
> # cat volume.xml
>   <volume>
>     <name>cluster.img</name>
>     <key>/var/lib/libvirt/images/cluster.img</key>
>     <capacity unit="G">2</capacity>
>     <allocation>294912</allocation>
>     <target>
>       <path>/var/lib/libvirt/images/cluster.img</path>
>       <format type='qcow2'/>
>     </target>
>  </volume>
> 
> 2. Create a volume with vol-create.
> # virsh vol-create --pool default volume.xml
> Vol cluster created from volume.xml
> # virsh vol-list default
>  Name            Path
> --------------------------------------------------------
>  cluster.img         /var/lib/libvirt/images/cluster.img
> 
> 3. Vol-create-from target volume with cluster size.
> # cat dest-volume.xml
>   <volume>
>     <name>cluster1.img</name>
>     <key>/var/lib/libvirt/images/cluster1.img</key>
>     <capacity unit="G">2</capacity>
>     <allocation>294912</allocation>
>     <target>
>       <path>/var/lib/libvirt/images/cluster1.img</path>
>       <format type='qcow2'/>
>     </target>
>     <clusterSize unit='KiB'>512</clusterSize>
Element <clusterSize> should be in <target>. See https://libvirt.org/formatstorage.html
>  </volume>
> # virsh vol-create-from default dest-volume.xml cluster.img  --inputpool
> default
> Vol cluster1.img created from input vol cluster.img
> 
> 4. Check the cluster size in the new volume.
> # virsh vol-dumpxml --pool default cluster1.img | grep clusterSize
> ------Can't get the cluster size
> 
> # systemctl restart libvirtd
> # virsh vol-dumpxml --pool default cluster1.img | grep clusterSize
>     <clusterSize unit='B'>65536</clusterSize>
> ------Get the incorrect cluster size even though restart the libvirtd
> 
> Actual results:
> As above step 4.
> 
> Expected results:
> Can get the correct cluster size.
> 
> Additional info:

Comment 2 Pavel Hrdina 2021-06-17 11:27:18 UTC
Reopening as the bug is still there. Yes Han, you are correct and the <clusterSize> element should be in <target> element so the expected example is incorrect but it is still missing.

Comment 4 John Ferlan 2021-09-08 13:30:14 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 6 RHEL Program Management 2021-12-17 07:26:59 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.

Comment 7 Meina Li 2021-12-20 01:17:43 UTC
Hi Pavel,

This bug has been changed to WONTFIX because of 30-day auto-close warning by RHEL Program Management. Please help to evaluate if we still plan to fix this issue. If yes, we need to change it to NEW status. 

Thanks.

Comment 8 Pavel Hrdina 2021-12-20 16:02:53 UTC
This was incorrectly closed by our aging bug policy.

Comment 11 RHEL Program Management 2023-09-22 16:18:46 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 12 RHEL Program Management 2023-09-22 16:19:54 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.