Project

General

Profile

Bug #1432

libvirt: fix definition for rbd params/sources/etc

Added by Sage Weil almost 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
librbd
Target version:
Start date:
08/22/2011
Due date:
% Done:

0%

Spent time:
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

History

#1 Updated by Sage Weil almost 8 years ago

  • translation missing: en.field_position set to 16

#2 Updated by Sage Weil almost 8 years ago

  • translation missing: en.field_position deleted (16)
  • translation missing: en.field_position set to 14

#3 Updated by Sage Weil almost 8 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 8 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 almost 8 years 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 almost 8 years 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 almost 8 years 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 almost 8 years 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 almost 8 years ago

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

#10 Updated by Sage Weil almost 8 years ago

  • translation missing: en.field_story_points set to 5
  • translation missing: en.field_position deleted (37)
  • translation missing: en.field_position set to 36

#11 Updated by Sage Weil almost 8 years ago

  • translation missing: en.field_position deleted (39)
  • translation missing: en.field_position set to 19

#12 Updated by Sage Weil almost 8 years ago

  • Assignee set to Sage Weil

#13 Updated by Sage Weil almost 8 years ago

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

#14 Updated by Sage Weil almost 8 years ago

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

#15 Updated by Sage Weil almost 8 years ago

  • Assignee changed from Sage Weil to Josh Durgin

#16 Updated by Sage Weil over 7 years ago

  • Status changed from New to In Progress

#17 Updated by Sage Weil over 7 years ago

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

#18 Updated by Sage Weil over 7 years ago

  • translation missing: en.field_position deleted (69)
  • translation missing: en.field_position set to 1

#19 Updated by Josh Durgin over 7 years ago

  • Status changed from In Progress to Resolved

Merged upstream.

Also available in: Atom PDF