How-to use Virtual Machine Retirement Requests with the ITS Command Line Interface vss-cli

Table of Contents

Introduction

Virtual Machine Retirement Requests provide a workflow to manage the retirement and deletion of virtual machines, along with automated messages before the retirement date.

There are two types of retirement requests:

  • timedelta: specifies the number of days, months, and hours until retirement.

  • datetime: specifies a specific timestamp for retirement.

This guide will walk you through the process of setting up a retirement request and managing the retirement process.

Setting Up a Retirement Request

You can set up a retirement request using the compute vm set <id> retire mk command. This command allows you to specify the retirement type and value.

Setting a Retirement Date

New Virtual Machine

To set a retirement date upon deployment, use the following command:

vss-cli compute vm mk <deployment-method> --retire-type <type> --retire-value <value> --retire-warning <days>

Replace <deployment-method> with either shell, from-clib, from-clone, from-template, <type> with timedelta or datetime, <value> with the value for the retirement type, and <days> with the number of days before retirement to notify.

Existent Virtual Machine

To set a retirement date, use the following command:

vss-cli compute vm set <id> retire mk -t <type> --value <value> --warning-days <days>

Replace <id> with the ID of the virtual machine, <type> with timedelta or datetime, <value> with the value for the retirement type, and <days> with the number of days before retirement to notify.

For example, to set a retirement date for a virtual machine to be decommissioned on 2021-05-08 00:00 and get a confirmation notification 1 day before:

vss-cli compute vm set vm-2665 retire mk -t datetime --value '2021-05-08 00:00' --warning-days 1

If you don't specify a warning period, the command will prompt for confirmation before decommissioning the instance.

Verifying the Retirement Request

To verify the retirement request, use the following command:

This command will display information about the retirement request, including the status, retirement date, and warning period.

Confirming or Canceling the Retirement Request

To confirm or cancel the retirement request, use the following commands:

Replace <id> with the ID of the retirement request.

Example Scenario

To retire an instance 6 months from now and have a notification 15 days before, use the following command:

This command will set the retirement date 6 months from now and send a notification 15 days before the retirement date.

By following these steps, you can manage the retirement and deletion of virtual machines using Virtual Machine Retirement Requests.

 Related articles

University of Toronto - Since 1827