mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
* FR-248: Instance lease, WIP commit * insert lease expiry into db and use that to filter exiring vms, add asyncjobmanager * Add leaseDuration and leaseExpiryAction in Service offering create flow * Update listVM cmd to allow listing only leased instances * Add methods to fetch instances for which lease is expiring in next days * Changes included: 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 * Update UI screens for leased properties coming from config and service offering * use global lock before running scheduler * Unit tests * Flow changes done in UI based on discussion * Include view changes in schema upgrade files and use feature in various UI elements * Added integration test for vm deployment, UI enhancements for user persona, bug fixes * validate integration tests, minor ui changes and log messages * fix build: moving configkey from setup to test itself * Disable testAlert to unblock build and trim whitespaces in integration tests * Address review comments * Minor changes in EditVM screen * Use ExecutorService instead of Timer and TimerTask * Additional review comments * Incorporate following changes: 1. Execute lease action once on the instance 2. Cancel lease on instance when feature is disabled 3. Relevant events when lease gets disabled, cancelled, executed 4. Disable associating lease after deployment 5. UI elements and flow changes 6. Changes based on feedback from demo * Handle pr review comments * address review comments * move instance.lease.enabled config to VMLeaseManager interface * bug fix in edit instance flow and reject api request for invalid values * max allowed lease is for 100 years * log instance ids for expired instance * Fix config validation for value range and code coverage improvement * fix lease expiry request failures in async * dont use forced: true for StopVmCmd * Update server/src/main/java/org/apache/cloudstack/vm/lease/VMLeaseManager.java Co-authored-by: Vishesh <vishesh92@gmail.com> * handle review comments --------- Co-authored-by: Rohit Yadav <rohityadav89@gmail.com> Co-authored-by: Vishesh <vishesh92@gmail.com>