Bug 1729292 - Broken rbd_list method in virsh vol-list command
Summary: Broken rbd_list method in virsh vol-list command
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-11 19:17 UTC by Jules
Modified: 2019-07-15 07:44 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-15 07:44:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Jules 2019-07-11 19:17:23 UTC
Description of problem:
The rbd_list method in virsh vol-list command is broken. 
Its just showing the first volume in result array.

Version-Release number of selected component (if applicable):
libvirt 5.5.0
Ceph Nautilus 14.2.1

How reproducible:
Recently checked and worked fine with libvirt 5.4.0 and Ceph Mimic 13.2.6

Steps to Reproduce:

1. Create a CEPH RBD Storage Pool
echo "<pool type='rbd'>
  <name>my_volumes</name>
  <source>
    <host name='host1' port='6789'/>
    <host name='host2' port='6789'/>
    <host name='host3' port='6789'/>
    <name>vm_volumes</name>
    <auth type='ceph' username='libvirt'>
      <secret usage='client.libvirt secret'/>
    </auth>
  </source>
</pool>" >/etc/libvirt/storage/my_volumes.xml

2. Register Pool
virsh pool-define /etc/libvirt/storage/my_volumes.xml
virsh pool-built my_volumes
virsh pool-start my_volumes
virsh pool-autostart my_volumes

3. Create RAW volumes on Ceph RBD
qemu-img create -f raw rbd:my_volumes/vm1-root 1G
qemu-img create -f raw rbd:my_volumes/vm2-root 1G
qemu-img create -f raw rbd:my_volumes/vm3-root 1G
qemu-img create -f raw rbd:my_volumes/vm4-root 1G


Actual results:
vol-list just showing the first volume from the ceph rbd:

virsh vol-list my_volumes

Name Path
-------------------------------------------------
vm1-root my_volumes/vm1-root

Expected results:
List all existing volumes like it was before 

virsh vol-list vm_volumes
Name Path
-------------------------------------------------
vm1-root my_volumes/vm1-root
vm2-root my_volumes/vm2-root
vm3-root my_volumes/vm3-root
vm4-root my_volumes/vm4-root


Additional info:

In theory it can have a relation to this commit:
https://github.com/libvirt/libvirt/commit/3aa190f2a43a632b542a6ba751a6c3ab4d51f1dd#diff-107c5451015e5980c90048ff615becb8

Since it kicks in if Ceph >= 14.0

Comment 1 Cole Robinson 2019-07-11 23:25:40 UTC
CCing danpb who wrote the patch, and dillaman who had patches around the same time. Maybe someone has a setup to test

Comment 2 Ján Tomko 2019-07-12 14:27:19 UTC
I believe this patch should fix it, but I have not tested it:
https://www.redhat.com/archives/libvir-list/2019-July/msg00811.html

Comment 3 Jules 2019-07-12 14:39:23 UTC
I will test whatever you like me to test.

We urgently need to get all Ceph RBD features working again.

Can you give me direct links to your diff patches, so i can add them to my quilt patchsets.

Comment 4 Ján Tomko 2019-07-12 15:15:35 UTC
Pushed to git master as:
commit 9b7c4048fa0559fd81d57b7f7d13b1dccd6a99b2
Author:     Ján Tomko <jtomko>
CommitDate: 2019-07-12 17:09:42 +0200

    storage: rbd: actually index the array when iterating over it
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1729292
    
    Fixes: 3aa190f2a43a632b542a6ba751a6c3ab4d51f1dd
    Signed-off-by: Ján Tomko <jtomko>
    Reviewed-by: Daniel P. Berrangé <berrange>

git describe: v5.5.0-123-g9b7c4048fa

It can be fetched using the URLs mentioned here:
https://libvirt.org/git/?p=libvirt.git;a=summary
or you can wait a few minutes until it shows up on the github mirror.

Comment 5 Ján Tomko 2019-07-12 15:54:03 UTC
And with the latest commit it could even compile!
commit b632e00ffbfee7b11074bf4ca5f4399e929bbe53
Author:     Ján Tomko <jtomko>
CommitDate: 2019-07-12 17:51:39 +0200

    storage: rbd: do not attempt to dereference a non-pointer
    
    My commit 9b7c4048fa0559fd81d57b7f7d13b1dccd6a99b2 was too blind
    and my librbd was not new enough to actually compile this part.
    
    Signed-off-by: Ján Tomko <jtomko>

git describe: v5.5.0-126-gb632e00ffb

Comment 6 Jules 2019-07-12 20:25:58 UTC
awww, you reverted? :-(

Recent ceph rbd build i use:
librbd-devel-14.2.1-1

Comment 7 Jules 2019-07-15 07:32:25 UTC
I can confirm that your patch fixes my issue.


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