From 5c26e504d0a13961c4c37a04160238fbab717483 Mon Sep 17 00:00:00 2001 From: zhaoleilc <15247232416@163.com> Date: Thu, 6 May 2021 16:22:34 +0800 Subject: Erroneous log message args location causes a misconception This patch modifies log message args location so that the log message can report free space correctly. stable/xena: - Two small follow-up patches that fix minor issues are squashed into this patch: I41080795cc1c3c91de1e35d6d6eba3f05068b26e fixes a bug, and I6976569ac3617cc247a4c39f786ece8443d43d0b fixes a typo in the release note. - Backporting this patch facilitates backporting the patch that fixes capacity calculations. Change-Id: Idcaf657692c2597887476ec1834d790f39b1fe94 (cherry picked from commit 4efd313d419253f5c3718867f17b8d229b3c2df8) (cherry picked from commit fc7cf4a598cfe8b96d6235d7495759d54c36e697) --- cinder/scheduler/filters/capacity_filter.py | 9 +++------ ...bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml diff --git a/cinder/scheduler/filters/capacity_filter.py b/cinder/scheduler/filters/capacity_filter.py index 1661d16f4..d1eb7fb7b 100644 --- a/cinder/scheduler/filters/capacity_filter.py +++ b/cinder/scheduler/filters/capacity_filter.py @@ -155,16 +155,13 @@ class CapacityFilter(filters.BaseBackendFilter): # of reserved space) which we can over-subscribe. adjusted_free_virtual = ( free * backend_state.max_over_subscription_ratio) + msg_args["available"] = adjusted_free_virtual res = adjusted_free_virtual >= requested_size if not res: - msg_args = {"available": adjusted_free_virtual, - "size": requested_size, - "grouping": grouping, - "grouping_name": backend_state.backend_id} LOG.warning("Insufficient free virtual space " "(%(available)sGB) to accommodate thin " - "provisioned %(size)sGB volume on %(grouping)s" - " %(grouping_name)s.", msg_args) + "provisioned %(requested)sGB volume on " + "%(grouping)s %(grouping_name)s.", msg_args) else: LOG.debug("Space information for volume creation " "on %(grouping)s %(grouping_name)s " diff --git a/releasenotes/notes/bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml b/releasenotes/notes/bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml new file mode 100644 index 000000000..fef5eaa7a --- /dev/null +++ b/releasenotes/notes/bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + `Bug #1953168 `_: Fixed + missing parameter in the capacity filter log message. -- cgit v1.2.1