Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-7346

[libvirt] Can't get correct cluster size when vol-create-from with an cluster size in target volume

    • None
    • Moderate
    • rhel-sst-virtualization-storage
    • ssg_virtualization
    • 3
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      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.

      1. virsh pool-list --all
        Name State Autostart
        -------------------------------
        default active yes
      2. 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.

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

      3. Vol-create-from target volume with cluster size.

      1. 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>
      2. 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.

      1. virsh vol-dumpxml --pool default cluster1.img | grep clusterSize
        ------Can't get the cluster size
      1. systemctl restart libvirtd
      2. 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:

              phrdina@redhat.com Pavel Hrdina
              rhn-support-meili Meina Li
              Pavel Hrdina Pavel Hrdina
              Meina Li Meina Li
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: