Skip to content

Commit f9b3b0d

Browse files
committed
Add behaviour and considerations for instance lease
1 parent e049208 commit f9b3b0d

File tree

2 files changed

+52
-33
lines changed

2 files changed

+52
-33
lines changed

source/adminguide/service_offerings.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -402,29 +402,31 @@ To create a new compute offering:
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
404404

405-
- **Enable Lease**: When this flag is enabled, compute offering is created with lease related metadata.
405+
- **Enable Lease**: When this flag is enabled, compute offering is created with lease related metadata.
406406
In CloudStack, a lease represents the specific duration for which an instance is allocated.
407407
The user rents these resources for the duration of the lease. Once the lease period expires, instance may be stopped or destroyed.
408408
Lease information is inherited from compute offering and gets associated to Instance.
409+
410+
.. note:: The global configuration ``instance.lease.enabled`` should be configured as true to create compute offering with lease.
411+
412+
``instance.lease.enabled``: Indicates whether Instance Lease feature is enabled or not. Default is **false**
413+
For more information, see `“Setting Global Configuration Parameters”
414+
<../installguide/configuration.html#setting-global-configuration-parameters>`_.
409415

410416
When the flag is enabled
411417

412418
- **Lease Duration (in days)**: Creates a compute offering with Lease duration. Instance created from this compute offering will inherit lease duration by default.
413419

414420
- **Lease expiry action**: Denotes lease expiry action, which gets executed upon lease expiry for instances created from compute offering.
415421
Suported values for lease expiry action are as follows:
422+
416423
- STOP
417424
- DESTROY
418425

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>`_.
426+
.. image:: /_static/images/compute_offering_dailog_with_lease.png
427+
:width: 400px
428+
:align: center
429+
:alt: Compute offering dialog box
428430

429431

430432
#. Click Add.

source/adminguide/virtual_machines.rst

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -973,8 +973,6 @@ resources that are no longer needed by expired virtual machines, helping to opti
973973
The cloud administrator can use global configuration variables to control the behavior of Instance Lease.
974974
To set these variables, API or CloudStack UI can be used:
975975

976-
.. cssclass:: table-striped table-bordered table-hover
977-
978976
======================================= ========================
979977
Configuration Description
980978
======================================= ========================
@@ -985,12 +983,47 @@ instance.lease.alert.daysbefore Denotes number of days (N) for alert ta
985983
======================================= ========================
986984

987985

986+
**Lease Parameters**
987+
988+
989+
**leaseduration**: Lease duration is specified in days. This can take Natural numbers and -1 to disable the lease.
990+
991+
Lease may require to be disabled in following scenarios:
992+
993+
- During deployment of instance while using compute offering with lease metadata
994+
- Edit instance with existing lease
995+
996+
**leaseexpiryaction**: There are two expiry action supported:
997+
998+
- STOP: The instance is stopped, and it will be out of lease. The user can restart the instance manually.
999+
- DESTROY: The instance is destroyed when the lease expires.
1000+
1001+
.. note:: Expiry 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.
1002+
1003+
9881004
**Using Instance Lease**
9891005

990-
User can associate Lease to an instance during Deployment of instance or modify existing lease by editing instance.
1006+
Lease information is associated to an Instance and following parameters are used to enable lease for it:
9911007

1008+
#. leaseduration
1009+
#. leaseexpiryaction
9921010

993-
**Deployment of Instance**
1011+
Instance remains active for specified leaseduration (in days). Upon lease expiry, configured expiryaction is executed on the instance and
1012+
lease is removed from the instance for any further action.
1013+
1014+
**Notes:**
1015+
1016+
#. Lease Assignment: A lease can only be assigned to an instance during deployment.
1017+
#. Lease Acquisition: Instances without a lease cannot acquire one by switching to a different compute offering or by editing the instance.
1018+
#. Lease Inheritance: Instances inherit the lease from a compute offering that contains lease metadata. This lease can be overridden or disabled in the "Advanced Settings".
1019+
#. Lease Persistence: A lease is always tied to the instance. Modifications to the compute offering do not affect the instance's lease.
1020+
#. Non-Lease Compute offering: Instances can have a lease by enabling it in the "Advanced Settings" for non-lease based compute offering too.
1021+
#. Lease Duration Management: The lease duration can be extended or reduced for instances before expiry. However, once the lease is disabled, it cannot be re-enabled for that instance.
1022+
#. Lease Expiry: Once the lease expires and the associated action is completed, the lease is annulled and cannot be reattached or extended.
1023+
#. Feature Disablement: If the lease feature is disabled, the lease associated with instances is canceled. Re-enabling the feature will not automatically reapply the lease to previously grandfathered instances.
1024+
#. Delete Protection: The DESTROY lease expiry action is skipped for instances with delete protection enabled.
1025+
1026+
**Deployment of Instance with lease**
9941027

9951028
There are 2 ways to deploy instance with lease from UI:
9961029

@@ -1009,8 +1042,9 @@ There are 2 ways to deploy instance with lease from UI:
10091042
:alt: Deploy Instance with lease using advance settings
10101043

10111044

1012-
To enable lease during instance deployment via API:
1013-
- Passing lease parameters
1045+
**Using API**
1046+
1047+
Pass lease parameters in the command to enable lease during instance deployment:
10141048

10151049
.. code:: bash
10161050
@@ -1023,23 +1057,6 @@ To enable lease during instance deployment via API:
10231057
cmk deploy virtualmachine name=..... serviceofferingid=lease-compute-offering
10241058
10251059
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-
10431060
**Editing Instance Lease**
10441061

10451062
The lease duration for an instance can be extended, reduced, or disabled for instances that already have an active lease.

0 commit comments

Comments
 (0)