support of "rbd cache = true" and "rbd cache writethrough until flush = true"

Bug #1412856 reported by Nobuto Murata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova-compute (Juju Charms Collection)
Fix Released
Wishlist
Edward Hope-Morley

Bug Description

Ceph v0.87 Giant release or later enables "rbd cache" and "rbd cache writethrough until flush" by default[1].
In Ubuntu repositories, vivid+ or cloud-archive:kilo+.

It would be nice if nova-compute charm has a config to enable "rbd cache" and "rbd cache writethrough until flush" as an option for Firefly. Regarding rbd cache settings, please refer [2].

[1] http://ceph.com/docs/master/release-notes/#upgrading-from-v0-80x-firefly
> The client-side caching for librbd is now enabled by default (rbd
> cache = true). A safety option (rbd cache writethrough until flush =
> true) is also enabled so that writeback caching is not used until the
> library observes a ‘flush’ command, indicating that the librbd
> users is passing that operation through from the guest VM. This
> avoids potential data loss when used with older versions of qemu that
> do not support flush.

[2] http://ceph.com/docs/master/rbd/rbd-config-ref/
> The user space implementation of the Ceph block device (i.e., librbd)
> cannot take advantage of the Linux page cache, so it includes its own
> in-memory caching, called “RBD caching.” RBD caching behaves just
> like well-behaved hard disk caching.

Tags: openstack cts

Related branches

Nobuto Murata (nobuto)
description: updated
James Page (james-page)
Changed in nova-compute (Juju Charms Collection):
status: New → Triaged
importance: Undecided → Wishlist
milestone: none → 15.04
James Page (james-page)
Changed in nova-compute (Juju Charms Collection):
milestone: 15.04 → 15.07
Changed in nova-compute (Juju Charms Collection):
assignee: nobody → Edward Hope-Morley (hopem)
Revision history for this message
Edward Hope-Morley (hopem) wrote :

Making rbd cache settings controllable via charm makes sense for the reason
stated above but also to allow caching to be disabled for Ceph >= Giant since
some deployments may not want it to be enabled, perhaps for consistency when
performing an upgrade. Question is do we enable or disable by default in the
charms. I propose that we use an option like the following to allow Ceph
default behaviour to be used:

rbd-client-cache:
  type: string
  default:
  description: |
    Enable/disable rbd client cache. Leaving this value unset will result in
    default Ceph rbd client settings being used (rbd cache is enabled by
    default for Ceph >= Giant). Supported values here are "enabled" or
    "disabled".

Changed in nova-compute (Juju Charms Collection):
status: Triaged → In Progress
James Page (james-page)
Changed in nova-compute (Juju Charms Collection):
milestone: 15.07 → 15.10
Revision history for this message
Nobuto Murata (nobuto) wrote :

oh, the relation between libvirt/qemu cache and rbd cache is rather complicated then I originally thought.

http://ceph.com/docs/master/rbd/qemu-rbd/#qemu-cache-options
> QEMU’s cache settings override Ceph’s default settings (i.e., settings that are not explicitly set in the Ceph configuration file). If you explicitly set RBD Cache settings in your Ceph configuration file, your Ceph settings override the QEMU cache settings. If you set cache settings on the QEMU command line, the QEMU command line settings override the Ceph configuration file settings.

http://ceph.com/docs/master/rbd/qemu-rbd/#running-qemu-with-rbd
> Important
> If you set rbd_cache=true, you must set cache=writeback or risk data loss. Without cache=writeback, QEMU will not send flush requests to librbd. If QEMU exits uncleanly in this configuration, filesystems on top of rbd can be corrupted.

http://ceph.com/docs/master/rbd/qemu-rbd/#creating-images-with-qemu
> Important
> The raw data format is really the only sensible format option to use with RBD. Technically, you could use other QEMU-supported formats (such as qcow2 or vmdk), but doing so would add additional overhead, and would also render the volume unsafe for virtual machine live migration when caching (see below) is enabled.

It sounds like rbd cache is safe even for live-migration if we configure it correctly. Therefore having a explicit control to turn on/off is a good thing, I believe.

Changed in nova-compute (Juju Charms Collection):
status: In Progress → Fix Committed
James Page (james-page)
Changed in nova-compute (Juju Charms Collection):
status: Fix Committed → Fix Released
Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

Those commits never made it into master and subsequently never in any later releases. I can only find them in the stable/17.02 branch.

I suppose that wasn't intentional?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.