There /are/ ephemeral volumes that would be deleted when the instance is removed but these are typically allocated as swap or for other specific uses. The boot volume and other attached disks must be deleted separately.
On Sun, 2024-07-07 at 21:48 -0400, Alan Davis wrote: thats not entirly true so as onted by berndbausch@gmail.com there is a delete on termination flag which can be sepcified when creating a vm or when attaching a volume to contole if the voluem is deleted when the vm is deleted https://docs.openstack.org/api-ref/compute/#id187 ``` delete_on_termination (Optional) body boolean To delete the attached volume when the server is destroyed, specify true. Otherwise, specify false. Default: false New in version 2.79 ``` it has been setable in create server for much longer https://docs.openstack.org/api-ref/compute/#create-server ``` block_device_mapping_v2.delete_on_termination (Optional) body boolean To delete the boot volume when the server is destroyed, specify true. Otherwise, specify false. Default: false ``` it defaults to false in the nova api although it can be configured in horizon to default to true i belive.
Alan Davis Principal System Administrator Apogee Research LLC Office : 571.384.8941 x26 Cell : 410.701.0518
On Sun, Jul 7, 2024 at 8:36 PM <berndbausch@gmail.com> wrote:
This is the expected behaviour. The volume lifecycle has nothing to do with the server lifecycle. Volumes contain potentially important data which is totally independent from the servers that process it, and since Nova doesn't know what data you keep on the volume, it doesn't touch it. Imagine - you decommission a physical server, and automatically throw away all the LUNs that were connected to it. I don't think your boss would be happy to lose your company's client database, for example.
I believe that volume attachment has a flag to automatically delete the volume when the instance is deleted. But you must set it explicitly.
-----Original Message----- From: kjme001@gmail.com <kjme001@gmail.com> Sent: Monday, July 8, 2024 2:28 AM To: openstack-discuss@lists.openstack.org Subject: when deleting an instance, its volume is not deleted
I have the following problem, when deleting an instance, its volume is not deleted along with it, the volume remains and I then have to execute the command to detach the volume from the non-existent instance and then delete it. I don't know what could be causing this, the volume should probably be deleted together with the instance being deleted Thank you for your help