Chapter 6. Retirement

6.1. Retiring Virtual Machines

6.1.1. Retiring Virtual Machines and Instances

When a virtual machine or instance is no longer required, it can be retired. Once a virtual machine or instance reaches its retirement date, it is immediately shut down and not allowed to restart. If an attempt to restart is made, CloudForms Management Engine will shut down the virtual machine or instance.

There are three built-in policies involved with retirement.

  • If the virtual machine or instance reaches its retirement date, it will be stopped even if it is running.
  • If a retired virtual machine or instance is requested to start through CloudForms Management Engine, the virtual machine or instance will not be allowed to start.
  • If a provider starts a retired virtual machine or instance outside of CloudForms Management Engine, the virtual machine or instance will be stopped.

CloudForms Management Engine provides a number of ways to retire a virtual machine or instance.

  • By using the allocated buttons in the CloudForms Management Engine console.
  • When creating a provision request, a retirement date can be set up.

6.1.2. Using the CloudForms Management Engine Console to Retire

Through the CloudForms Management Engine console, you can retire a virtual machine on a specific date or immediately.

6.1.3. Retiring a Virtual Machine Immediately

  1. Navigate to ServicesWorkloads.
  2. Select the virtual machine or instance that you want to retire.
  3. Click 2007 (Lifecycle), then 2010 (Retire this VM/Instance).

The virtual machine or instance is immediately stopped, and will be shut down if an attempt is made to restart it.

6.1.4. Setting a Retirement Date for a Virtual Machine or Instance

  1. Navigate to ServicesWorkloads.
  2. Select the virtual machine that you want to set a retirement date for.
  3. Click 2007 (Lifecycle), then 2008 (Set/remove retirement date).
  4. Select a date using the calendar control.
  5. Click Save.

The retirement date is set, and displays in the virtual machine or instance summary screen.

6.1.5. Removing a Retirement Date for a Virtual Machine or Instance

  1. Navigate to ServicesWorkloads.
  2. Select the virtual machine or instance that you want to remove the retirement date from.
  3. Click 2007 (Lifecycle), then click 2008 (Set Retirement Date).
  4. Click 2009 (Remove Retirement Date).

6.2. Setting Retirement in a Provision Request

If you are using CloudForms Management Engine to provision, you can set when you want retirement in the provision request. To see how to create a request, go to Provisioning Requests. A warning email will be sent to the owner before the retirement.

6.2.1. Scheduling Retirement in a Provision Request

After provisioning either a Cloud Instance or Virtual Machine, a multi-tabbed screen appears where you can set up your provision requests. The Schedule tab allows you to choose to power on the virtual machines or instances after they are created, and to set a retirement date. If you select a retirement period, you will be prompted for when you want a retirement warning. 2363

6.3. Extending Retirement Dates

CloudForms Management Engine Automate includes a method to extend the retirement of a virtual machine or instance by 14 days. This section describes how to create a button that invokes this method and how to edit the method to change the number of days.

6.3.1. Creating a Custom Button to Extend Retirement

  1. Navigate to AutomateCustomization.
  2. Click the Buttons accordion.
  3. From the Object Types tree, select VM and Instance.
  4. Navigate to the button group to which you want to add this button. (If you do not have a button group, add one and then create the button.)
  5. Click 1847 (Configuration), then 1848 (Add a new Button).
  6. Type in a button text and button hover text, and select the image you want to use.
  7. In Object Details, select Request from the /System/Process/ dropdown. By default, the message is create. Do not change it.
  8. In Request, type vm_retire_extend.
  9. Click Add.

6.3.2. Changing the Number of Days to Extend Retirement

  1. Navigate to AutomateExplorer.
  2. Click DOMAINCloudVMRetirementEmailvm_retire_extend.

    Note

    DOMAIN must be a user-defined Domain and not the locked ManageIQ Domain. If necessary, you can copy the class from the ManageIQ domain into a custom domain.

    This example uses the Cloud Namespace, but you can also use the Infrastructure namespace.

  3. Click 1847 (Configuration), then 1851 (Edit this Instance).
  4. In the Value field, change the vm_retire_extend_days attribute to the new value.
  5. Click Save.

    6299