virsh migrate: Add --available-switchover-bandwidth option

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jiri Denemark 2025-01-23 10:25:10 +01:00
parent c417ebf660
commit 4bd103dde6
2 changed files with 25 additions and 0 deletions

View File

@ -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
-----------------

View File

@ -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}
};
@ -11102,6 +11106,15 @@ doMigrate(void *opaque)
VIR_MIGRATE_PARAM_TLS_DESTINATION, opt) < 0)
goto save_error;
if ((rv = vshCommandOptULongLong(ctl, cmd, "available-switchover-bandwidth", &ullOpt)) < 0) {
goto out;
} else if (rv > 0) {
if (virTypedParamsAddULLong(&params, &nparams, &maxparams,
VIR_MIGRATE_PARAM_BANDWIDTH_AVAIL_SWITCHOVER,
ullOpt) < 0)
goto save_error;
}
if (flags & VIR_MIGRATE_PEER2PEER || vshCommandOptBool(cmd, "direct")) {
if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) == 0)
data->ret = 0;