Closed gg4126 closed 5 months ago
Thanks for opening your first issue here! Be sure to follow the issue template!
@gg4126 this would require some major changes as currently VM snapshots are not backed up on to secondary storage and live in the same dir as the VM (atleast on VMware which I checked). For now using B&R plugin would be a better option
I think the issue is the snapshots are deleted on "VM.DESTROY", instead of on "VM.EXPUNGING". Since the VM can be recovered after being destroyed, but cant be recovered after expunging. So in the "VM.DESTROYED" event process, the snapshots should not be deleted.
@gg4126 I will test again but in my case snapshot wasn't deleted when VM was destroyed and only deleted when the VM was expunged. I was using VMware as hypervisor. Are you using KVM?
@gg4126 I will test again but in my case snapshot wasn't deleted when VM was destroyed and only deleted when the VM was expunged. I was using VMware as hypervisor. Are you using KVM?
Yes, we saw this behavior on KVM based VMs.
@gg4126 on KVM, the vm snapshots are saved as in the qcow2 image file of the vm instance. If the vm is expunged (cloudstack will expunge vm in Destroy state after a period), the vm image is removed, as well as the vm snapshots.
it would be better to use volume snapshots (a.k.a snapshots), which are persisted on primary or secondary storage, instead of vm snapshots.
By design, it's not possible to retain VM snapshot and delete the VM with VM snapshots. The suggest approach is to take volume snapshots and convert them into templates when needed to restore VMs. Or, take backup using the B&R framework.
Due to this design we can't support retaining VM snapshots across support hypervisors and volumes. Closing on this remark.
ISSUE TYPE
COMPONENT NAME
CLOUDSTACK VERSION
CONFIGURATION
advanced networking
OS / ENVIRONMENT
RHEL 7.9
SUMMARY
The VM Snapshots and VM “Backup & Recovery” are two different things; Currently CloudStack supports the VM backup & recovery by means of third party Veeam Plugin which requires paid subscription. We noticed that when we destroy (without Expunging) VMs, it is also deleting the associated VM Snapshots, in fact we wanted to use these VM snapshots as our recovery points. So, Is it possible to retain the VM snapshots even when the VMs are getting destroyed so that we can pick and choose the desired VM snapshot to recover the VM.
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS