Configure default lease settings

Properties specify the default lease period and maximum allowed duration of a virtual server lease for all cloud providers.

Before you begin

Role required: cloud_admin

About this task

You can configure a lease duration to define the length of time cloud users can access a virtual resource. At the end of the lease, access is terminated. You can also configure a grace period for the lease end.

Procedure

  1. To configure duration, navigate to Cloud Management > Administration > Properties and specify the following values:
    • Default lease duration

      This property (glide.vm.lease_duration) controls the length of the lease period automatically configured for a virtual server request. The default duration is 60 days from the lease start time, which begins on the current date and time of the request. The actual time of the lease is calculated from the time the instance is provisioned, after any approvals.

    • Max lease duration

      This property (glide.vm.max_lease_duration) controls the maximum length of the lease period permitted for a virtual server. The default maximum duration is 90 days from the lease start time. This property prevents virtual resources that have been ignored from running indefinitely.

    Configure the lease duration
  2. Configure the Lease is expiring notification time. Specify the number of days in the Time prior to lease end to notify requester property (glide.vm.lease_end_notification).

    The ServiceNow instance sends the following system notification to the user on the specified number of days before lease end:

    Virtual instance <name> will be terminated in <n> days.

  3. Configure the grace period.

    A configurable grace period enables an administrator to delay the termination of a virtual machine when the lease end date expires. When the lease ends, the virtual machine is powered off, but is available for use until the end of the grace period.

    To change the default grace period of 7 days, navigate to Cloud Management > Administration > Properties and edit the value in the Grace period after lease end until VM termination property (glide.vm.grace_period).

    When the lease ends, the platform runs the Amazon EC2 End of Lease workflow, which powers off the virtual machine and notifies the requester that the lease has expired. The Amazon EC2 End of Lease workflow evaluates the glide.vm.grace_period property to determine when the Terminate Amazon EC2 Instance workflow should run. The requester is notified when the virtual machine is terminated (or when termination has failed).

  4. To configure a different workflow to run when a lease is terminated, in the application navigation filter, enter task_action_workflow.list.
    1. Select end_of_lease in the Action field.
    2. Select the appropriate table in the Table field.
      • For an AWS VM instance: [cmdb_ci_ec2_instance] table.
      • For an Azure VM instance: [cmdb_ci_azure_instance] table.
      Configure the workflow for the grace period
    3. Select a different workflow in the Workflow field.
    4. Click Update.

What to do next

Requesters of virtual resources can configure lease start and end times for individual virtual machines.

Configure the lease grace period

A configurable grace period enables an administrator to delay the termination of a virtual machine when the lease end date expires.

Before you begin

Role required: cloud_admin, vmware_operator

About this task

When the lease ends, the virtual machine is powered off, but is available for use until the end of the grace period. To change the default grace period of 7 days, navigate to Cloud Management > Administration > Properties and edit the value in the Grace period after lease end until VM termination property (glide.vm.grace_period).

When the lease ends, the platform runs the VMware End of Lease workflow, which notifies the requester that the lease has expired, and then powers off the virtual machine. The VMware End of Lease workflow evaluates the glide.vm.grace_period property to determine when the VMware Termination workflow should run. The requester is notified when the virtual machine is terminated, or if termination failed.

To configure a different workflow to run when a lease is terminated:

Procedure

  1. In the application navigation filter, enter task_action_workflow.list.
  2. Select the end_of_lease action for the VMware Virtual Machine Instance [cmdb_ci_vmware_instance] table.
    Figure 1. VM lease end workflow
  3. Select a different workflow to run in the Workflow field.
  4. Click Submit.