Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- docs/manpages/virsh.rst | 12 ++++++++++++ tools/virsh-domain.c | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index e801037c04..bf0436621b 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -3407,6 +3407,7 @@ migrate [--parallel [--parallel-connections connections]] [--bandwidth bandwidth] [--tls-destination hostname] [--disks-uri URI] [--copy-storage-synchronous-writes] + [--available-switchover-bandwidth bandwidth] Migrate domain to another host. Add *--live* for live migration; <--p2p> for peer-2-peer migration; *--direct* for direct migration; or *--tunnelled* @@ -3663,6 +3664,17 @@ the context of the existing socket because it is different from the file representation of the socket and the context is chosen by its creator (usually by using *setsockcreatecon{,_raw}()* functions). +Optional *--available-switchover-bandwidth* overrides the automatically +computed bandwidth (in MiB/s) available for the final phase of (pre-copy) +migration during which CPUs are stopped and all the remaining memory and device +state is transferred. Knowing this bandwidth is important for accurate +estimation of the domain downtime and deciding the right moment for switching +over. Normally this would be estimated based on the bandwidth used by +migration, but this could be lower than the actual available bandwidth. Using +this option may help with migration convergence when the migration would keep +iterating over and over thinking there's not enough bandwidth to comply with +the configured maximum downtime. + migrate-compcache ----------------- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 546db955a9..1280ace36b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10788,6 +10788,10 @@ static const vshCmdOptDef opts_migrate[] = { .type = VSH_OT_INT, .help = N_("compress level for zstd compression") }, + {.name = "available-switchover-bandwidth", + .type = VSH_OT_INT, + .help = N_("bandwidth (in MiB/s) available for the final phase of migration") + }, {.name = NULL} }; @@ -11114,6 +11118,15 @@ doMigrate(void *opaque) } } + if ((rv = vshCommandOptULongLong(ctl, cmd, "available-switchover-bandwidth", &ullOpt)) < 0) { + goto out; + } else if (rv > 0) { + if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_BANDWIDTH_AVAIL_SWITCHOVER, + ullOpt) < 0) + goto save_error; + } + out: #ifndef WIN32 pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); -- 2.48.1