Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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.
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