From dc0911d30cdbd0df4905de199edb78f0f188ef8c Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Mon, 23 Sep 2019 17:03:16 -0400 Subject: [PATCH] Log error when volume validation fails during boot from volume If we get an unexpected exception during boot from volume while validating a pre-created volume, we just raise InvalidBDMVolume which might have a misleading error message for why validation failed, e.g. it looks like we couldn't GET the volume but actually it could be something in later validation that fails. This simply logs the error at INFO level for later debugging. We don't log at WARNING or ERROR because it could be due to some user error and operators shouldn't have to worry about warnings/errors in the logs for user-inflicted issues. The INFO log is useful though in diagnosing a failure if the user doesn't understand the failure. Change-Id: I83903593811efe43608826c8e599c8f09c313a3c --- nova/compute/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nova/compute/api.py b/nova/compute/api.py index 07ab71ac29d0..0a50898ae9b2 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1598,7 +1598,9 @@ class API(base.Base): raise except exception.InvalidInput as exc: raise exception.InvalidVolume(reason=exc.format_message()) - except Exception: + except Exception as e: + LOG.info('Failed validating volume %s. Error: %s', + volume_id, e) raise exception.InvalidBDMVolume(id=volume_id) elif snapshot_id is not None: try: