Drop snapshot in use log from ERROR to WARN

This message is not actually an error inside the system for most of the
time.  The primary reason behind this is that it is possible that there
are VMs using this image and therefore it can't be deleted, the operator
has no actionable thing to do about this.

For those who are monitoring ERROR level messages and alerting on them,
this is noisy and not actionable, drop this error message to warning.

Change-Id: If5447c3f5b4f678943273c2bdb2e44cd25d5b226
This commit is contained in:
Mohammed Naser 2020-08-28 13:14:19 -04:00
parent f076e7e426
commit 5aa2bc7af6
1 changed files with 6 additions and 6 deletions

View File

@ -463,26 +463,26 @@ class Store(driver.Store):
{'snap_exc': exc})
LOG.debug(msg)
except rbd.ImageBusy as exc:
log_msg = (_LE("Snap Operating Exception "
log_msg = (_LW("Snap Operating Exception "
"%(snap_exc)s "
"Snapshot is in use.") %
{'snap_exc': exc})
LOG.error(log_msg)
LOG.warning(log_msg)
raise exceptions.InUseByStore()
# Then delete image.
rbd.RBD().remove(ioctx, image_name)
except rbd.ImageHasSnapshots:
log_msg = (_LE("Remove image %(img_name)s failed. "
log_msg = (_LW("Remove image %(img_name)s failed. "
"It has snapshot(s) left.") %
{'img_name': image_name})
LOG.error(log_msg)
LOG.warning(log_msg)
raise exceptions.HasSnapshot()
except rbd.ImageBusy:
log_msg = (_LE("Remove image %(img_name)s failed. "
log_msg = (_LW("Remove image %(img_name)s failed. "
"It is in use.") %
{'img_name': image_name})
LOG.error(log_msg)
LOG.warning(log_msg)
raise exceptions.InUseByStore()
except rbd.ImageNotFound:
msg = _("RBD image %s does not exist") % image_name