Bug #1432

libvirt: fix definition for rbd params/sources/etc

Added by Sage Weil almost 2 years ago. Updated over 1 year ago.

Status:ResolvedStart date:08/22/2011
Priority:NormalDue date:
Assignee:Josh Durgin% Done:

0%

Category:librbdSpent time:2.00 hours
Target version:v0.39
Source: Severity:
Backport: Reviewed:
Tags:

History

#1 Updated by Sage Weil almost 2 years ago

  • Position set to 16

#2 Updated by Sage Weil almost 2 years ago

  • Position deleted (16)
  • Position set to 14

#3 Updated by Sage Weil almost 2 years ago

The virtual disk was added to libvirt in 036ad5052b43fe9f0d197e89fd16715950408e1d.

It only lets you specify server hosts, nothing else. Librados wants

- client name/id
- conf path (optional)
- list of conf key/value pairs

These can be smooshed into one config string if need be (this is what qemu takes, actually). For example, "id=foo:conf=/path/to/conf:otheroption=that:foo=bar".

In the end, the <host> items translate into an option like "mon_host=host1,host2,host3".

#4 Updated by Wido den Hollander almost 2 years ago

Idea from gregaf was to "abuse" the name attribute to do so, have to look into this.

We should check this with the libvirt guys and see what we can do.

Their idea was to have a general format which can be used for Sheepdog, Ceph and NBD and other future network storage which would come up. Instead for writing a implementation for every project.

Some docs/discussing about the current format:

Main thing is that we want to push some key=values down to Qemu so that can do down to librbd without manipulating or interpreting it too much.

Some old hack in libvirt allowed virtual disks like:

    <disk type='virtual' device='disk'>
      <driver name='qemu' type='rbd' cache='writeback'/>
      <source path='rbd:rbd/beta:conf=/etc/ceph/ceph.conf'/>
      <target dev='vda' bus='virtio'/>
    </disk>

Works like a charm, but not what libvirt wants :)

#5 Updated by Wido den Hollander over 1 year ago

You can abuse the current libvirt implementation though.

    <disk type='network' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source protocol='rbd' name='rbd/beta:conf=/etc/ceph/ceph.conf:id=admin'>
        <host name='monitor.ceph.widodh.nl' port='6789'/>
        <host name='monitor-sec.ceph.widodh.nl' port='6789'/>
        <host name='monitor-third.ceph.widodh.nl' port='6789'/>
      </source>
      <target dev='vda' bus='virtio'/>
    </disk>

That works for me and results in a string to Qemu:

CEPH_ARGS=-m monitor.ceph.widodh.nl:6789,monitor-sec.ceph.widodh.nl:6789,monitor-third.ceph.widodh.nl:6789 ..... -drive file=rbd:rbd/beta:conf=/etc/ceph/ceph.conf:id=admin,if=none,id=drive-virtio-disk0,boot=on,format=raw,cache=writeback

The benefit of passing down a custom string through libvirt is that we never have to wait for them to implement a new scheme.

When RBD starts to become mainstream people will stick to the libvirt version supplied by their distro. If that means they'll have to wait for 2 years to get a new libvirt on their machines, that's a long time.

Right now you can simply put everything you need in the "name" attribute, but we'll have to check with the libvirt guys how they think about that.

#6 Updated by Sage Weil over 1 year ago

Hmm yeah, it's at least doable. I just sent an email to libvir-list asking about a more generic syntax for options... that'll let us eventually support using kernel rbd driver as well (in a reasonably non-hacky way). Seem ok? (Can probably move discussion to the list..)

#7 Updated by Wido den Hollander over 1 year ago

Saw the e-mail, let's keep the discussion there to make sure everyone involved is up to date.

We could use this issue for some internal work delegation.

#8 Updated by Sage Weil over 1 year ago

I wonder if we can harass someone on IRC to get some partial 'sure, whatever' before we go write patches..

Or Wido, maybe you can follow up on the list and see if someone takes notice?

#9 Updated by Sage Weil over 1 year ago

  • Target version changed from v0.35 to v0.36

#10 Updated by Sage Weil over 1 year ago

  • Story points set to 5
  • Position deleted (37)
  • Position set to 36

#11 Updated by Sage Weil over 1 year ago

  • Position deleted (39)
  • Position set to 19

#12 Updated by Sage Weil over 1 year ago

  • Assignee set to Sage Weil

#13 Updated by Sage Weil over 1 year ago

  • Target version changed from v0.36 to v0.37

#14 Updated by Sage Weil over 1 year ago

  • Target version changed from v0.37 to v0.38

#15 Updated by Sage Weil over 1 year ago

  • Assignee changed from Sage Weil to Josh Durgin

#16 Updated by Sage Weil over 1 year ago

  • Status changed from New to In Progress

#17 Updated by Sage Weil over 1 year ago

  • Target version changed from v0.38 to v0.39

#18 Updated by Sage Weil over 1 year ago

  • Position deleted (69)
  • Position set to 1

#19 Updated by Josh Durgin over 1 year ago

  • Status changed from In Progress to Resolved

Merged upstream.

Also available in: Atom PDF