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.
Bug 729714 - libvirt managedsave incompatible with transient domains
Summary: libvirt managedsave incompatible with transient domains
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-10 15:35 UTC by Eric Blake
Modified: 2011-12-06 11:26 UTC (History)
6 users (show)

Fixed In Version: libvirt-0.9.4-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 11:26:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1513 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-12-06 01:23:30 UTC

Description Eric Blake 2011-08-10 15:35:01 UTC
Description of problem:
The fix to bug 697742 made it impossible to undefine a domain if managed save state still exists, since otherwise, the existing managedsave data can interfere with a new domain created by the same name.  However, this overlooked one aspect - transient domains cannot be undefined, but cease to exist once the qemu process stops; yet the managedsave process causes the qemu process to stop.  Thus, attempts to use managedsave on a transient domain will create stale state files that can interfere with the creation of new domains.

Version-Release number of selected component (if applicable):
libvirt-0.9.4-2.el6

How reproducible:
found by code inspection, but I suspect it is possible to write a test case with 100% reproduction

Steps to Reproduce (untested, based on steps in bug 697742):
1. create a transient domain "dom"
2. virsh managedsave dom
3. note that 'virsh start dom' won't work, since dom no longer exists
4. define a new persistent domain named dom but with a different uuid
5. virsh start dom
  
Actual results:
since step 2 succeeded, step 5 ends up trying to revive the managedsave associated with the old transient 'dom', instead of booting the new persistent 'dom' from scratch, and fails due to uuid collision.

Expected results:
step 2 should be rejected - managedsave of a transient domain does not make sense

Additional info:
Patch proposed upstream, awaiting feedback on whether rejection is right, or whether the patch should be rewritten to permit managedsave on transient domains by temporarily making the domain persistent.
https://www.redhat.com/archives/libvir-list/2011-August/msg00339.html

Comment 1 Daniel Veillard 2011-08-11 03:06:44 UTC
I ACK'ed the patch upstream as I think that by definition transient domains
are to be managed by the application on top of libvirt. That's a design choice
and I think the API is consistent with this, in that case really it's a missing
check from my POV,

Daniel

Comment 2 Daniel Veillard 2011-08-15 02:43:10 UTC
Commited upstream as 0de75e855b0c37a7ef25370b19cabad34e679ce6

Comment 4 dyuan 2011-08-16 08:02:10 UTC
Reproduce this issue with libvirt-0.9.4-2.el6.

# virsh create dom.xml 
Domain dom-create created from dom.xml

# virsh list --all
 Id Name                 State
----------------------------------
  8 dom-create           running

# virsh managedsave dom-create
Domain dom-create state saved by libvirt

# virsh list --all
 Id Name                 State
----------------------------------

# virsh define dom.xml 
Domain dom-create defined from dom.xml

# virsh start dom-create
error: Failed to start domain dom-create
error: operation failed: cannot restore domain 'dom-create' uuid a89394e5-d6d5-e87b-a270-8246ecbb3a98 from a file which belongs to domain 'dom-create' uuid 4d662f3b-99ff-4b31-60cb-7b7fa1f922be


Verified PASS with libvirt-0.9.4-4.el6.

# virsh create dom.xml 
Domain dom-create created from dom.xml

# virsh list --all
 Id Name                 State
----------------------------------
  8 dom-create           running

# virsh managedsave dom-create
error: Failed to save domain dom-create state
error: Requested operation is not valid: cannot do managed save for transient domain

# virsh list --all
 Id Name                 State
----------------------------------
  8 dom-create           running

Comment 5 errata-xmlrpc 2011-12-06 11:26:05 UTC
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


Note You need to log in before you can comment on or make changes to this bug.