Simplify validation while creating volume templates via UI
Description
Currently, creating templates for DATADISK volumes is only possible if they have already been part of a VM and are detached. This behavior has been extended so that the volume does not need to be detached and the template can be created as long as the VM is stopped.
Furthermore, the UI allows templates to be created for ROOT volumes in the Allocated state, however, the creation always results in an error as the volume needs to exist in the primary storage for the template creation to be possible. With the changes, this option is no longer available.
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)
- [X] 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
- [X] Minor
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
Screenshots (if appropriate):
How Has This Been Tested?
In the UI, I tried creating a template from a volume in different scenarios:
| N° | VM State | Volume Type | Volume State | Could create the template? |
|---|---|---|---|---|
| 1 | Stopped | ROOT |
Allocated |
No |
| 2 | Stopped | ROOT |
Ready |
Yes |
| 3 | Stopped | DATADISK |
Ready |
Yes |
| 4 | Detached volume | DATADISK |
Ready |
Yes |
| 5 | Running | ROOT |
Ready |
No |
| 6 | Running | DATADISK |
Ready |
No |
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 15.78%. Comparing base (
019f2c6) to head (f24550b). Report is 63 commits behind head on 4.20.
Additional details and impacted files
@@ Coverage Diff @@
## 4.20 #9828 +/- ##
==========================================
Coverage 15.78% 15.78%
- Complexity 12564 12565 +1
==========================================
Files 5627 5627
Lines 492250 492250
Branches 61405 61137 -268
==========================================
Hits 77710 77710
Misses 406066 406066
Partials 8474 8474
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.04% <ø> (ø) |
|
| unittests | 16.60% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@blueorangutan ui
@hsato03 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
UI build failed: :heavy_multiplication_x: (SL-JID-466)
@blueorangutan ui
@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
UI build failed: :heavy_multiplication_x: (SL-JID-469)
UI build: :heavy_multiplication_x: (SL-JID-4051)
@blueorangutan ui
@hsato03 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9828 (QA-JID-477)