You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regular users are allowed to delete their VM's.
If those VM's have a backup offerings, with at least one backup, users can still remove them, but the expunge thread will fail to delete the virtual machine. Users cannot see the VM anymore, because its detroyed state, so it gets stucked until manual removal.
2026-11-27 08:25:22,164 WARN [c.c.v.U.ExpungeTask] (UserVm-Scavenger-1:[ctx-dbe9bbe2]) (logid:97990165) Unable to expunge VM instance {"id":744,"instanceName":"i-39-744-VM","state":"Destroyed","type":"User","uuid":"2a552e9d-27b0-49ac-b314-2151380e0a08"} com.cloud.utils.exception.CloudRuntimeException: This Instance [uuid: 2a552e9d-27b0-49ac-b314-2151380e0a08, name: i-39-744-VM] has a Backup Offering [id: 4, external id: null] with 1 backups. Please, remove the backup offering before proceeding to VM exclusion!
versions
Versions: Cloudstack 4.22.1.0
Hypervisor: KVM
The steps to reproduce the bug
Assign a VM to a backup offering.
Perform a manual backup or wait a scheduled one.
Remove the VM as a regular user (or without the expunge flag).
The VM will become invisible to the user and will not be removed by the expunge thread.
What to do about it?
I belive that two things can be done:
Inform user that this VM has backups and they must be removed prior to VM Removal.
Allow the user to flag that backups from this VM can be removed if they are present. Keep this flag and allow expunge thread to remove backups those backups and then, remove the VM.
I think that the option 2 will be easier for users.
Hi! I'd like to investigate this issue.
I'll look into the VM destruction and expunge lifecycle, particularly the backup validation and provider-specific backup retention behavior.
Would you prefer an early validation check before VM destruction, or should I explore the explicit backup removal option proposed in the issue?
Would it be okay if I worked on this?
Hi! I'd like to investigate this issue. I'll look into the VM destruction and expunge lifecycle, particularly the backup validation and provider-specific backup retention behavior. Would you prefer an early validation check before VM destruction, or should I explore the explicit backup removal option proposed in the issue? Would it be okay if I worked on this?
Hi @DevByPurva !
I belive that the UI code could check if the VM has any backup / backup offering, and provide a checkbox with an authorization to remove them with the VM.
When there is no backup, there is no need to ask user such permission, but I think that will be a safe measure to remove any backup offerring to avoid a scheduled backup to run prior the expunge thread, since it could generate a backup that was not authorized for removal.
I agree with this approach. A conditional checkbox would make the deletion process easier for users while ensuring that existing backups are only removed with explicit authorization.
Removing the VM's backup offering association to prevent new scheduled backups also makes sense, especially given the delay before expunging.
I'd be happy to work on implementing this. Could you assign the issue to me if it's available?
I agree with this approach. A conditional checkbox would make the deletion process easier for users while ensuring that existing backups are only removed with explicit authorization. Removing the VM's backup offering association to prevent new scheduled backups also makes sense, especially given the delay before expunging.
I'd be happy to work on implementing this. Could you assign the issue to me if it's available?
Unfortunately I have no permission to assign tasks, i'm just a regular cloudstack user :).
Maybe Mr. @DaanHoogland could help with this?
I'd be happy to work on implementing this. Could you assign the issue to me if it's available?
I assigned, but assigning is just a nudge, you may work on it anyway and it does not prevent others from working on it either. Have fun and let us know of any progress or blockades.
Activity
DevByPurva commentedon Dec 1, 2026
Hi! I'd like to investigate this issue.
I'll look into the VM destruction and expunge lifecycle, particularly the backup validation and provider-specific backup retention behavior.
Would you prefer an early validation check before VM destruction, or should I explore the explicit backup removal option proposed in the issue?
Would it be okay if I worked on this?
EduFrazao commentedon Dec 1, 2026
Hi @DevByPurva !
I belive that the UI code could check if the VM has any backup / backup offering, and provide a checkbox with an authorization to remove them with the VM.
When there is no backup, there is no need to ask user such permission, but I think that will be a safe measure to remove any backup offerring to avoid a scheduled backup to run prior the expunge thread, since it could generate a backup that was not authorized for removal.
What do you think?
DevByPurva commentedon Dec 1, 2026
I agree with this approach. A conditional checkbox would make the deletion process easier for users while ensuring that existing backups are only removed with explicit authorization.
Removing the VM's backup offering association to prevent new scheduled backups also makes sense, especially given the delay before expunging.
I'd be happy to work on implementing this. Could you assign the issue to me if it's available?
EduFrazao commentedon Dec 1, 2026
Unfortunately I have no permission to assign tasks, i'm just a regular cloudstack user :).
Maybe Mr. @DaanHoogland could help with this?
DaanHoogland commentedon Dec 2, 2026
I assigned, but assigning is just a nudge, you may work on it anyway and it does not prevent others from working on it either. Have fun and let us know of any progress or blockades.