[libvirt] [PATCH 1/1] qemu: add support for multiple gluster hosts

Peter Krempa pkrempa at redhat.com
Tue Oct 6 09:23:03 UTC 2015

On Tue, Oct 06, 2015 at 10:38:23 +0530, Deepak C Shetty wrote:
> On 10/05/2015 07:33 PM, Peter Krempa wrote:
> > On Mon, Oct 05, 2015 at 18:59:54 +0530, Deepak C Shetty wrote:
> > [Note: Formatting of this mail is broken. Please configure your mail
> > client to properly flow text in the plaintext mode.]
> Sorry about that. I configured plain text format for libvir-list at redhat.com
> domain in my thunderbird client and selected plain text as delivery format
> for this specificmail.

Looks better now, but you really should use plain text for any technical

> >
> >> On 10/05/2015 04:31 PM, Peter Krempa wrote:
> >>> On Mon, Oct 05, 2015 at 15:30:42 +0530, Prasanna Kumar Kalever wrote:


> >>
> >>
> >> * Create a qcow2 file for use with external snapshot
> >>
> >> qemu-img create -f qcow2 -b gluster://
> >> gluster://
> > If you pre-create backing files to use with --reuse-external, you have
> > to use the json syntax here to express the backing file.
> We tried that, but qemu-img says invalid protocol/format when given a
> json:"{...}" string in the above cmd, for backing and new file names.
> Qemu being used is built from source using the qemu patch thats
> referenced with the link below, that has json support for gluster network
> storage.

Well, that probably means that the QEMU patch isn't entirely right in
that case.

> >
> >> * Create a domainsnapshot XML (snap.xml)
> >>
> >> <domainsnapshot>
> >>       <disks>
> >>           <disk name="vda" snapshot="external" type="network">
> >>               <source protocol="gluster" name="sample/newsnap.qcow2">
> >>                   <host name="" port="24007"/>
> >>                   <host name="" port="24007"/>
> >>                   <host name="" port="24007"/>
> >>               </source>
> >>           </disk>
> >>       </disks>
> >> </domainsnapshot>
> > You are doing it the other way around. I was speaking of doing a VM
> > started with a multi-server gluster volume and then doing a snapshot
> > wherever you like. This should result in a snapshot that has json
> > definition of the backing file.
> Not clear what you mean by 'other way around' ?
> A VM was created (HFM seen above) using libvirt with this patch. The HFM's
> domain xml disk element is of type network & has 3 host's (hence 
> multi-server) entries.
> Also not clear on what you mean by 'whereeve u like' :) Can you pls 
> elaborate or provide
> the high level virsh steps that we need to use ?


So, as you've stated above you already have a VM that is using a gluster
disk, so if you use that one and:

virsh snapshot-create-as VMNAME --disk-only --diskspec vda,snapshot=external,file=/tmp/snapshot

virsh shutdown or virsh destroy VMNAME

virsh start VMNAME

So this basically creates a local image file that has a multi-host
gluster volume as backing. libvirt needs to be able to successfuly start
such VM, since we'd create them. Please also see [2]. Note that the
above step modifies the configuration of the VM, so you might want to
back it up prior to the steps above.

> We are using virsh which is again built as part of the libvirt src build 
> with this patch

This doesn't matter, virsh just forwards everything to the daemon. The
daemon has to have the right support.

> >
> >> * Run virsh snap cmd (error in bold)
> > [Note: using HTML mails on technical lists is not a good idea.]
> Sorry again, this mail should be in plain text
> >
> >> 0 :) dhcp1-86 ~/deepakcs $ virsh snapshot-create HFM --xmlfile
> >> ./snap.xml --disk-only --reuse-external
> >> *error: internal error: missing storage backend for network files using
> >> gluster protocol*
> > Erm, how are you attempting to test this if you don't even have libvirt
> > with gluster support installed?
> Hmm, what makes u think we don't have libvirt with gluster support 
> installed ?
> libvirtd is running from source with this patch included.

So your configure options or build environment is wrong then. The hint
is the error message you've posted.

error: internal error: missing storage backend for network files using gluster protocol

That is a generic message from the storage driver that is used in case
when the appropriate backend is not available.

As I've pointed out, it's the part of the storage driver that assists
the qemu driver in regular operations like reading the image header or
setting permissions on image files, not the actual pool/volume storage


Additionally this might be the reason you are not seeing any failures
right now. The code that uses the storage backend queries whether the
storage backend is actually supported before attempting to use it, so
please make sure that your daemon is properly built with gluster

> Are we missing anything ?

Probably gluster support in the storage driver.

> >
> >> * Run virsh snap cmd w/ domain is off (error in bold)
> >>


> >>         How to create such a scenario, so that we can "see" the problem
> >> happening and hence debug/fix it :)
> > Start a VM with the multi-host gluster support (as of by this patch)
> > and create an external snapshot even on local disk, no need to go to
> > gluster again.
> HFM is running w/ libvirtd and qemu buitl from sources with the 
> respective patches included
> Can you pls elaborate on "even on local disk" ?

See [1].

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151006/1aa6084b/attachment-0001.sig>

More information about the libvir-list mailing list