On 24.07.2015 13:49, Dmitry Guryanov wrote:
On 07/17/2015 03:55 PM, nshirokovskiy(a)virtuozzo.com wrote:
> NOTE that minimal command to migrate vz domain is like next:
>
> virsh -c vz:///system migrate 200 vz+ssh://shiny0/system -p2p --live --persistent
> --compressed
>
> Difference from v1:
>
> 1. Patch is quite different. First patchset implements migration thru managed
> migration scheme. This one goes thru p2p scheme. I belive this is a better
> approach. Vz migration is done via vz sdk and first patchset uses 5 phased
> migration only to get a token from destination on prepare phase which is kind a
> misuse. This patch just adds vz specific function to driver interface
> to archive the same goal.
What was the problem with previous approach? I think using cookies for transferring
session id is better, than extending remote protocol.
I don't think it is right to use staged migration in our case.
If we use perform phase to do actual migration and prepare phase to pass a vz
session token from destination to source we break implicitly defined perform
phase meaning (see virDomainMigrateVersion3Full). At the end of this phase all
domain data is moved to destination but domain is not yet resumed there (this
is done on finish phase) and domain is not yet killed on source. In our case
both tasks would be alredy done at perform phase as vz sdk makes complete
migration. As a result we can get unexpected behavior, for example if finish
phase cannot be done due to connectivity problems we have overall migration
error and actual migration success which is odd.
Additionally i think i should rework this patchset to direct migration. As if
we implement p2p scheme this means that managed scheme can be implemented as
well which is not true.
> 2. Offline migration is supported as there is no more dependency
on current
> flow of managed migration scheme.
>
> daemon/remote.c | 30 +++++
> docs/apibuild.py | 1 +
> docs/hvsupport.pl | 1 +
> src/driver-hypervisor.h | 4 +
> src/libvirt-domain.c | 30 +++++
> src/libvirt_internal.h | 2 +
> src/libvirt_private.syms | 1 +
> src/remote/remote_driver.c | 26 +++++
> src/remote/remote_protocol.x | 12 ++-
> src/remote_protocol-structs | 1 +
> src/vz/vz_driver.c | 256 ++++++++++++++++++++++++++++++++++++++++++
> src/vz/vz_sdk.c | 86 ++++++++++++---
> src/vz/vz_sdk.h | 6 +
> src/vz/vz_utils.h | 4 +-
> 14 files changed, 444 insertions(+), 16 deletions(-)