Red Hat Bugzilla – Bug 671152
Snapshots are not deleted when a domain is undefined
Last modified: 2011-12-01 19:23:49 EST
Description of problem:
I accidentally clicked 'Save' in virt-manager rather than 'Force Off' when shutting down a domain prior to deleting it and its storage. I deleted it anyway, and selected the checkbox to remove its storage volumes. I then imported a new domain with the same name using virt-v2v. After import, virt-manager only gave me the option to 'Restore', not 'Run'. This restored the state of the old guest, which inevitably caused storage corruption.
Version-Release number of selected component (if applicable):
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
This has been fixed upstream in 0.9.4 with
Author: Osier Yang <firstname.lastname@example.org>
Date: Wed Jul 20 10:59:54 2011 +0800
undefine: Define the new API
This introduces a new API virDomainUndefineFlags to control the
domain undefine process, as the existing API virDomainUndefine
doesn't support flags.
Currently only flag VIR_DOMAIN_UNDEFINE_MANAGED_SAVE is supported.
If the domain has a managed save image, including
VIR_DOMAIN_UNDEFINE_MANAGED_SAVE in @flags will also remove that
file, and omitting the flag will cause undefine process to fail.
This patch also changes the behavior of virDomainUndefine, if the
domain has a managed save image, the undefine will be refused.
Backporting that to F14 is impossible without a rebase due to API constraints, and F14 is nearly end-of-life anyway; at this point, the best I can suggest is upgrading to F16 where the fix is already present. I'm marking this as wontfix for F14.