diff options
author | melanie witt <melwittt@gmail.com> | 2019-05-15 20:51:41 +0000 |
---|---|---|
committer | Lee Yarwood <lyarwood@redhat.com> | 2019-05-21 10:54:28 +0100 |
commit | 0cad3089d3e84e8e3436e171d00c8cce8717fd6d (patch) | |
tree | 15b29be5040f66a820cc35589c6de3d3a99cd91a | |
parent | 51e936fd5f707bf9a39ab5375f5ef4883a985413 (diff) | |
download | nova-0cad3089d3e84e8e3436e171d00c8cce8717fd6d.tar.gz |
Stop logging traceback when skipping quiesce
During snapshot of a volume-backed instance, we attempt to quiesce the
instance before doing the snapshot. If quiesce is not supported or the
qemu guest agent is not enabled, we will skip the quiesce and move on
to the snapshot.
Because quiesce is a call to nova-compute over RPC, when the libvirt
driver raises QemuGuestAgentNotEnabled, oslo.messaging will append the
full traceback to the exception message [1] for the remote caller. So,
a LOG.info(..., exp) log of the exception object will result in a log
of the full traceback. Logging of the full traceback causes confusion
for those debugging CI failures.
We would rather not log the full traceback in this case where we are
catching the exception and emitting an INFO message, so we should use
exp.format_message() instead of oslo.messaging's __str__ override.
[1] https://github.com/openstack/oslo.messaging/blob/40c25c2/oslo_messaging/_drivers/common.py#L212
Related-Bug: #1824315
Change-Id: Ibfedcb8814437c53081f5a2993ab84b25d73e557
(cherry picked from commit 66070416ab670daf4734f2c30ad2df5d96e615e6)
(cherry picked from commit 2f7b1031a9b80d15052fcd9b22831f1db0486a4a)
(cherry picked from commit b9caf7d9c7423a658c837aaedb7c4fb3580bda47)
-rw-r--r-- | nova/compute/api.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index bc3cc6df95..71a09d63d6 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -2985,10 +2985,15 @@ class API(base.Base): if strutils.bool_from_string(instance.system_metadata.get( 'image_os_require_quiesce')): raise - else: + + if isinstance(err, exception.NovaException): LOG.info('Skipping quiescing instance: %(reason)s.', - {'reason': err}, + {'reason': err.format_message()}, instance=instance) + else: + LOG.info('Skipping quiescing instance because the ' + 'operation is not supported by the underlying ' + 'compute driver.', instance=instance) # NOTE(tasker): discovered that an uncaught exception could occur # after the instance has been frozen. catch and thaw. except Exception as ex: |