[pve-devel] Default cache mode for VM hard drives
Stanislav German-Evtushenko
ginermail at gmail.com
Wed Nov 19 20:34:50 CET 2014
On Wed, Nov 19, 2014 at 9:34 PM, Dietmar Maurer <dietmar at proxmox.com> wrote:
>
> Again, migration code flush all changes to disk, so there are no "out of
> sync" blocks
> after migration. What do I miss?
>
>
I'll try to explain within more details.
When write cache is enabled then KVM process write, write and write. It
doesn't care about what really happen to this data after it goes to buffer.
What DRBD does it is writing data from buffer to both nodes but DRBD can't
do this simultaneously. So it writes data to local node first and then to
another node. Between these 'writes' data in buffer can be changed and
nobody know it was changed. So every time data is written DRBD can't be
sure that data written locally and data written remotely are identical.
Why barriers usually helps? Because OS inside VM doesn't write anything
until 'data is committed' message received from DRBD. 'Data
is committed' comes from DRBD when real data committed to both nodes,
local and remote.
When O_DSYNC is in use (directsync and writethrough modes) then KVM itself
waits for 'data is written' message from DRBD and doesn't update buffer
before this message received. So we don't need to care what is happening
inside a VM.
Stanislav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20141119/9133fcee/attachment.htm>
More information about the pve-devel
mailing list