sudo87 opened a new pull request, #10560:
URL: https://github.com/apache/cloudstack/pull/10560

   ### 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
   
   1. DeployVMCmd
   ```
   deploy virtualmachine name=test-vm 
templateid=e6962fb7-fa6f-11ef-86b8-50eb71576f75 
serviceofferingid=8fcc7ba4-298c-4c21-b5f6-c3c4e1d2afe7 leaseduration=10 
leaseexpiryaction=STOP zoneid=988db21e-ffc9-4708-9546-797cb7592cb9
   ```
   2. CreateServiceOfferingCmd
   ```
   create serviceoffering name=cmd-lease leaseduration=10 leaseexpiryaction=STOP
   ```
   3. UpdateVMCmd
   ```
   update virtualmachine id=e22a2b2b-66c0-4566-9648-ec3219dbcb96 
leaseduration=-1
   ```
   
   Valid values for 
   leaseduration: positive number and -1 (special, to allow removing lease from 
instance)
   leaseexpiryaction: STOP | DESTROY
   
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- 
******************************************************************************* 
-->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
******************************************************************************* 
-->
   
   ### 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):
   ![Screenshot from 2025-03-10 
11-54-08](https://github.com/user-attachments/assets/16a5d980-ccd3-4d60-8ecd-edc011a0102a)
   ![Screenshot from 2025-03-10 
11-54-03](https://github.com/user-attachments/assets/87af12b1-cb76-4b0e-8c4a-51c291c88f97)
   ![Screenshot from 2025-03-10 
11-53-47](https://github.com/user-attachments/assets/7457f28b-bc64-4ab2-8718-a4156096673f)
   ![Screenshot from 2025-03-10 
11-53-07](https://github.com/user-attachments/assets/59c7c3b9-b91e-4a66-84fa-42ae82ca5b44)
   ![Screenshot from 2025-03-10 
11-52-45](https://github.com/user-attachments/assets/51bd9ba8-2d13-41eb-a9f7-fd2d8a09fad5)
   ![Screenshot from 2025-03-10 
11-52-33](https://github.com/user-attachments/assets/b563b5b4-ee6b-4416-a448-3312d9dd8605)
   ![Screenshot from 2025-03-10 
11-52-27](https://github.com/user-attachments/assets/dd618b1c-06f7-49c2-bd9d-3adb8aba5e9e)
   ![Screenshot from 2025-03-10 
11-51-58-1](https://github.com/user-attachments/assets/45fbcc9f-8e1d-4356-977b-95177a722730)
   ![Screenshot from 2025-03-10 
11-51-58](https://github.com/user-attachments/assets/03d02063-7231-40c1-8f10-201c4f925637)
   ![Screenshot from 2025-03-10 
11-51-19](https://github.com/user-attachments/assets/8810c8e3-e076-40ee-a15c-ae720c85cef9)
   ![Screenshot from 2025-03-10 
11-50-58](https://github.com/user-attachments/assets/21afc902-2f9b-46bd-bd63-d1712af6db45)
   ![Screenshot from 2025-03-10 
11-50-43](https://github.com/user-attachments/assets/25d7fb5d-a1db-4241-9ce6-7375486ebd34)
   ![Screenshot from 2025-03-10 
11-50-30](https://github.com/user-attachments/assets/cb9e803b-da4c-4cc7-a4de-c805c2766948)
   
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to 
-->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to