-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Instance lease: Allow deployment of instances with lease duration and leaseexpiry action #10560
base: main
Are you sure you want to change the base?
Conversation
config key setup and configured for alert email lease options in create and update vm screen handle delete protection, edit vm, create vm validated stop and detroy, delete protection
@blueorangutan package |
@sudo87 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]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12761 |
|
||
@Parameter(name = ApiConstants.INSTANCE_LEASE_EXPIRY_ACTION, type = CommandType.STRING, since = "4.21.0", | ||
description = "Lease expiry action") |
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.
Add posible choices in the description.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10560 +/- ##
=============================================
- Coverage 16.15% 3.98% -12.17%
=============================================
Files 5666 398 -5268
Lines 497960 32644 -465316
Branches 60241 5801 -54440
=============================================
- Hits 80459 1302 -79157
+ Misses 408499 31192 -377307
+ Partials 9002 150 -8852
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
@sudo87 build failing with unit tests failure. Please check
} | ||
|
||
@Test | ||
public void testAlert() { |
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.
You may have to mock global config to true
for this case?
Description
This PR enables Administrator to provision Lease based instances, which will self destroyed or stopped once lease is over. This will improve efficient utilization of cloud infrastructure.
Feature can be enabled by updating value for following key to true:
instance.lease.enabled: true
default: false
There are additional configuration keys:
instance.lease.scheduler.interval: when scheduler will run to execute expiryaction, default value: 86400 (seconds)
instance.lease.alertscheduler.interval: alert scheduler interval, sends alerts for any instance which are about to expire in next 7 days (default: 86400)
Feature introduces new parameters in following APIs:
leaseduration: duration in days for which instance is provisioned
leaseexpiryaction: action will be executed once expiry is over
Valid values for
leaseduration: positive number and -1 (special, to allow removing lease from instance)
leaseexpiryaction: STOP | DESTROY
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?