Bug 874171 - virsh should make external checkpoint creation easy
Summary: virsh should make external checkpoint creation easy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 638512
Blocks: 876816 876817
TreeView+ depends on / blocked
 
Reported: 2012-11-07 16:07 UTC by Eric Blake
Modified: 2013-02-21 07:26 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.10.2-8.el6
Doc Type: Bug Fix
Doc Text:
Cause: This release added several capabilities related to snapshots. Among these was the ability create an external snapshot, whether the domain was running or offline. Consequence: With the new features in the underlying libvirt code, it was also necessary to improve the user interface into those features in virsh. Fix: Several snapshot-related improvements were added to virsh, to make it easier to track what properties a snapshot had, and to be able to create an external snapshot. Result: Users will have more control and visibility into the various snapshot options made available in this release of libvirt.
Clone Of:
: 876816 876817 (view as bug list)
Environment:
Last Closed: 2013-02-21 07:26:10 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description Eric Blake 2012-11-07 16:07:48 UTC
Description of problem:
As of the code committed for bug 638512, it is possible to create external checkpoints via hand-written XML and 'virsh snapshot-create', but not possible to use the convenience method 'virsh snapshot-create-as'.

Version-Release number of selected component (if applicable):
v0.10.2-7.el6

How reproducible:
100%

Steps to Reproduce:
1. virsh snapshot-create-as $dom --memspec /path/to/file
2.
3.
  
Actual results:
error, --memspec is unsupported

Expected results:
create an external checkpoint with the memory state saved in /path/to/file

Additional info:
Upstream has this commit:
commit 2cd4d8e506ae80742c29af07eed423cca163d58d
Author: Eric Blake <eblake@redhat.com>
Date:   Tue Nov 6 20:55:53 2012 -0700

    virsh: add snapshot-create-as memspec support
    
    External checkpoints could be created with snapshot-create, but
    without libvirt supplying a default name for the memory file,
    it is essential to add a new argument to snapshot-create-as to
    allow the user to choose the memory file name.  This adds the
    option --memspec [file=]name[,snapshot=type], where type can
    be none, internal, or external.  For an example,
    
    virsh snapshot-create-as $dom --memspec /path/to/file
    
    is the shortest possible command line for creating an external
    checkpoint, named after the current timestamp.
    
    * tools/virsh-snapshot.c (vshParseSnapshotMemspec): New function.
    (cmdSnapshotCreateAs): Use it.
    * tests/virsh-optparse (test_url): Test it.
    * tools/virsh.pod (snapshot-create-as): Document it.

Comment 3 Huang Wenlong 2012-11-14 05:57:06 UTC
Verify this bug with 
libvirt-0.10.2-8.el6.x86_64

# virsh snapshot-create-as  test ex-s3  --diskspec vda --memspec /tmp/ex-s3
Domain snapshot ex-s3 created


# virsh snapshot-list test
 Name                 Creation Time             State
------------------------------------------------------------
 ex-s3                2012-11-14 13:54:40 +0800 running

#virsh snapshot-dumpxml test  ex-s3

<domainsnapshot>
  <name>ex-s3</name>
  <state>running</state>
  <parent>
    <name>ex-s2</name>
  </parent>
  <creationTime>1352872480</creationTime>
  <memory snapshot='external' file='/tmp/ex-s3'/>
  <disks>
    <disk name='vda' snapshot='external'>
      <driver type='qcow2'/>
      <source file='/var/lib/libvirt/images/test.ex-s3'/>
    </disk>
  </disks>
  <domain type='kvm'>
....

Comment 4 Eric Blake 2012-11-14 13:29:36 UTC
Also possible - for an offline domain, this now creates an external snapshot:
virsh snapshot-create-as $dom --disk-only

Comment 5 Huang Wenlong 2012-11-15 03:19:13 UTC
(In reply to comment #4)
> Also possible - for an offline domain, this now creates an external snapshot:
> virsh snapshot-create-as $dom --disk-only

Hi, Eric 

I try it with  but failed 
qemu-kvm-rhev-0.12.1.2-2.331.el6.x86_64
libvirt-0.10.2-8.el6.x86_64


# virsh snapshot-create-as bug --disk-only
error: unsupported configuration: disk snapshots of inactive domains not implemented yet

Comment 6 Eric Blake 2012-11-15 03:22:11 UTC
(In reply to comment #5)
> # virsh snapshot-create-as bug --disk-only
> error: unsupported configuration: disk snapshots of inactive domains not
> implemented yet

Ah, for that, we need a series of additional patches.  I guess it's time to clone a new BZ.

Comment 7 Eric Blake 2012-11-15 03:27:21 UTC
see bug 876816 for offline disk-only snapshots

Comment 8 Eric Blake 2012-11-15 03:31:56 UTC
see bug 876817 for making virsh display whether a snapshot is internal or external, and filtering on that property

Comment 9 errata-xmlrpc 2013-02-21 07:26:10 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/RHSA-2013-0276.html


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