Hide Forgot
Description of problem: Libvirt can convert a transient guest to persistent (by defining the xml for a running domain), and the public API for virDomainUndefine claimed that the converse of converting a persistent back to transient was possible (by undefining a running domain). However, the qemu driver was rejecting this. Version-Release number of selected component (if applicable): libvirt-0.9.4-7.el6 How reproducible: 100% Steps to Reproduce: 1. create and start a persistent guest 2. use virDomainUndefine to convert it to persistent 3. Actual results: step 2 is rejected by the qemu driver (also, note that bug 735495 also documents that it is rejected by 'virsh undefine'; you'd have to use python, perl, or C bindings to test this to make sure virsh is not in the way) Expected results: after step 2, the domain should still be running, but show up as transient Additional info:
Getting this fixed will help in testing bug 638510 support for live snapshots via the snapshot_blkdev qemu monitor command, since one of the snapshot transitions that must be properly handled is creating an offline snapshot of a persistent guest, starting the guest, converting the guest to transient, then stopping the guest, and seeing if the metadata is properly cleaned up. It also brings the code into compliance with the API documentation. See these upstream commits (the second even includes the test described in the original comment) commit aaa93ab6faa178406d9a472f6002a6985e5ebc72 Author: Osier Yang <jyang> Date: Fri Aug 19 21:49:37 2011 +0800 qemu: Allow to undefine a running domain commit 5f98c437077e2ee7f7cf8c8d8427966d60c7e539 Author: Eric Blake <eblake> Date: Fri Aug 19 08:57:22 2011 -0600 test: rewrite test to match change in behavior Test failure exposed in commit 7d3390f. * tests/undefine: Fix to match updated test driver semantics.
In POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-September/msg00093.html
Reproduce this issue libvirt-0.9.4-7.el6.x86_64: # virsh list --all Id Name State ---------------------------------- 2 rhel6 running # virsh undefine rhel6 error: Failed to undefine domain rhel6 error: Requested operation is not valid: cannot delete active domain Verified this issue with: libvirt-0.9.4-9.el6.x86_64 qemu-kvm-0.12.1.2-2.185.el6.x86_64 # virsh list --all Id Name State ---------------------------------- 2 rhel6 running # virsh undefine 2 Domain 2 has been undefined # virsh shutdown 2 Domain 2 is being shutdown # virsh list Id Name State ---------------------------------- So change the status to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1513.html