Bug 733806

Summary: libvirt should reject snapshots of autodestroy domains
Product: Red Hat Enterprise Linux 6 Reporter: Eric Blake <eblake>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: dyuan, mzhan, nzhang, rwu, veillard, whuang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.4-7.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:27:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 638510, 735011    

Description Eric Blake 2011-08-26 23:12:19 UTC
Description of problem:
When auto-destroy domains were introduced in upstream 0.9.3, they were documented as not working on migrate (makes sense, because migrate would change which connection owns the domain and autodestroy kicks in) or save/restore (a bit weaker, but makes sense when thinking of save/restore as migration to file).  However, it left out snapshots (another form of save/restore), and as implemented, the qemu driver actually ended up forbidding pause rather than save actions on autodestroy domains.

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

How reproducible:
100%

Steps to Reproduce:
1. create a domain marked autodestroy (for example, 'virsh create xml --autodestroy)
2. 'virsh pause dom'
3. 'virsh snapshot-create dom'
4. 'virsh save dom file'
  
Actual results:
1. created and running
2. rejected
3. succeeds
4. succeeds

Expected results:
1. created and running
2. succeeds
3. rejected
4. rejected


Additional info:

Comment 1 Eric Blake 2011-08-26 23:14:45 UTC
(In reply to comment #0)
> Steps to Reproduce:
> 1. create a domain marked autodestroy (for example, 'virsh create xml
> --autodestroy)
> 2. 'virsh pause dom'
> 3. 'virsh snapshot-create dom'
> 4. 'virsh save dom file'

Correction - for an autodestroy domain to be tested, it has to be done within a single connection - you have to use batch commands or the virsh shell:

0. virsh # start the shell
1. create xml
2. pause dom
3. snapshot-create dom
4. save dom file
5. quit

Comment 2 Eric Blake 2011-08-26 23:15:49 UTC
Getting this fixed is a prereq to bug 638510 support for live snapshots via the
snapshot_blkdev qemu monitor command.

Comment 3 Eric Blake 2011-08-26 23:37:47 UTC
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2011-August/msg01381.html

Comment 6 Nan Zhang 2011-09-01 06:34:31 UTC
Test with libvirt-0.9.4-7.el6.x86_64. As expected results, move it to VERIFIED.


[root@localhost ~]# virsh
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # create foo.xml --autodestroy
Domain foo created from foo.xml

virsh # suspend foo
Domain foo suspended

virsh # snapshot-create foo
error: Requested operation is not valid: domain is marked for auto destroy

virsh # save foo /tmp/foo
error: Failed to save domain foo to /tmp/foo
error: Requested operation is not valid: domain is marked for auto destroy

virsh # quit

Comment 7 Eric Blake 2011-09-01 13:46:35 UTC
Unfortunately, this caused a regression, tracked in bug 735011

Comment 8 errata-xmlrpc 2011-12-06 11:27:36 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