| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
🔴 Test Coverage Grade: D — Marginal
Grade Scale
|
Sorry, something went wrong.
| fetchData () { | ||
| this.loading = true | ||
| if (this.resource.size != null) { | ||
| this.form.size = Math.round(this.resource.size / (1024 * 1024 * 1024)) |
There was a problem hiding this comment.
use % instead Math round
Sorry, something went wrong.
There was a problem hiding this comment.
can you update the code as discussed over chat, to remove the Math-round method call. we can get it merged.
Sorry, something went wrong.
There was a problem hiding this comment.
remove the math.round for size calculation.
In cloudstack, long is used everwhere for size as it has bytes on backend but double is not applicable for bytes.
In disk offering, it is highly unlikely that conversion comes as double bcz UI itself restricts
Sorry, something went wrong.
🔴 Test Coverage Grade: D — Marginal
Grade Scale
|
Sorry, something went wrong.
### Description On Resize Volume, the form did not show the volume’s current size and IOPS. It also used the first disk offering in the list, not the offering already attached to the volume. So the dialog often opened empty or with the wrong IOPS fields, and a resize could send the wrong values. Root cause Three UI issues in fetchData(): Size unit — the API stores size in bytes. The form label is GB. Size was never copied onto the form, so the GB field stayed empty. Wrong offering — the code always used this.offerings[0] (first offering returned by listDiskOfferings), not this.resource.diskofferingid (the volume’s offering). Custom size / custom IOPS flags could be wrong. IOPS not filled — even when min/max IOPS existed on the volume, they were not copied into form.miniops / form.maxiops. Steps to reproduce Create a volume with a custom IOPS disk offering (for example min 2000, max 5000) and a known size (for example 20 GB). Open Storage → Volumes → Resize. Check the Size (GB) field and the Min/Max IOPS fields. <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. --> <!-- For new features, provide link to FS, dev ML discussion etc. --> <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. --> <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged --> <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" --> <!-- Fixes: # --> <!--- ******************************************************************************* --> <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. --> <!--- PLEASE PUT AN 'X' in only **ONE** box --> <!--- ******************************************************************************* --> ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] 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 - [ ] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): Before Fix: <img width="533" height="353" alt="image" src="https://github.com/user-attachments/assets/ccfc698e-501c-442e-a7b2-9582dc2a53ba" /> After Fix: <img width="528" height="472" alt="image" src="https://github.com/user-attachments/assets/5125bb21-9b9b-4e48-a9bc-8d5eaef07118" /> ### How Has This Been Tested? Tested with both Fix and Custom IOPS: 1- Resize Shows IOPS value for custom IOPS not for fix, along with size 2- Exact 20 GB volume → shows as 20 float 20.1 -> shows on UI as 20 #### How did you try to break this feature and the system with this change? <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
…#14262) * [CCS-5] Volume Resize Fix for IOPS and Size (#106) ### Description On Resize Volume, the form did not show the volume’s current size and IOPS. It also used the first disk offering in the list, not the offering already attached to the volume. So the dialog often opened empty or with the wrong IOPS fields, and a resize could send the wrong values. Root cause Three UI issues in fetchData(): Size unit — the API stores size in bytes. The form label is GB. Size was never copied onto the form, so the GB field stayed empty. Wrong offering — the code always used this.offerings[0] (first offering returned by listDiskOfferings), not this.resource.diskofferingid (the volume’s offering). Custom size / custom IOPS flags could be wrong. IOPS not filled — even when min/max IOPS existed on the volume, they were not copied into form.miniops / form.maxiops. Steps to reproduce Create a volume with a custom IOPS disk offering (for example min 2000, max 5000) and a known size (for example 20 GB). Open Storage → Volumes → Resize. Check the Size (GB) field and the Min/Max IOPS fields. <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. --> <!-- For new features, provide link to FS, dev ML discussion etc. --> <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. --> <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged --> <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" --> <!-- Fixes: # --> <!--- ******************************************************************************* --> <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. --> <!--- PLEASE PUT AN 'X' in only **ONE** box --> <!--- ******************************************************************************* --> ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] 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 - [ ] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): Before Fix: <img width="533" height="353" alt="image" src="https://github.com/user-attachments/assets/ccfc698e-501c-442e-a7b2-9582dc2a53ba" /> After Fix: <img width="528" height="472" alt="image" src="https://github.com/user-attachments/assets/5125bb21-9b9b-4e48-a9bc-8d5eaef07118" /> ### How Has This Been Tested? Tested with both Fix and Custom IOPS: 1- Resize Shows IOPS value for custom IOPS not for fix, along with size 2- Exact 20 GB volume → shows as 20 float 20.1 -> shows on UI as 20 #### How did you try to break this feature and the system with this change? <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com> * Resize Upstream PR Review Comment (#124) Root Volume created with custom IOPS and not overridden by the custom disk offering should also show the min and max IOPS on form <!--- ******************************************************************************* --> <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. --> <!--- PLEASE PUT AN 'X' in only **ONE** box --> <!--- ******************************************************************************* --> - [ ] 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 - [ ] Test (unit or integration test code) - [x] Major - [ ] Minor - [ ] BLOCKER - [ ] Critical - [x] Major - [ ] Minor - [ ] Trivial <img width="655" height="529" alt="image" src="https://github.com/user-attachments/assets/335b1c6c-e979-4976-a7a3-1c1b52f535e7" /> <img width="526" height="407" alt="image" src="https://github.com/user-attachments/assets/76a5e0e5-ec23-4b0f-96ea-ee43c81cfa44" /> <img width="599" height="460" alt="image" src="https://github.com/user-attachments/assets/923c44a5-b53f-452f-944c-73ef3c75d804" /> 1- Created a Fix IOPS Offering of compute/disk and use to create VM/Volume, resize should not show min max IOPS - success 2- Created a Custom IOPS Offering of compute/disk and use to create VM/Volume, resize should show min max IOPS - success change? <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com> * [CSTACKEX-368] Resize Form Size issue fix --------- Co-authored-by: Gupta, Surya <Surya.Gupta@netapp.com>
| Back | FazBrowse Home | New Git URL |
Description
On Resize Volume, the form did not show the volume’s current size and IOPS. It also used the first disk offering in the list, not the offering already attached to the volume.
So the dialog often opened empty or with the wrong IOPS fields, and a resize could send the wrong values.
Root cause
Three UI issues in fetchData():
Size unit — the API stores size in bytes. The form label is GB. Size was never copied onto the form, so the GB field stayed empty.
Wrong offering — the code always used this.offerings[0] (first offering returned by listDiskOfferings), not this.resource.diskofferingid (the volume’s offering). Custom size / custom IOPS flags could be wrong.
IOPS not filled — even when min/max IOPS existed on the volume, they were not copied into form.miniops / form.maxiops.
Steps to reproduce
Create a volume with a custom IOPS disk offering (for example min 2000, max 5000) and a known size (for example 20 GB).
Open Storage → Volumes → Resize.
Check the Size (GB) field and the Min/Max IOPS fields.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
Before Fix:

After Fix:

How Has This Been Tested?
Tested with both Fix and Custom IOPS:
1- Resize Shows IOPS value for custom IOPS not for fix, along with size
2- Exact 20 GB volume → shows as 20
float 20.1 -> shows on UI as 20
How did you try to break this feature and the system with this change?