New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api,server: purge expunged resources #8999
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8999 +/- ##
============================================
+ Coverage 15.28% 15.31% +0.03%
- Complexity 11521 11587 +66
============================================
Files 5425 5430 +5
Lines 473992 474909 +917
Branches 59026 58073 -953
============================================
+ Hits 72439 72755 +316
- Misses 393510 394080 +570
- Partials 8043 8074 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Feature PR: apache/cloudstack#8999 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@blueorangutan package |
@shwstppr a [SL] 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 9464 |
@blueorangutan test |
@shwstppr a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian Build Failed (tid-10080) |
@blueorangutan package |
@shwstppr a [SL] 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 9471 |
This PR introduces the functionality of purging removed DB entries for CloudStack entities (currently only for VirtualMachine). There would be three mechanisms for purging removed resources: Background task - CloudStack will run a background task which runs at a defined interval. Other parameters for this task can be controlled with new global settings. API - New admin-only API purgeExpungedResources. It will allow passing the following parameters - resourcetype, batchsize, startdate, enddate. Currently, API is not supported in the UI. Config for service offering. Service offerings can be created with purgeresources parameter which would allow purging resources immediately on expunge. Following new global settings have been added: expunged.resources.purge.enabled: Default: false. Whether to run a background task to purge the expunged resources expunged.resources.purge.resources: Default: (empty). A comma-separated list of resource types that will be considered by the background task to purge the expunged resources. Currently only VirtualMachine is supported. An empty "value will result in considering all resource types for purging expunged.resources.purge.interval: Default: 86400. Interval (in seconds) for the background task to purge the expunged resources expunged.resources.purge.delay: Default: 300. Initial delay (in seconds) to start the background task to purge the expunged resources task. expunged.resources.purge.batch.size: Default: 50. Batch size to be used during expunged resources purging. expunged.resources.purge.start.time: Default: (empty). Start time to be used by the background task to purge the expunged resources. Use format yyyy-MM-dd or yyyy-MM-dd HH:mm:ss. expunged.resources.purge.keep.past.days: Default: 30. The number of days in the past from the execution time of the background task to purge the expunged resources for which the expunged resources must not be purged. To enable purging expunged resource till the execution of the background task, set the value to zero. expunged.resource.purge.job.delay: Default: 180. Delay (in seconds) to execute the purging of an expunged resource initiated by the configuration in the offering. Minimum value should be 180 seconds and if a lower value is set then the minimum value will be used. Documentation PR: apache/cloudstack-documentation#397 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
62df9e1
to
af9d68c
Compare
[SF] Trillian Build Failed (tid-10089) |
@blueorangutan package |
@shwstppr a [SL] 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 9490 |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@blueorangutan test |
@shwstppr a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian Build Failed (tid-10101) |
[SF] Trillian test result (tid-10109)
|
[SF] Trillian test result (tid-10111)
|
[SF] Trillian test result (tid-10110)
|
@blueorangutan test keepEnv |
@shwstppr a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[LL] Trillian Build Failed (tid-6926) |
[SF] Trillian test result (tid-10145)
|
@blueorangutan package |
@shwstppr a [SL] 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 9539 |
@blueorangutan test keepEnv |
@shwstppr a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian Build Failed (tid-10163) |
@blueorangutan test keepEnv |
@shwstppr a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian test result (tid-10165)
|
...src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/cloudstack/api/command/admin/resource/PurgeExpungedResourcesCmd.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/response/ServiceOfferingResponse.java
Outdated
Show resolved
Hide resolved
…ring/CreateServiceOfferingCmd.java Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
…urce/PurgeExpungedResourcesCmd.java Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
…feringResponse.java Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
"format \"yyyy-MM-dd\" or \"yyyy-MM-dd HH:mm:ss\"", true); | ||
ConfigKey<Integer> ExpungedResourcesPurgeKeepPastDays = new ConfigKey<>("Advanced", Integer.class, | ||
"expunged.resources.purge.keep.past.days", "30", | ||
"The number of days in the past from the execution time of the background task to purge " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The number of days in the past from the execution time of the background task to purge " + | |
"The number of days in the past from the execution time of the background task to keep " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the complete sentence makes sense as it is,
The number of days in the past from the execution time of the background task to purge the expunged resources for which the expunged resources must not be purged
If needed, we can rephrase the whole statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
@blueorangutan package |
@shwstppr a [SL] 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 9573 |
Description
Feature spec: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Purge+Expunged+Resources
This PR introduces the functionality of purging removed DB entries for CloudStack entities (currently only for VirtualMachine). There would be three mechanisms for purging removed resources:
purgeExpungedResources
. It will allow passing the following parameters -resourcetype
,batchsize
,startdate
,enddate
. Currently, API is not supported in the UI.purgeresources
parameter which would allow purging resources immediately on expunge.Following new global settings have been added:
expunged.resources.purge.enabled
: Default: false. Whether to run a background task to purge the expunged resourcesexpunged.resources.purge.resources
: Default: (empty). A comma-separated list of resource types that will be considered by the background task to purge the expunged resources. Currently only VirtualMachine is supported. An empty "value will result in considering all resource types for purgingexpunged.resources.purge.interval
: Default: 86400. Interval (in seconds) for the background task to purge the expunged resourcesexpunged.resources.purge.delay
: Default: 300. Initial delay (in seconds) to start the background task to purge the expunged resources task.expunged.resources.purge.batch.size
: Default: 50. Batch size to be used during expunged resources purging.expunged.resources.purge.start.time
: Default: (empty). Start time to be used by the background task to purge the expunged resources. Use formatyyyy-MM-dd
oryyyy-MM-dd HH:mm:ss
.expunged.resources.purge.keep.past.days
: Default: 30. The number of days in the past from the execution time of the background task to purge the expunged resources for which the expunged resources must not be purged. To enable purging expunged resource till the execution of the background task, set the value to zero.expunged.resource.purge.job.delay
: Default: 180. Delay (in seconds) to execute the purging of an expunged resource initiated by the configuration in the offering. Minimum value should be 180 seconds and if a lower value is set then the minimum value will be used.Documentation PR: apache/cloudstack-documentation#397
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?
API usage:
Verified new smoke test,