From 767aaad1adab9360a42f915ea43beda093534c04 Mon Sep 17 00:00:00 2001 From: Hemna Date: Tue, 15 Mar 2022 08:45:14 -0400 Subject: [PATCH] [SAP] Replace CapacityFilter This patch reworks the CapacityFilter which uses the new utils.calculate_capacity_factors to determine if the virtual free space available. The main issue is that the vmware driver does lazy creates. This causes an issue of over reporting of free space by the backend, because the space hasn't been consumed yet. So the amount of free space is not accurate with respect to how much has been allocated by cinder. This updated calculate capacity factors as well as the SAPCapacityFilter accounts for the virtual free space by using the cinder allocated capacity tracking. If the free space is reported less than what cinder thinks should be available, then the reported free space is used. This relies on an acurate reporting of the allocated capacity by the driver. We know there is an issue with allocated capacity not being reported correctly for migrated volumes, as well as accounting for existing volumes at startup. The startup issue should be solved with this PR: https://github.com/sapcc/cinder/pull/117 Will have to do a folllow up to account for updating the allocated capacity for migrated volumes. --- cinder/scheduler/filters/capacity_filter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cinder/scheduler/filters/capacity_filter.py b/cinder/scheduler/filters/capacity_filter.py index 372a890825e..38c3550c5fe 100644 --- a/cinder/scheduler/filters/capacity_filter.py +++ b/cinder/scheduler/filters/capacity_filter.py @@ -181,9 +181,9 @@ def backend_passes(self, backend_state, filter_properties): if not res: LOG.warning("Insufficient free virtual space " "(%(available)sGB) to accommodate thin " - "provisioned %(requested)sGB volume on " - "%(grouping)s %(grouping_name)s." - " %(provisioning_type)s).", + "provisioned %(requested)sGB volume on" + " %(grouping)s %(grouping_name)s" + " %(provisioning_type)s.", msg_args) else: LOG.debug("Space information for volume creation "