qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael R. Hines" <mrhines@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: hinesmr@cn.ibm.com, "Michael R. Hines" <mrhines@us.ibm.com>,
	quintela@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v1 0/3] provenance: save migration stats after completion to destination
Date: Wed, 19 Feb 2014 10:30:12 +0800	[thread overview]
Message-ID: <53041734.1080801@linux.vnet.ibm.com> (raw)
In-Reply-To: <530362B5.8070908@redhat.com>

On 02/18/2014 09:40 PM, Eric Blake wrote:
> On 02/17/2014 10:53 PM, mrhines@linux.vnet.ibm.com wrote:
>> From: "Michael R. Hines" <mrhines@us.ibm.com>
>>
>> This series allows us to send the contents of the entire MigrationInfo structure to the
>> destination once the migration is over. This is very useful for analyzing
>> the result of a migration, and particularly useful for management software and
>> policy. Normally, the information ins MigrationInfo is completely lost when
>> the source VM is destroyed, but with this series, we can preserve the statistics
>> for retrieval.
>>
>> The QMP architecture has sufficient functionality to serialize and
>> deserialize arbitrary objects into JSON and back again (very nice).
>>
>> We only store the stats from the *last* migration, but not all previous migrations,
>> as that could potentially get unwieldy. Thus, it's the management software's (or user's)
>> responsibility to retrieve the statistics before another migration occurs.
> I like the idea.  It seems a little awkward that the final stats are
> only on the destination, not the source, since it was the source that
> triggered the migration.  But on further thought, migration itself is
> one-way (destination never sends anything to the source), so destination
> really is the only point that can see the full picture without making
> the migration protocol changed to be two-way.  Meanwhile, libvirt should
> be able to cope with it (libvirt does a handshake between source and
> destination, and does not kill the source until after the destination
> acknowledges success - so libvirt could query the destination stats,
> then pass them back over the handshake, so that libvirt could present
> the final stats from the source even though qemu can't).

Yes, exactly. That makes sense. I would be happy to scrape together
a libvirt patch that does that. Sending the stats back over the handshake
seems very promising.

> Now, as to your assertion that serializing the MigrationInfo will always
> work - I'm not quite sure about that.  Let's suppose we add a new field
> to the struct in qemu 2.1.  For back-compat reasons, the new field MUST
> be marked as optional in the qapi schema.  Here are the possibilities:
>
> qemu 2.0 -> 2.0: pass the smaller struct from source, expect the smaller
> struct on dest, no problem
> qemu 2.0 -> 2.1: pass the smaller struct from source, dest notices the
> optional field is missing and copes with no problem
> qemu 2.1 -> 2.1: pass the larger struct from source, dest handles the
> larger struct with no problem
> qemu 2.1 -> 2.0: pass the larger struct from source, but dest is only
> expecting the smaller struct.
>
> The last case is the one I worry about: does your implementation
> gracefully ignore fields that it was not expecting when reconstituting
> the MigrationInfo on the dest, or does it error out, losing all
> information in the process?
>
> On the other hand, upstream qemu seldom worries about down-version
> migrations (we strive hard to make sure 2.0 -> 2.1 works, but aren't too
> worried if 2.1 -> 2.0 fails) - it tends to be more of a situation that
> downstream distros provide value added by worrying about down-migration.
>   So my concern about what happens on down-migration is not a
> show-stopper for your patch idea.
>

Excellent question! I had not even considered that. I think this
could be solved with QObject arcitecture: So when the statistics
are received by the destination and deserialized, the conversion
from JSON to QObject would need to check to see if the struct
has all the expected fields, and if those fields are not there then
do not "bomb" or anything.

A deeper question would be: Let's assume a migrate to a lower
version, as in your example: Should the QMP statistics also include
the version of of the source QEMU that the guest originated from?
I could easily modify the patch to include that value.......

- Michael

  reply	other threads:[~2014-02-19  2:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18  5:53 [Qemu-devel] [RFC PATCH v1 0/3] provenance: save migration stats after completion to destination mrhines
2014-02-18  5:53 ` [Qemu-devel] [RFC PATCH v1 1/3] provenance: QMP command to store MigrationInfo from JSON mrhines
2014-02-18  5:53 ` [Qemu-devel] [RFC PATCH v1 2/3] provenance: serialize MigrationInfo across the wire mrhines
2014-02-18  5:53 ` [Qemu-devel] [RFC PATCH v1 3/3] provenance: expose the serialization save/load functions for migration mrhines
2014-02-18 13:40 ` [Qemu-devel] [RFC PATCH v1 0/3] provenance: save migration stats after completion to destination Eric Blake
2014-02-19  2:30   ` Michael R. Hines [this message]
2014-02-19  2:40     ` Eric Blake
2014-02-19  4:22       ` Michael R. Hines

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=53041734.1080801@linux.vnet.ibm.com \
    --to=mrhines@linux.vnet.ibm.com \
    --cc=eblake@redhat.com \
    --cc=hinesmr@cn.ibm.com \
    --cc=mrhines@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).