Menu Close
Settings Close

Language and Page Formatting Options

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, Red Hat CloudForms 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 Red Hat CloudForms, the virtual machine or instance will not be allowed to start.
  • If a provider starts a retired virtual machine or instance outside of Red Hat CloudForms, the virtual machine or instance will be stopped.

Red Hat CloudForms provides a number of ways to retire a virtual machine or instance:

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

6.1.2. Using the Console to Retire a Virtual Machine

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

6.1.3. Retiring a Virtual Machine Immediately

  1. Navigate to ComputeInfrastructureVirtual Machines.
  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 and Time for a Virtual Machine or Instance

You can schedule virtual machine retirement by specifying a date and time, or by selecting a relative time a number of months, weeks, days or hours ahead of the present time.

  1. Navigate to ComputeInfrastructureVirtual Machines.
  2. Select the virtual machine or instance that you want to set a retirement date for.
  3. Click 2007 (Lifecycle), then 2010 (Set Retirement Dates).
  4. From Enter Retirement Date as, select Specific Date and Time or Time Delay from Now to schedule retirement.

    1. To choose a Specific Date and Time, click the Retirement Date and Time field to open the calendar.

      1. Select a retirement date using the calendar control.
      2. Click clock then select a retirement time (in UTC) using the arrows.
    2. To retire the virtual machine using a relative time, select Time Delay from Now.

      1. From Time Delay, specify a retirement time any number of months, weeks, days, or hours in the future using the arrows.
  5. Select a Retirement Warning if desired.
  6. Click Save.

The scheduled retirement date and time display in the virtual machine summary screen.

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

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

6.2. Setting Retirement in a Provision Request

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

6.2.1. Scheduling Retirement in a Provision Request

When provisioning a cloud instance or virtual machine, a multi-tabbed screen appears where you can set up your provision requests.

  1. Click the Schedule tab to set when to provision your request and the lifespan of the virtual machine or instance.
  2. In Lifespan, you can choose to power on the virtual machines or instances after creation and set the Time until Retirement. If you select the time until retirement, you will select Retirement Warning accordingly.
  3. Click Submit.

    vm instance retirement

6.3. Extending Retirement Dates

Red Hat CloudForms 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 1862 (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