This is an automated email from the ASF dual-hosted git repository.
nvazquez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new 58fda71275e Recalculate the allocated size in bytes for each Object
Storage provider (#14679)
58fda71275e is described below
commit 58fda71275e913c872942979e21ef9c84f8d2a85
Author: Bernardo De Marco Gonçalves <[email protected]>
AuthorDate: Thu Nov 26 11:14:19 2026 -0300
Recalculate the allocated size in bytes for each Object Storage provider
(#14679)
---
.../src/main/resources/META-INF/db/schema-42300to2400.sql | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql
b/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql
index 79dfeed38f3..fe4a6aa3ffa 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql
@@ -294,3 +294,13 @@ WHERE sp.`storage_provider_name` = 'NetApp ONTAP'
-- Rename persisted FlashArray provider name (plugin getName() changed from
'Flash Array' to 'FlashArray')
UPDATE `cloud`.`storage_pool` SET `storage_provider_name` = 'FlashArray' WHERE
`storage_provider_name` = 'Flash Array';
+
+--- Recalculate the allocated size in bytes for each Object Storage provider
+UPDATE `cloud`.`object_store`
+JOIN (
+ SELECT object_store_id, SUM(quota) * 1024 * 1024 * 1024 AS total_quota
+ FROM `cloud`.`bucket`
+ WHERE removed IS NULL
+ GROUP BY object_store_id
+) buckets_quota_sum_view ON `object_store`.id =
buckets_quota_sum_view.object_store_id
+SET `object_store`.allocated_size = buckets_quota_sum_view.total_quota;