Fixes the elapsed time logged during a live migration

Nova doesn’t log the actual time that it is taking to live
migrate an instance but the number of cycles/2 that it does
when checking the migration job. If any operation takes
longer inside the loop, the reported time is wrong.

This behavior can cause some confusion when operators are
debugging issues.

This patch ensures that Nova logs the elapsed time of the
live migration.

Closes-Bug: #1916031
Change-Id: I1d622c28a09ddd2aa7d33fa7057b2f78dcaf97dc
This commit is contained in:
Belmiro Moreira 2021-02-18 12:58:51 +00:00
parent e7aa436dc6
commit f88a8b0c1b
1 changed files with 1 additions and 1 deletions

View File

@ -9311,7 +9311,7 @@ class LibvirtDriver(driver.ComputeDriver):
"(bytes processed=%(processed_disk)d, "
"remaining=%(remaining_disk)d, "
"total=%(total_disk)d).",
{"secs": n / 2, "remaining": remaining,
{"secs": elapsed, "remaining": remaining,
"processed_memory": info.memory_processed,
"remaining_memory": info.memory_remaining,
"total_memory": info.memory_total,