Kashyap Chamarthy b9dc86d8d6 libvirt: Use 'writeback' QEMU cache mode when 'none' is not viable
When configuring QEMU cache modes for Nova instances, we use
'writethrough' when 'none' is not available.  But that's not correct,
because of our misunderstanding of how cache modes work.  E.g. the
function disk_cachemode() in the libvirt driver assumes that
'writethrough' and 'none' cache modes have the same behaviour with
respect to host crash safety, which is not at all true.

The misunderstanding and complexity stems from not realizing that each
QEMU cache mode is a shorthand to toggle *three* booleans.  Refer to the
convenient cache mode table in the code comment (in
nova/virt/libvirt/driver.py).

As Kevin Wolf (thanks!), QEMU Block Layer maintainer, explains (I made
a couple of micro edits for clarity):

    The thing that makes 'writethrough' so safe against host crashes is
    that it never keeps data in a "write cache", but it calls fsync()
    after _every_ write.  This is also what makes it horribly slow.  But
    'cache=none' doesn't do this and therefore doesn't provide this kind
    of safety.  The guest OS must explicitly flush the cache in the
    right places to make sure data is safe on the disk.  And OSes do
    that.

    So if 'cache=none' is safe enough for you, then 'cache=writeback'
    should be safe enough for you, too -- because both of them have the
    boolean 'cache.writeback=on'.  The difference is only in
    'cache.direct', but 'cache.direct=on' only bypasses the host kernel
    page cache and data could still sit in other caches that could be
    present between QEMU and the disk (such as commonly a volatile write
    cache on the disk itself).

So use 'writeback' mode instead of the debilitatingly slow
'writethrough' for cases where the O_DIRECT-based 'none' is unsupported.

Do the minimum required update to the `disk_cachemodes` config help
text.  (In a future patch, rewrite the cache modes documentation to fix
confusing fragments and outdated information.)

Closes-Bug: #1818847
Change-Id: Ibe236988af24a3b43508eec4efbe52a4ed05d45f
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
Looks-good-to-me'd-by: Kevin Wolf <kwolf@redhat.com>
2019-03-21 14:17:22 +01:00
2018-10-18 17:55:36 -04:00
2018-08-10 20:04:19 +00:00
2018-11-28 03:38:41 +00:00
2014-05-07 12:14:26 -07:00
2017-11-24 16:51:12 -05:00
2018-01-12 17:05:11 +08:00
2017-09-07 15:42:31 +02:00
2018-03-24 20:27:11 +08:00
2017-03-02 11:50:48 +00:00

========================
Team and repository tags
========================

.. image:: https://governance.openstack.org/tc/badges/nova.svg
    :target: https://governance.openstack.org/tc/reference/tags/index.html

.. Change things from this point on

OpenStack Nova
==============

OpenStack Nova provides a cloud computing fabric controller, supporting a wide
variety of compute technologies, including: libvirt (KVM, Xen, LXC and more),
Hyper-V, VMware, XenServer, OpenStack Ironic and PowerVM.

Use the following resources to learn more.

API
---

To learn how to use Nova's API, consult the documentation available online at:

- `Compute API Guide <https://developer.openstack.org/api-guide/compute/>`__
- `Compute API Reference <https://developer.openstack.org/api-ref/compute/>`__

For more information on OpenStack APIs, SDKs and CLIs in general, refer to:

- `OpenStack for App Developers <https://www.openstack.org/appdev/>`__
- `Development resources for OpenStack clouds
  <https://developer.openstack.org/>`__

Operators
---------

To learn how to deploy and configure OpenStack Nova, consult the documentation
available online at:

- `OpenStack Nova <https://docs.openstack.org/nova/>`__

In the unfortunate event that bugs are discovered, they should be reported to
the appropriate bug tracker. If you obtained the software from a 3rd party
operating system vendor, it is often wise to use their own bug tracker for
reporting problems. In all other cases use the master OpenStack bug tracker,
available at:

- `Bug Tracker <https://bugs.launchpad.net/nova>`__

Developers
----------

For information on how to contribute to Nova, please see the contents of the
CONTRIBUTING.rst.

Any new code must follow the development guidelines detailed in the HACKING.rst
file, and pass all unit tests.

Further developer focused documentation is available at:

- `Official Nova Documentation <https://docs.openstack.org/nova/>`__
- `Official Client Documentation
  <https://docs.openstack.org/python-novaclient/>`__

Other Information
-----------------

During each `Summit`_ and `Project Team Gathering`_, we agree on what the whole
community wants to focus on for the upcoming release. The plans for nova can
be found at:

- `Nova Specs <http://specs.openstack.org/openstack/nova-specs/>`__

.. _Summit: https://www.openstack.org/summit/
.. _Project Team Gathering: https://www.openstack.org/ptg/
S
Description
No description provided
Readme 258 MiB
Languages
Python 97.5%
Smarty 2.3%
Shell 0.2%