All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jens Kristian Søgaard" <jens@mermaidconsulting.dk>
To: Sage Weil <sage@inktank.com>
Cc: Wolfgang Hennerbichler <wolfgang.hennerbichler@risc-software.at>,
	ceph-devel@vger.kernel.org
Subject: Re: [ceph-users] snapshot, clone and mount a VM-Image
Date: Sat, 16 Feb 2013 12:51:46 +0100	[thread overview]
Message-ID: <511F72D2.5020104@mermaidconsulting.dk> (raw)
In-Reply-To: <alpine.DEB.2.00.1302141241020.22023@cobra.newdream.net>

Hi Sage,

> 1) Decide what output format to use.  We want to use something that is 

I have given it some thought, and my initial suggestion to keep things 
simple is to use the QCOW2 image format.

The birds eye view of the process would be as follows:

* Initial backup

User supplied information: pool, image name

Create rbd snapshot of the image named "backup_1", where 1 could be a 
timestamp or an integer count.

Save the snapshot to a standard qcow2 image. Similar to:

qemu-img convert rbd:data/myimage@backup_1 -O qcow2 
data_myimage_backup_1.qcow2

Note: I don't know if qemu-img actually supports reading from snapshots 
currently.


* Incremental backup

User supplied information: pool, image name, path to initial backup or 
previous incremental file

Create rbd snapshot of the image named "backup_2", where 2 could be a 
timestamp or an integer count.

Determine previous snapshot identifier from given file name.

Determine objects changed from the snapshot given by that identifier and 
the newly created snapshot.

Construct QCOW2 L1- and L2-tables in memory from that changeset.

Create new qcow2 image with the previous backup file as the backing 
image, and write out the tables and changed blocks.

Delete previous rbd snapshot.


* Restoring and mounting


The use of the QCOW2 format means that we can use existing tools for 
restoring and mounting the backups.

To restore a backup the user can simply choose either the initial backup 
file or an incremental, and use qemu-img to copy that to a new rbd image.

To mount the initial backup or an incremental, the user can use qemu-nbd 
to mount and explore the backup to determine which one to restore.

The performance of restores and mounts would ofcourse be weakened if the 
backup consists of a large number of incrementals. In that case the 
existing qemu-img tool could be used to flatten the backup.


* Pros/cons

The QCOW2 format support compression, so we could implement compressed 
backups without much effort.

The disadvantages to using QCOW2 like this is that we do not have any 
checksumming or safe guards against potential errors such as users 
mixing up images.

Another disadvantage to this approach is that vital information is 
stored in the actual filename of the backup file. I don't see any place 
in the QCOW2 file format for storing this information inside the file, 
sadly.

We could opt for storing it inside a plain text file that accompanies 
the QCOW2 file, or tarballing the qcow2 file and that plain text file.

-- 
Jens Kristian Søgaard, Mermaid Consulting ApS,
jens@mermaidconsulting.dk,
http://www.mermaidconsulting.com/
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-02-16 11:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5118C6BF.70207@risc-software.at>
     [not found] ` <5118FA0D.606@42on.com>
     [not found]   ` <5118FB31.6020902@risc-software.at>
2013-02-11 14:28     ` [ceph-users] snapshot, clone and mount a VM-Image Sage Weil
2013-02-14 19:25       ` Jens Kristian Søgaard
2013-02-14 20:53         ` Sage Weil
2013-02-15  2:03           ` Josh Durgin
2013-02-16 11:51           ` Jens Kristian Søgaard [this message]
2013-02-16 22:59             ` Sage Weil
2013-02-16 23:16               ` Jens Kristian Søgaard
2013-02-28 23:33             ` Josh Durgin
2013-02-28 23:42               ` Sage Weil
2013-03-01  0:43               ` Ian Colle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=511F72D2.5020104@mermaidconsulting.dk \
    --to=jens@mermaidconsulting.dk \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    --cc=wolfgang.hennerbichler@risc-software.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.