Hi Eric,

Thanks for your reply.

In this case the openstack is integrated with ceph and the volume in ceph is attached to the VMs in openstack. The VM is able to access the volume using the authentication included in the disk section. So there will not be any pool on the KVM side.

I tried 'virsh domblkinfo $dom vda' but it does not work because it failed to stat the volume path as it appears in the source name (svl-cc1-cinder-volume-1/volume-0a4cdeab-863d-4394-845f-008b993bc4e9). However 'virsh domblkstat $dom vda' still works and I am able to get the disk R/W information.

I am wondering if I need to format the volume path to include the protocol (rbd) and the ceph authentication in order to let libvirt be able to talk with the ceph to get the block information. I am still trying that. Can you please provide any comment on this?

Thanks,
Bruce


On Tue, Mar 11, 2014 at 9:59 AM, Eric Blake <eblake@redhat.com> wrote:
On 03/10/2014 07:09 PM, Qiang Fu wrote:
> Hi,
>
> In the output of "virsh dumpxml" command the disk section is as follows:
>
> <disk type='network' device='disk'>
>       <driver name='qemu' type='raw' cache='writeback'/>
>       <auth username='svl-cc1-cinder-user'>
>         <secret type='ceph' uuid='e80afa94-a64c-486c-9e34-d55e85f26406'/>
>       </auth>
>       <source protocol='rbd'
> name='svl-cc1-cinder-volume-1/volume-0a4cdeab-863d-4394-845f-008b993bc4e9'>
>         <host name='10.34.114.211' port='6789'/>
>         <host name='10.34.114.212' port='6789'/>
>         <host name='10.34.114.213' port='6789'/>
>       </source>
>       <target dev='vda' bus='virtio'/>
>       <serial>0a4cdeab-863d-4394-845f-008b993bc4e9</serial>
>       <alias name='virtio-disk0'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x04'
> function='0x0'/>
>     </disk>
>
> In this case how can I use libvirt to get the disk/volume size information?

Have you tried 'virsh vol-dumpxml $vol', for an appropriate choice of
$vol?  It may require creating an rbd storage pool first.

There's also 'virsh domblkinfo $dom vda', for obtaining information
about the vda disk associated with $dom.

--
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org