From 5a303994ff30134947769afdc710880837882d6f Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Tue, 24 Oct 2017 17:00:59 +0200 Subject: [PATCH] virsh: Add options for parallel migration Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- tools/virsh-domain.c | 19 +++++++++++++++++++ tools/virsh.pod | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 01aa1bd017..afcd0a5f8d 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10562,6 +10562,14 @@ static const vshCmdOptDef opts_migrate[] = { .type = VSH_OT_INT, .help = N_("post-copy migration bandwidth limit in MiB/s") }, + {.name = "parallel", + .type = VSH_OT_BOOL, + .help = N_("enable parallel migration") + }, + {.name = "parallel-connections", + .type = VSH_OT_INT, + .help = N_("number of connections for parallel migration") + }, {.name = NULL} }; @@ -10767,6 +10775,14 @@ doMigrate(void *opaque) goto save_error; } + if (vshCommandOptInt(ctl, cmd, "parallel-connections", &intOpt) < 0) + goto out; + if (intOpt && + virTypedParamsAddInt(¶ms, &nparams, &maxparams, + VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS, + intOpt) < 0) + goto save_error; + if (vshCommandOptBool(cmd, "live")) flags |= VIR_MIGRATE_LIVE; if (vshCommandOptBool(cmd, "p2p")) @@ -10815,6 +10831,9 @@ doMigrate(void *opaque) if (vshCommandOptBool(cmd, "tls")) flags |= VIR_MIGRATE_TLS; + if (vshCommandOptBool(cmd, "parallel")) + flags |= VIR_MIGRATE_PARALLEL; + if (flags & VIR_MIGRATE_PEER2PEER || vshCommandOptBool(cmd, "direct")) { if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) == 0) ret = '0'; diff --git a/tools/virsh.pod b/tools/virsh.pod index c4ff0c745a..a0fe949c55 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1916,6 +1916,7 @@ I I [I] [I] [I] [I] [I<--auto-converge>] [I] [I] [I<--persistent-xml> B] [I<--tls>] [I<--postcopy-bandwidth> B] +[I<--parallel> [I<--parallel-connections> B]] Migrate domain to another host. Add I<--live> for live migration; <--p2p> for peer-2-peer migration; I<--direct> for direct migration; or I<--tunnelled> @@ -2009,6 +2010,12 @@ Providing I<--tls> causes the migration to use the host configured TLS setup the migration of the domain. Usage requires proper TLS setup for both source and target. +I<--parallel> option will cause migration data to be sent over multiple +parallel connections. The number of such connections can be set using +I<--parallel-connections>. Parallel connections may help with saturating the +network link between the source and the target and thus speeding up the +migration. + Running migration can be canceled by interrupting virsh (usually using C) or by B command sent from another virsh instance.