Skip to content

Documentation related to Instance lease feature #492

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sudo87
Copy link

@sudo87 sudo87 commented Apr 8, 2025

Documentation PR for instance lease feature apache/cloudstack#10560


📚 Documentation preview 📚: https://cloudstack-documentation--492.org.readthedocs.build/en/492/

@sudo87
Copy link
Author

sudo87 commented Apr 8, 2025

@blueorangutan docbuild

@sudo87
Copy link
Author

sudo87 commented Apr 8, 2025

@rajujith @rohityadavcloud @sureshanaparti please review

@blueorangutan
Copy link

@sudo87 a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/492. (QA-JID 318)

@sudo87
Copy link
Author

sudo87 commented Apr 8, 2025

@blueorangutan docbuild

@blueorangutan
Copy link

@sudo87 a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/492. (QA-JID 319)

@@ -401,6 +401,31 @@ To create a new compute offering:
- **Disk Offering Strictness**: This flag defines the strictness of the disk offering association
with the compute offering. When set to true, overriding of disk offering is not allowed on deploy instance
and change disk offering is not allowed for the ROOT disk

- **Enable Lease**: When this flag is enabled, compute offering is created with lease related metadata.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add here that, this is only available when the feature is enabled via global setting?

Copy link
Author

@sudo87 sudo87 Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note is included at the end of this section. Should we move it in beginning?

image

Instance Lease
--------------

Cloudstack provides capability to create instance on lease. Lease denotes a set period for which resource is allocated and upon expiry cleanup is performed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explaination of various behaviour scenarios are missing; for example how the feature will work, what happens when the global is disable (i.e. cancels the leases). I think all the various notes on implementation can be put here for the end-user/operator to understand, incld. expected edge-case behaviours.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are notes included in the docs addressing:

  1. Expiry action execution
  2. Lease cancellation
  3. Delete protection

However, including behaviours as list will provide better clarity. I will update the document.

Configuration Description
======================================= ========================
instance.lease.enabled Indicates whether to enable the Instance lease featuew, will be applicable only on instances created after lease is enabled. **Default: false**
instance.lease.scheduler.interval Background task interval in seconds that executes Lease expiry action on eligibile expired instances. Default: 3600.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit - additional blank spaces in the start of the description.


**Using Instance Lease**

User can associate Lease to an instance during Deployment of instance or modify existing lease by editing instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth mentioning, the behaviour around what happens:

  • When instances are not deployed with leases, can they acquire lease by switching service offering?
  • What is allowed for admins & end-users for instances deployed with lease
  • Generally when service offering is changed
  • When lease is disabled by user or admin for an instance

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will include these as notes.

@sudo87
Copy link
Author

sudo87 commented Apr 9, 2025

Thanks @rohityadavcloud for the review comments, will work on addressing them.

@sudo87
Copy link
Author

sudo87 commented Apr 9, 2025

@blueorangutan docbuild

@blueorangutan
Copy link

@sudo87 a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/492. (QA-JID 320)

@sudo87
Copy link
Author

sudo87 commented Apr 10, 2025

@blueorangutan docbuild

@blueorangutan
Copy link

@sudo87 a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/492. (QA-JID 321)

@@ -401,6 +401,33 @@ To create a new compute offering:
- **Disk Offering Strictness**: This flag defines the strictness of the disk offering association
with the compute offering. When set to true, overriding of disk offering is not allowed on deploy instance
and change disk offering is not allowed for the ROOT disk

- **Enable Lease**: When this flag is enabled, compute offering is created with lease related metadata.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this flag is enabled, Compute Offering is created with 'Instance Lease' feature enabled. In CloudStack, a lease sets a specific time duration after which a chosen lease action action, such as stopping or destroying the instance, will take place. These lease settings are defined in the Compute Offering and are automatically applied to any Instance created using it.


When the flag is enabled

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lease Duration (in days): Sets the lease duration. An instance created using this compute offering will inherit the lease duration by default.


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

- **Lease expiry action**: Denotes lease expiry action, which gets executed upon lease expiry for instances created from compute offering.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lease expiry action: Denotes lease expiry action, which gets executed upon lease expiry for instances created using this compute offering.
Supported values for lease expiry action are as follows:

--------------

Cloudstack provides capability to create instance on lease. Lease denotes a set period for which resource is allocated and upon expiry cleanup is performed.
This feature enables automated cleanup of instances created for specific duration and for specific purpose. This feature gives administrators the ability to automatically reclaim
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CloudStack offers the option to create Instances with a Lease. A Lease defines a set time period after which a selected action, such as stopping or destroying the instance, will be automatically performed. This helps optimize cloud resource usage by automatically freeing up resources that are no longer in use. If a user needs an instance only for a limited time, this feature can be useful. When deploying an instance, users can either choose a Compute Offering that includes the Instance Lease feature or enable it specifically for that instance, setting the number of days after which the instance should be stopped or destroyed once their task is complete.

resources that are no longer needed by expired virtual machines, helping to optimize resource utilization and reduce wastage.


**Configuring lease feature**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuring Instance Lease feature

======================================= ========================
Configuration Description
======================================= ========================
instance.lease.enabled Indicates whether to enable the Instance lease featuew, will be applicable only on instances created after lease is enabled. **Default: false**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

featuew -> feature


**leaseduration**: Lease duration is specified in days. This can take Natural numbers and -1 to disable the lease.

Lease may require to be disabled in following scenarios:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users can disable the Instance Lease feature during instance deployment by unchecking the 'Enable Lease' option when using a Compute Offering that supports it. For existing instances with a lease already enabled, the lease can be removed by editing the instance and unchecking the 'Enable Lease' option.


#. Lease Assignment: A lease can only be assigned to an instance during deployment.
#. Lease Acquisition: Instances without a lease cannot acquire one by switching to a different compute offering or by editing the instance.
#. 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".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lease Inheritance: Instances inherit the lease from a compute offering with 'Instance Lease' feature enabled. This lease can be overridden or disabled in the “Advanced Settings”.


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

1. Use compute offering which has associated lease metadata for instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use compute offering which has 'Instance Lease' feature enabled.

@sudo87
Copy link
Author

sudo87 commented Apr 11, 2025

@blueorangutan docbuild

@blueorangutan
Copy link

@sudo87 a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/492. (QA-JID 322)

@sudo87
Copy link
Author

sudo87 commented Apr 11, 2025

Thank you @rajujith for reviewing the doc pr, its updated based on the suggestion.

Copy link
Contributor

@rajujith rajujith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants