Skip to content

Commit 464974c

Browse files
committed
Documentation related to Instance lease feature
1 parent 8149c09 commit 464974c

File tree

6 files changed

+132
-0
lines changed

6 files changed

+132
-0
lines changed
Loading
Loading
Loading
47.2 KB
Loading

source/adminguide/service_offerings.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,31 @@ To create a new compute offering:
401401
- **Disk Offering Strictness**: This flag defines the strictness of the disk offering association
402402
with the compute offering. When set to true, overriding of disk offering is not allowed on deploy instance
403403
and change disk offering is not allowed for the ROOT disk
404+
405+
- **Enable Lease**: When this flag is enabled, compute offering is created with lease related metadata.
406+
In CloudStack, a lease represents the specific duration for which an instance is allocated.
407+
The user rents these resources for the duration of the lease. Once the lease period expires, instance may be stopped or destroyed.
408+
Lease information is inherited from compute offering and gets associated to Instance.
409+
410+
When the flag is enabled
411+
412+
- **Lease Duration (in days)**: Creates a compute offering with Lease duration. Instance created from this compute offering will inherit lease duration by default.
413+
414+
- **Lease expiry action**: Denotes lease expiry action, which gets executed upon lease expiry for instances created from compute offering.
415+
Suported values for lease expiry action are as follows:
416+
- STOP
417+
- DESTROY
418+
419+
.. image:: /_static/images/compute_offering_dailog_with_lease.png
420+
:width: 400px
421+
:align: center
422+
:alt: Compute offering dialog box
423+
424+
.. note:: The following global configuration should be configured as true to create compute offering with lease:
425+
``instance.lease.enabled``: Indicates whether Instance Lease feature is enabled or not. Default is **false**
426+
For more information, see `“Setting Global Configuration Parameters”
427+
<../installguide/configuration.html#setting-global-configuration-parameters>`_.
428+
404429

405430
#. Click Add.
406431

source/adminguide/virtual_machines.rst

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,113 @@ restoreVirtualMachine call. In this case, the Instance's root disk is
960960
destroyed and recreated, but from the same Template or ISO that was
961961
already in use by the Instance.
962962

963+
Instance Lease
964+
--------------
965+
966+
Cloudstack provides capability to create instance on lease. Lease denotes a set period for which resource is allocated and upon expiry cleanup is performed.
967+
This feature enables automated cleanup of instances created for specific duration and for specific purpose. This feature gives administrators the ability to automatically reclaim
968+
resources that are no longer needed by expired virtual machines, helping to optimize resource utilization and reduce wastage.
969+
970+
971+
**Configuring lease feature**
972+
973+
The cloud administrator can use global configuration variables to control the behavior of Instance Lease.
974+
To set these variables, API or CloudStack UI can be used:
975+
976+
.. cssclass:: table-striped table-bordered table-hover
977+
978+
======================================= ========================
979+
Configuration Description
980+
======================================= ========================
981+
instance.lease.enabled Indicates whether to enable the Instance lease featuew, will be applicable only on instances created after lease is enabled. **Default: false**
982+
instance.lease.scheduler.interval Background task interval in seconds that executes Lease expiry action on eligibile expired instances. Default: 3600.
983+
instance.lease.alertscheduler.interval Background task interval in seconds that executes Lease alert for instances about to be expired in next N days. Default: 86400
984+
instance.lease.alert.daysbefore Denotes number of days (N) for alert task. Default: 7 days
985+
======================================= ========================
986+
987+
988+
**Using Instance Lease**
989+
990+
User can associate Lease to an instance during Deployment of instance or modify existing lease by editing instance.
991+
992+
993+
**Deployment of Instance**
994+
995+
There are 2 ways to deploy instance with lease from UI:
996+
997+
1. Use compute offering which has associated lease metadata for instance
998+
999+
.. image:: /_static/images/deploy_instance_lease_offering.png
1000+
:width: 400px
1001+
:align: center
1002+
:alt: Deploy Instance with lease compute offering dialog box
1003+
1004+
2. Enable lease under Advance settings during instance Deployment
1005+
1006+
.. image:: /_static/images/deploy_instance_advanced_lease.png
1007+
:width: 400px
1008+
:align: center
1009+
:alt: Deploy Instance with lease using advance settings
1010+
1011+
1012+
To enable lease during instance deployment via API:
1013+
- Passing lease parameters
1014+
1015+
.. code:: bash
1016+
1017+
cmk deploy virtualmachine name=..... leaseduration=... leaseexpiryaction=...
1018+
1019+
- Use compute offering with lease
1020+
1021+
.. code:: bash
1022+
1023+
cmk deploy virtualmachine name=..... serviceofferingid=lease-compute-offering
1024+
1025+
1026+
**Lease Parameters**
1027+
1028+
1029+
**leaseduration**
1030+
Lease duration is specified in days. This can take Natural numbers and -1 to disable the lease.
1031+
Lease can be disabled:
1032+
- During deployment of instance while using lease based compute offering
1033+
- Update instance with existing lease
1034+
1035+
**leaseexpiryaction**
1036+
There are 2 actions supported:
1037+
- STOP: The instance is stopped, and it will be out of lease. The user can restart the instance manually.
1038+
- DESTROY: The instance is destroyed when the lease expires.
1039+
1040+
.. note:: Action is executed at most once on the instance, e.g. STOP action will bring instance in Stoppped state on expiry and instance will be out of lease. User may choose to start it again.
1041+
1042+
1043+
**Editing Instance Lease**
1044+
1045+
The lease duration for an instance can be extended, reduced, or disabled for instances that already have an active lease.
1046+
However, it is not possible to enable the lease on an instance after it has already been deployed.
1047+
1048+
From UI:
1049+
1050+
.. image:: /_static/images/edit_instance_lease.png
1051+
:width: 400px
1052+
:align: center
1053+
:alt: Edit Instance lease dialog
1054+
1055+
1056+
Using API:
1057+
1058+
.. code:: bash
1059+
1060+
cmk update virtualmachine id=fa970d19-8340-455c-a9fb-569205954fdc leaseduration=20 leaseexpiryaction=DESTROY
1061+
1062+
To disable lease using API:
1063+
1064+
.. code:: bash
1065+
1066+
cmk update virtualmachine id=fa970d19-8340-455c-a9fb-569205954fdc leaseduration=-1
1067+
1068+
.. note:: DESTORY action will ignore instance if deleteprotection is enabled for it.
1069+
9631070

9641071
Advanced Instance Settings
9651072
--------------------------

0 commit comments

Comments
 (0)