Taking Snapshots in OpenStack Operations Guide

Bug #1243377 reported by Vincent Caron
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-manuals
Fix Released
Medium
Victor Howard

Bug Description

The chapter " Ensuring snapshots are consistent" seems wrong from several points of view.

First, running "sync" alone does not bring any consistency. As soon as sync is done and returns control to the user, there already might be some dirty buffers in memory. Sync would need to be run atomically with the freezing command, but anyway xfs_freeze or fsfreeze *do* sync as stated in their manual page (util-linux 2.20.1: "... and all dirty data, metadata, and log information are written to disk.").

Secondly, it should be noted that in the very common case where the underlying snapshoting is done via LVM, the filesystem freeze is automatically handled by LVM. Once again, quoting "man fsfreeze" : "The device-mapper (and LVM) automatically freezes filesystem on the device when a snapshot creation is requested.".

Although it is needed in a specific case which might be the OpenStack one : the snapshoting is run from the host where the volume is seen as an unmounted LVM block device (the device is only mounted in the guest). In this case, LVM in the host cannot freeze the mounted filesystem since it cannot see it. That might be the only interesting case for OpenStack but I think it's worth mentioning and understanding.

Third, the mention about "fsfreeze" blocking the command line is quite right as some paging may occur and block the shell. But the solution with a 'sleep 30' is a racy hack. A better solution would be to run this in the instance :

# fsfreeze -f / && read x; fsfreeze -u /

Then call "nova image-create" from your workstation, and once done press enter in your instance shell to unfreeze it. Obviously you could automate this, but at least it let you do the proper synchronisation.

And still one should take care of "nova image-create" to have a safety timeout to cancel things if they take too long.

-----------------------------------
Built: 2013-10-17T18:53:42 00:00
git SHA: 607ccca2124d37ee94e162faa7543249adbf41f9
URL: http://docs.openstack.org/trunk/openstack-ops/content/snapsnots.html
source File: file:/home/jenkins/workspace/openstack-operations-guide/doc/openstack-ops/ch_ops_user_facing.xml
xml:id: snapsnots

Tags: ops-guide
Revision history for this message
Tom Fifield (fifieldt) wrote :

Thanks for your detailed write-up Vincent!

Changed in openstack-manuals:
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → Medium
tags: added: ops-guide
Tom Fifield (fifieldt)
Changed in openstack-manuals:
milestone: none → ops-guide-2
Tom Fifield (fifieldt)
Changed in openstack-manuals:
milestone: ops-guide-2 → juno
Changed in openstack-manuals:
assignee: nobody → Victor Howard (victor-r-howard)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to operations-guide (master)

Fix proposed to branch: master
Review: https://review.openstack.org/143693

Changed in openstack-manuals:
status: Triaged → In Progress
Changed in openstack-manuals:
assignee: Victor Howard (victor-r-howard) → Shilla Saebi (shilla-saebi)
Changed in openstack-manuals:
assignee: Shilla Saebi (shilla-saebi) → Victor Howard (victor-r-howard)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to operations-guide (master)

Reviewed: https://review.openstack.org/143693
Committed: https://git.openstack.org/cgit/openstack/operations-guide/commit/?id=f8cd51ff6f3e6361c8b5965c8f59f39eea17636a
Submitter: Jenkins
Branch: master

commit f8cd51ff6f3e6361c8b5965c8f59f39eea17636a
Author: Vic Howard <email address hidden>
Date: Tue Dec 23 11:22:16 2014 -0500

    Taking Snapshots in OpenStack Operations Guide

    Updates to the snapshots section in the openstack operations guide as requested by bug 1243377

    Change-Id: If367eda76bfc7c9a9894a1333cf1bdcb1d5a4d3e
    Closes-Bug: 1243377

Changed in openstack-manuals:
status: In Progress → Fix Released
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.