Re: Libvirt, quemu, ceph write cache settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/17/2013 11:39 PM, Maciej Gałkiewicz wrote:
I have created VM with KVM 1.1.2 and all I had was rbd_cache configured
in ceph.conf. Cache option in libvirt set to "none":

<disk type="network" device="disk">
       <driver name="qemu" type="raw" cache="none"/>
       <source
name="cinder_volumes/volume-f81d6108-d8c9-4e06-94ef-02b1943a873d"
protocol="rbd"/>
       <auth username="cinder_volumes">
         <secret type="ceph" uuid="9481a373-bef5-07e9-d156-d7d37bfed894"/>
       </auth>
       <target bus="virtio" dev="vda"/>
       <serial>f81d6108-d8c9-4e06-94ef-02b1943a873d</serial>
     </disk>
     <disk type="network" device="disk">
       <driver name="qemu" type="raw" cache="none"/>
       <source
name="cinder_volumes/volume-9ab3e9b3-e153-447c-ab1d-2f8f9bae095c"
protocol="rbd"/>
       <auth username="cinder_volumes">
         <secret type="ceph" uuid="9481a373-bef5-07e9-d156-d7d37bfed894"/>
       </auth>
       <target bus="virtio" dev="vdb"/>
       <serial>9ab3e9b3-e153-447c-ab1d-2f8f9bae095c</serial>
     </disk>

Config settings received from admin socket show that cache is enabled. I
thought that without configuring libvirt with cache options it is not
possible to force kvm to use it. Can you explain it a little bit why it
works or claims to work?

Setting rbd_cache=true in ceph.conf will make librbd turn on the cache
regardless of qemu. Setting qemu to cache=none tells qemu that it
doesn't need to send flush requests to the underlying storage, so it
does not do so. This means librbd is caching data, but qemu isn't
telling it to persist that data when the guest requests it. This is
the same as qemu's cache=unsafe mode, which makes it easy to get a
corrupt fs if the guest isn't shut down cleanly.

There's a ceph option to make this safer -
rbd_cache_writethrough_until_flush. If this and rbd_cache are true,
librbd will operate with the cache in writethrough mode until it is
sure that the guest using it is capable of sending flushes (i.e. qemu
has cache=writeback). Perhaps we should enable this by default so
people are less likely to accidentally use an unsafe configuration.

Josh
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com





[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux