Use max secondary storage defined on the account during upload #7441
Use max secondary storage defined on the account during upload #7441weizhouapache merged 3 commits intoapache:4.18from
Conversation
|
Kudos, SonarCloud Quality Gate passed! |
yadvr
left a comment
There was a problem hiding this comment.
Didn't test or reviewed it, but agree we should definitely do such checks. (pre/post)
DaanHoogland
left a comment
There was a problem hiding this comment.
code looks good, but we have a functional change here.
Before the global setting was a cap on the usage. Now it is just a default. I don´t mind either way but backwards compatibilty dictates that the cap should be lowest of the local and the global configuration.
What do you think @JoaoJandre ?
For the other limits, that is how it currently works, the most specific setting is the one that prevails. For user VMs for example, if you have the global setting at 1 and the account limit at 2, that account will be able to create two accounts. In the VM creation process, the |
stephankruggg
left a comment
There was a problem hiding this comment.
LGTM, manually tested
weizhouapache
left a comment
There was a problem hiding this comment.
code lgtm
@JoaoJandre
can you rebase with 4.18 and change the target branch to 4.18 ?
b59ef2d to
ec05f39
Compare
|
@weizhouapache sorry for the delay, but now it's done :) |
great, thanks |
Codecov Report
@@ Coverage Diff @@
## 4.18 #7441 +/- ##
=========================================
Coverage 13.02% 13.02%
- Complexity 9026 9028 +2
=========================================
Files 2719 2719
Lines 256867 256872 +5
Branches 40051 40050 -1
=========================================
+ Hits 33445 33456 +11
+ Misses 219233 219228 -5
+ Partials 4189 4188 -1
... and 6 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java
Outdated
Show resolved
Hide resolved
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
c4ece0b to
d3d63e2
Compare
|
@blueorangutan package |
|
@kiranchavala a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6616 |
kiranchavala
left a comment
There was a problem hiding this comment.
@JoaoJandre @weizhouapache @DaanHoogland
Under the following scenario, the account limits are not honored
Steps
- Create a user role account
- Set the Max. secondary storage (GiB) to 2 gb at the account level
- Login to the user role account
- Register a iso of size (1.8 gb) from a remote webserver
- Upload a iso of size (1.8 gb) from Local Desktop
- The upload of iso is successful
- The account limit after the upload is
Ideally the upload of the iso should fail as the account limit reached
Normal upload of iso is failing if the account limit is reached and its the expected behavior
- Uploaded a ISOs of 1GiB,
- Upload a second iso of another 1gb
- Upload of third iso and it fails
This PR deals only with upload from local. Therefore problems with registering ISOs are out of scope for this PR. |
@JoaoJandre thanks for the update, I have created a separate issue #7839 to track it |
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM, tested manually and it works fine
Normal upload of iso is failing if the account limit is reached
Steps performed
1.A user role account was created and configured with a max secondary storage limit of 2 GiB.
2.Uploaded a ISOs of 1GiB,
3.Upload a second iso of another 1gb
4.Upload of third iso and it fails
|
thanks for the testing @kiranchavala merging |
* 4.18: server: remove registered userdata when cleanup an account (#7777) server: Use max secondary storage defined on the account during upload (#7441) test: upgrade kubernetes versions to 1.25.0/1.26.0 (#7685) kvm: Added VNI Devices as normal bridge slave devs (#7836) noVNC: fix JP keyboard on vmware7+ which uses websocket URL (#7694)











Description
Currently ACS uses the
max.account.secondary.storagesetting to set the initial secondary storage limit for accounts. However, even after changing the limit for an account, the configuration value is still used to validate the consumption of secondary storage during the upload of volumes, templates and ISOs.This PR makes the limit defined in the account be used in the validation during the upload, instead of the configuration value.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
A user account was created and configured with a max secondary storage limit of 2 GiB, while the
max.account.secondary.storageconfiguration was set to 200GiB.I uploaded two ISOs of 1GiB, and when I tried to upload a third ISO an error of max limit reached was received (which was expected).
I set the
max.account.secondary.storageto 2GiB and set the accounts max secondary storage to 200GiB, then I retried to upload the ISO and everything went ok.