From 31ae9e62838aac53892fefdccd9b34d28abe153e Mon Sep 17 00:00:00 2001 From: Simon Dodsley Date: Fri, 29 Nov 2024 14:10:56 -0500 Subject: [PATCH] [Pure Storge] Ensure correct provisioned space value is used With the development of the Evergreen//One consumption model for FlashArrays the ``total_provisioned`` value is no longer supplied for arrays using this consumption model. Instead we will use the closest EG1 parameter which is ``used_provisioned``. Closes-bug: #2090310 Change-Id: I65b80a9c370fa53b0bf124a94b8bae452f9c29ab --- cinder/volume/drivers/pure.py | 11 +++++++++-- .../pure_evergreen_one_model-0533b91fb096c468.yaml | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/pure_evergreen_one_model-0533b91fb096c468.yaml diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 53a621f2a82..1aaf9602acf 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -1081,8 +1081,15 @@ class PureBaseVolumeDriver(san.SanDriver): total_capacity = float(space_info.capacity) / units.Gi used_space = float(space_info.space.total_physical) / units.Gi free_space = float(total_capacity - used_space) - provisioned_space = float(space_info.space. - total_provisioned) / units.Gi + # If array uses Evergreen/One model then total_provisioned + # is not reported so use the closest value avaible in that + # consumption model + try: + provisioned_space = float(space_info.space. + total_provisioned) / units.Gi + except AttributeError: + provisioned_space = float(space_info.space. + used_provisioned) / units.Gi total_reduction = float(space_info.space.total_reduction) total_vols = len(volumes) total_hosts = len(hosts) diff --git a/releasenotes/notes/pure_evergreen_one_model-0533b91fb096c468.yaml b/releasenotes/notes/pure_evergreen_one_model-0533b91fb096c468.yaml new file mode 100644 index 00000000000..64f1bf9d648 --- /dev/null +++ b/releasenotes/notes/pure_evergreen_one_model-0533b91fb096c468.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + `Bug #2090310 `_: + [Pure Storage] Fixed issue with FlashArray using the Evergreen//One + consumption model not reporting ``total_provisioned``. Used + ``used_provisoned`` instead in this case.