From 50915b013f1288aa8ed66e06bc9ba90a7d37e1ac Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Thu, 21 Dec 2017 13:50:53 -0500 Subject: [PATCH] libvirt: don't log snapshot success unless it actually happens Because of where this message was in the finally block, it would log that we successfully extracted a snapshot even if we failed, like if _live_snapshot fails because the guest is deleted concurrently during the snapshot process. This moves the info log message into the block of code where we actually know that we successfully extracted the snapshot. Change-Id: Ie12592c2daecbe764fa52dde6b0dafdbcafe102e --- nova/virt/libvirt/driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 7941df5cfb1d..9dd74ab6be14 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -1752,11 +1752,11 @@ class LibvirtDriver(driver.ComputeDriver): image_format, instance.image_meta) else: root_disk.snapshot_extract(out_path, image_format) + LOG.info("Snapshot extracted, beginning image upload", + instance=instance) finally: self._snapshot_domain(context, live_snapshot, virt_dom, state, instance) - LOG.info("Snapshot extracted, beginning image upload", - instance=instance) # Upload that image to the image service update_task_state(task_state=task_states.IMAGE_UPLOADING,