July 24, 2023

VMware Aria Automation: Demystifying Lease Policy

Demystifying Lease Policy

Before understanding Lease policy, we need to understand how Deployment Lease works.

Deployment Lease

A Deployment lease is the duration in date & time that represents until when a Deployment stays active.

The following diagram shows the different lease states of a Deployment and how these states change based on different actions.

 

A computer screen shot of a flowchart</p>
<p>Description automatically generated

Figure 1: Lease Policy state diagram

Each Deployment has the following 4 parameters that represents and are used to manage the Lease status of the Deployment.

  1. Lease Expiry date
    This is a date-time field that represents on what date and at what time, the Deployment changes from Active status to Expired status. It's in a "MM/DD/YYYY hh:mm a" format. For example, 04/27/2023 1:01 AM. By default, Deployment Lease Expiry Date is set to NULL which means the Deployment will never expire.
  2. Max Lease
    After a Deployment has Expired, the user can extend the Lease by performing "Change Lease" Day2 Action. The Max Lease parameter is the maximum number of days the user can extend the lease by at a time. For example, if the Max Lease of a deployment is set to 5 days, then the user can extend the lease and postpone the lease expiry date by a maximum of 5 days. If there are no applicable lease policies defined for a deployment, then the deployment by default has no max lease value set which means it'll never expire. 
  3. Max Total Lease
    The user can keep extending the Lease using the "Change Lease" action until it reaches the Max Total Lease limit. The Max Total Lease is the number of days that the deployment can exist from the date/time it was first created.  After the Max Total Lease is reached, the user can't extend the lease anymore. For example, if the Deployment is created on 04/17/2023 1:01 AM and Max total Lease is 10 days. So, the Deployment can exist until 04/27/2023 1:01 AM. If there are no applicable lease policies defined for a deployment, then by default the deployment has no max total lease value set which means it'll exist indefinitely. 
  4. Grace Period
    When a deployment expires, it's scheduled for deletion. However, if a Grace Period was defined for the deployment, then the expired deployment is not immediately deleted. The user can renew the lease within the grace period. The Grace period value is set in whole number of days. If the Grace period is set with a fraction value (>=0 and <1), then the grace period is set to 30 minutes. If you don't set a grace period, the default is 1 day. The grace period is not counted towards the max total lease days.

The Lease Expiry date can be changed by the Deployment User (Any user with a Deployment Manage permission) using the "Change Lease" action. But the other 3 parameters which represents the limits, can only be set, or changed via a Lease Policy. The deployment user can't change the limits directly.

Lease Policy

Lease policy is a rule set by the Admin on Deployment lease. Using the Lease Policy, the admin can set the limit parameters mentioned above (Max Lease, Max Total Lease & Grace period). A lease policy configuration has three parts.

  1. Scope & Criteria of a Lease Policy is used to define a pattern by which applicable Deployments are identified (Both pre-existing Deployments before the policy creation and newly created Deployments after policy creation).
  2. For the identified Deployments, the 3 limit parameter values are set according to the values defined in the Lease Policy. (Max Lease entered should be less than or equal to Max total Lease. Even if the Max Lease is set to a greater value than the Max Total Lease, the system corrects it by applying the lower limit of the two at the time of "Change Lease" day 2 action validation)
  3. Enforcement type which is set to HARD or SOFT based on priority. In case of conflict in applicable policies, HARD has precedence over SOFT.
  • A Lease Policy cannot directly increase or decrease the Lease Expiry date of a Deployment. But the Lease Expiry date abides by the rule set in the Lease Policy which means the difference between Deployment Creation Date and Lease Expiry date must be less than or equal to the Max Total Lease value. Also, the difference between "The date when Policy was created or modified" and Lease Expiry date, must be less than or equal to the Max Lease value. So, if the differences are more than either the Max Lease value or Max Total Lease value when the Policy is executed, then the Lease Expiry date is changed to the maximum possible value that abides by the Max lease limit and Max total lease limit rule.

    So, the Lease Expiry date of an applicable Deployment will stay unchanged by the Lease Policy creation or update, if it abides by the following rule.

As an example, in a Lease Policy setting, 

  • Max Lease is set as 10 days and Max Total Lease is set as 20 days.
    • When Lease Policy is Created/Updated and defines the limits for the identified Deployment, the identified Deployments should abide by the rule above.
    •  So, if the Lease Expiry Date for an identified Deployment doesn't abide by the rule above when the Lease Policy is created/updated, then the Lease Expiry Date will be changed to a value that's within the limits defined by the policy.
      • Therefore,
        • if "Deployment Lifeline end date" is earlier than "Maximum Expiry Date", then Lease Expiry Date will be set to "Deployment Lifeline end date"
        • else if "Maximum Expiry Date" is earlier than "Deployment Lifeline end date", then Lease Expiry Date will be set to "Maximum Expiry Date".
      • In this case, it will change to 10 days from creation date.
    • Besides this, the identified Deployment limits will be changed to the new values from the limits defined by the Lease Policy.
  • Now if the Lease Policy limits are increased as follows. Max Lease is set as 30 days and Max Total Lease is set as 40 days.
    • The identified Deployment limits will be changed to the new values which is same as the limits defined by the Lease Policy.
    • But the Lease Expiry Date still abides by the rule above even after the limits have changed. So, the Lease Expiry Date will stay unchanged.
  • There could be multiple Lease Policies applicable to a Deployment which are merged to find the limit parameter value. In such case, the final values for the limit parameters (Max Lease, Max Total Lease & Grace period) for that Deployment are calculated as follows,
  • Scope: Organization level scope has higher priority over Project level scope.
  • Enforcement Type: HARD type has higher priority over SOFT enforcement type.
  • In case of same scope and enforcement, the lowest value will be chosen for each of the 3 limits.
  • The Grace period value must be same for all applicable Lease policies. If they are different, then the first created Lease Policy will be applied and any subsequent Policies with different grace period value than the first policy, will be considered as CONFLICT and will be totally ignored. All Policies with grace period value matching the first created Policy, will be considered, and enforced as well. For Example, 4 applicable Lease Policies with Max Lease, Max Total Lease & Grace Period values as follows.
 

Max Lease

Max Total Lease

Grace Period

 

1

50

70

30

Enforced

2

30

50

20

Conflict

3

20

30

10

Conflict

4

30

55

30

Enforced

  • In this case, 1st and 4th policies will be Enforced. The other two will be marked as CONFLICT and ignored.

Nilay Chakraborty

Member of technical staff

A person in a suit and tie</p>
<p>Description automatically generated

Filter Tags

Aria VMware Aria Automation VMware Aria Automation Assembler VMware Aria Automation Config VMware Aria Automation Consumption VMware Aria Automation for Secure Clouds VMware Aria Automation for Secure Hosts VMware Aria Automation Orchestrator VMware Aria Automation Pipelines VMware Aria Automation Templates Blog Feature Walk-through Operational Tutorial Technical Overview Overview Intermediate Cloud deployment Multi-cloud PaaS SaaS Workload Automation XaaS