diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 02a79912404..c8c38e56c49 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -193,6 +193,8 @@ MIN_IOPS = 100 MAX_IOPS = 100000000 # 100M MIN_BWS = 1048576 # 1 MB/s MAX_BWS = 549755813888 # 512 GB/s +ONE_HOUR = 3600000 +THIRTY_SEC = 30000 TAG_NAMESPACE = "openstack-integration.purestorage.com" @@ -1435,11 +1437,29 @@ class PureBaseVolumeDriver(san.SanDriver): """Set self._stats with relevant information.""" current_array = self._get_current_array() space_info = list(current_array.get_arrays_space().items)[0] - perf_info = list(current_array.get_arrays_performance( + perf_data = current_array.get_arrays_performance( end_time=int(time.time()) * 1000, - start_time=(int(time.time()) * 1000) - 30000, - resolution=30000 - ).items)[0] + start_time=(int(time.time()) * 1000) - ONE_HOUR, + resolution=THIRTY_SEC, + total_item_count=True + ) + if perf_data.total_item_count != 0: + perf_info = list(perf_data.items)[0] + else: + class _ZeroPerf: + writes_per_sec = 0 + reads_per_sec = 0 + write_bytes_per_sec = 0 + read_bytes_per_sec = 0 + usec_per_read_op = 0 + usec_per_write_op = 0 + queue_depth = 0 + queue_usec_per_mirrored_write_op = 0 + queue_usec_per_read_op = 0 + queue_usec_per_write_op = 0 + perf_info = _ZeroPerf() + LOG.warning("No performance samples returned from array for the " + "requested interval; reporting zeroed metrics.") hosts = list(current_array.get_hosts().items) volumes = list(current_array.get_volumes().items) snaps = list(current_array.get_volume_snapshots().items) diff --git a/releasenotes/notes/pure_perf_error-ed042fa2d16cd3ed.yaml b/releasenotes/notes/pure_perf_error-ed042fa2d16cd3ed.yaml new file mode 100644 index 00000000000..a1d128bc8d4 --- /dev/null +++ b/releasenotes/notes/pure_perf_error-ed042fa2d16cd3ed.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + [Pure Storage] `bug #2123855 `_: Fixed