Auto Deleting Volumes on Instance Delete

Problem

How to attach Volumes which will be deleted when the Source VM is deleted.

Environment

  • Platform9 Managed OpenStack - v4.0 and Higher
  • python-openstackclient CLI

Procedure

  1. Obtain the UUID of the Volume and the VM you want to attach it to.
  2. Source the OpenRC file for your environment.
  3. Run the following command with the --enable-delete-on-termination flag. $ openstack server add volume [--enable-delete-on-termination | --disable-delete-on- termination] server_uuid volume_uuid

Note - This command will delete the volume by default when the associated VM is deleted. There will no confirmation step. Please ensure you have backups of all critical volumes to avoid potential data loss.

Additional Information

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard