All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>, Ian.Jackson@citrix.com
Cc: jfehlig@suse.com, xen-devel@lists.xen.org
Subject: Re: [RFC V7 3/3] xl snapshot-xxx Design
Date: Mon, 20 Oct 2014 17:39:42 +0100	[thread overview]
Message-ID: <1413823182.29506.16.camel@citrix.com> (raw)
In-Reply-To: <1412930928-14309-4-git-send-email-cyliu@suse.com>

On Fri, 2014-10-10 at 16:48 +0800, Chunyan Liu wrote:
> 1. xl commandline interface design
> 
> xl snapshot-create:
>   Create a snapshot (disk and RAM) of a domain.
> 
>   SYNOPSIS:
>     snapshot-create <domain> [<cfgfile>] [--disk-only] [--reuse-external]
>     [--live]
> 
>   OPTIONS:
>     [--domain] <string>  domain name, id or uuid
>     [--cfgfile] <string>  domain snapshot configuration

Is this separate to or the same as the <cfgfile> argument? Is this a
xl.cfg(5) config file or something specific to snapshot cfg?

>     --disk-only      capture disk state but not vm state
>     --reuse-external  reuse any existing external files
>     --live           take a live snapshot
> 
>     If option includes --live, then the domain is not paused while creating
>     the snapshot, like live migration. This increases size of the memory
>     dump file, but reducess downtime of the guest. Only support this flag
>     during external checkpoints.
> 
>     If option includes --disk-only, then the snapshot will be limited to
>     the disks, and no VM state will be saved. For an active guest, this is
>     not supported.
> 
>     If specify @cfgfile, cfgfile is prioritized.

What does "prioritized" mean in this context?

> xl snapshot-delete:
>   Delete a snapshot of a domain.

So what's not clear yet (but I see it is discussed below) is the manner
in which xl is going to manage snapshots.

Typically in the past users have been expected to manage disk and save
images with rm(1) and/or various format specific tools (qemu-img,
vhd-image, lvcreate etc).

I think you are proposing that there should be some path full of
snapshots, is that right? That is adding a lot of complexity to xl which
could potentially be avoided by sticking to the "user takes care of it"
path.

> 3. xl structure to maintain VM snapshot info

These are repeating the libxl ones? The look subtly different. If they
are xl specific then they should be in the xl_foo namespace, and of
course the should incorporate public libxl API structs where necessary.

Having the structs be named libxl_* makes it hard for me to see if you
have gotten the layering right in much of the below. I'll try and point
out the ones I think should be xl_* below, if you really meant libxl_*
then that probably means I disagree with the layering.

> According to libxl_domain_snapshot_info, a json file will be saved on disk.

You mean that libxl_domain_snapshot_info (really
xl_domain_snapshot_info) can be serialised to disk as json, right?

> 
> 4. xl snapshot-xxx implementation details

How do these interact with xl create/destroy/shutdown/save/restore?

e.g. does destroying a domain remove any snapshots?

A bunch of these are gong to require some care wrt the possibility of
multiple xl invocations and the possibility of an xl crash.

> "xl snapshot-create"
> 
>     1), parse args or domain snapshot configuration file.
>     2), fill info in libxl_domain_snapshot_args struct according to
>         options or config file.
>     3), call libxl_domain_snapshot_create()
>     4), fill info in libxl_domain_snapshot_info.

xl_domain_snapshot_info?

>     5), save snapshot info in json file under
> "/var/lib/xen/snapshots/domain_uuid"

Do the disk images go here too?

> "xl snapshot-list"
> 
>     1), read all domain snapshot related json file under
>         "/var/lib/xen/snapshots/domain_uuid". Parse each file and fill in
>         libxl_domain_snapshot_info struct.

xl_domain_snapshot_info?

>     2), display information from those libxl_domain_snapshot_info(s)
> 
> "xl snapshot-delete"
> 
>     1), read snapshot json file from
>         "/var/lib/xen/snapshots/domain_uuid/snapshotdata-<snapshot_name>\
>         .libxl-json", parse the file and fill in libxl_domain_snapshot_info

.xl-json and xl_domain_snapshot_info, I think?

>     2), according to parent/children info in libxl_domain_snapshot_info

xl_domain_snapshot_info.

>         and commandline options, decide which domain snapshot to be deleted.
>         To delete each domain snapshot, fill in
>         libxl_domain_snapshot_args and call libxl_domain_snapshot_delete().

Depending on the state of the domain, much of this can be done with
unlink and/or calling out to external tools.

>     3), refresh parent/children relationship, delete json file for those
>         already deleted snapshot.
> 
> "xl snapshot-revert"
> 
>     1), read snapshot json file from
>         "/var/lib/xen/snapshots/domain_uuid/snapshotdata-<snapshot_name>\
>         .libxl-json", parse the file and fill in libxl_domain_snapshot_info.

.xl-json and xl_domain_snapshot_info

>     2), fill in libxl_domain_snapshot_args
>     3). call libxl_domain_snapshot_revert().

  reply	other threads:[~2014-10-20 16:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  8:48 [RFC V7 0/3] domain snapshot document Chunyan Liu
2014-10-10  8:48 ` [RFC V7 1/3] libxl domain snapshot introduction Chunyan Liu
2014-10-20 15:59   ` Ian Campbell
2014-10-21  3:25     ` Chun Yan Liu
2014-10-10  8:48 ` [RFC V7 2/3] libxl domain snapshot API design Chunyan Liu
2014-10-20 16:11   ` Ian Campbell
2014-10-21  4:18     ` Chun Yan Liu
2014-10-22  3:59     ` Chun Yan Liu
2014-10-29 10:26       ` Ian Campbell
2014-11-03  7:37         ` Chun Yan Liu
2014-10-10  8:48 ` [RFC V7 3/3] xl snapshot-xxx Design Chunyan Liu
2014-10-20 16:39   ` Ian Campbell [this message]
2014-10-21  5:37     ` Chun Yan Liu
2014-10-22  4:10     ` Chun Yan Liu
2014-10-29  8:32     ` Chun Yan Liu
2014-10-29 10:19       ` Ian Campbell
2014-10-29  8:34     ` Chun Yan Liu
2014-10-29 10:22       ` Ian Campbell
2014-10-17  6:04 ` [RFC V7 0/3] domain snapshot document Chun Yan Liu
2014-10-17  9:50   ` Ian Campbell
2014-10-20 16:12 ` Ian Campbell

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=1413823182.29506.16.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=cyliu@suse.com \
    --cc=jfehlig@suse.com \
    --cc=xen-devel@lists.xen.org \
    /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.