BryanMLima opened a new pull request, #8591:
URL: https://github.com/apache/cloudstack/pull/8591

   ### Description
   
   The PR #7152 changed the unit of the Quota types `VM_DISK_IO_READ`, 
`VM_DISK_IO_WRITE`, `VM_DISK_BYTES_READ` and `VM_DISK_BYTES_WRITE`. However, 
the pre-populated tariffs were not considered, and their unit type is still 
with the old value. The unit was only displayed incorrectly, as the calculation 
utilizes the correct unit. Their unit types were updated to the correct ones.
   
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   ### How Has This Been Tested?
   
   <details><summary>Update script</summary>
   
   ```log
   2024-01-31 20:51:49,518 INFO  [c.c.u.DatabaseUpgradeChecker] (main:null) 
(logid:) DB version = 4.18.1.0 Code Version = 4.18.2.0
   2024-01-31 20:51:49,519 INFO  [c.c.u.DatabaseUpgradeChecker] (main:null) 
(logid:) Database upgrade must be performed from 4.18.1.0 to 4.18.2.0
   2024-01-31 20:51:49,556 DEBUG [c.c.u.DatabaseUpgradeChecker] (main:null) 
(logid:) Running upgrade Upgrade41810to41820 to upgrade from 4.18.1.0-4.18.2.0 
to 4.18.2.0
   2024-01-31 20:51:49,565 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
Licensed to the Apache Software Foundation (ASF) under one
   2024-01-31 20:51:49,566 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
or more contributor license agreements.  See the NOTICE file
   2024-01-31 20:51:49,566 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
distributed with this work for additional information
   2024-01-31 20:51:49,566 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
regarding copyright ownership.  The ASF licenses this file
   2024-01-31 20:51:49,567 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
to you under the Apache License, Version 2.0 (the
   2024-01-31 20:51:49,567 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
"License"); you may not use this file except in compliance
   2024-01-31 20:51:49,567 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
with the License.  You may obtain a copy of the License at
   2024-01-31 20:51:49,567 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --
   2024-01-31 20:51:49,567 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
  http://www.apache.org/licenses/LICENSE-2.0
   2024-01-31 20:51:49,568 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --
   2024-01-31 20:51:49,568 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
Unless required by applicable law or agreed to in writing,
   2024-01-31 20:51:49,568 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
software distributed under the License is distributed on an
   2024-01-31 20:51:49,569 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   2024-01-31 20:51:49,570 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
KIND, either express or implied.  See the License for the
   2024-01-31 20:51:49,570 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
specific language governing permissions and limitations
   2024-01-31 20:51:49,570 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
under the License.
   2024-01-31 20:51:49,570 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --;
   2024-01-31 20:51:49,571 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
Schema upgrade from 4.18.1.0 to 4.18.2.0
   2024-01-31 20:51:49,571 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --;
   2024-01-31 20:51:49,571 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
Updates the populated Quota tariff's types VM_DISK_BYTES_READ, 
VM_DISK_BYTES_WRITE, VM_DISK_IO_READ and VM_DISK_IO_WRITE to the correct unit.
   2024-01-31 20:51:49,572 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
UPDATE cloud_usage.quota_tariff SET usage_unit = 'Bytes', updated_on = NOW() 
WHERE effective_on = '2010-05-04 00:00:00' AND name IN ('VM_DISK_BYTES_READ', 
'VM_DISK_BYTES_WRITE') 
   2024-01-31 20:51:49,575 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
UPDATE cloud_usage.quota_tariff SET usage_unit = 'IOPS', updated_on = NOW() 
WHERE effective_on = '2010-05-04 00:00:00' AND name IN ('VM_DISK_IO_READ', 
'VM_DISK_IO_WRITE') 
   2024-01-31 20:51:49,660 INFO  [c.c.u.DatabaseUpgradeChecker] (main:null) 
(logid:) Cleanup upgrade Upgrade41810to41820 to upgrade from 4.18.1.0-4.18.2.0 
to 4.18.2.0
   2024-01-31 20:51:49,668 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
Licensed to the Apache Software Foundation (ASF) under one
   2024-01-31 20:51:49,668 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
or more contributor license agreements.  See the NOTICE file
   2024-01-31 20:51:49,668 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
distributed with this work for additional information
   2024-01-31 20:51:49,668 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
regarding copyright ownership.  The ASF licenses this file
   2024-01-31 20:51:49,668 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
to you under the Apache License, Version 2.0 (the
   2024-01-31 20:51:49,669 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
"License"); you may not use this file except in compliance
   2024-01-31 20:51:49,669 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
with the License.  You may obtain a copy of the License at
   2024-01-31 20:51:49,669 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --
   2024-01-31 20:51:49,669 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
  http://www.apache.org/licenses/LICENSE-2.0
   2024-01-31 20:51:49,670 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --
   2024-01-31 20:51:49,670 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
Unless required by applicable law or agreed to in writing,
   2024-01-31 20:51:49,670 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
software distributed under the License is distributed on an
   2024-01-31 20:51:49,670 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   2024-01-31 20:51:49,671 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
KIND, either express or implied.  See the License for the
   2024-01-31 20:51:49,671 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
specific language governing permissions and limitations
   2024-01-31 20:51:49,671 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
under the License.
   2024-01-31 20:51:49,671 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --;
   2024-01-31 20:51:49,672 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) -- 
Schema upgrade cleanup from 4.18.1.0 to 4.18.2.0
   2024-01-31 20:51:49,672 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) --;
   2024-01-31 20:51:49,675 DEBUG [c.c.u.DatabaseUpgradeChecker] (main:null) 
(logid:) Cleanup script Upgrade41810to41820 is executed successfully
   2024-01-31 20:51:49,737 DEBUG [c.c.u.DatabaseUpgradeChecker] (main:null) 
(logid:) Upgrade completed for version 4.18.2.0
   ```
   </details>
   
   After the update script, the usage units were updated accordingly.
   
   
|id|usage_type|usage_name|usage_unit|usage_discriminator|currency_value|effective_on|updated_on|updated_by|uuid|name|description|activation_rule|removed|end_date|
   
|--|----------|----------|----------|-------------------|--------------|------------|----------|----------|----|----|-----------|---------------|-------|--------|
   |18|21|VM_DISK_IO_READ|IOPS|1|0.00000|2010-05-04 00:00:00|2024-01-31 
20:51:49|1|9f3f2dc7-771e-11ee-8e59-5254003754dc|VM_DISK_IO_READ|||||
   |19|22|VM_DISK_IO_WRITE|IOPS|1|0.00000|2010-05-04 00:00:00|2024-01-31 
20:51:49|1|9f3f2ead-771e-11ee-8e59-5254003754dc|VM_DISK_IO_WRITE|||||
   |20|23|VM_DISK_BYTES_READ|Bytes|1|0.00000|2010-05-04 00:00:00|2024-01-31 
20:51:49|1|9f3f2f84-771e-11ee-8e59-5254003754dc|VM_DISK_BYTES_READ|||||
   |21|24|VM_DISK_BYTES_WRITE|Bytes|1|0.00000|2010-05-04 00:00:00|2024-01-31 
20:51:49|1|9f3f304f-771e-11ee-8e59-5254003754dc|VM_DISK_BYTES_WRITE|||||
   
   
   #### How did you try to break this feature and the system with this change?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to