Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 874171 - virsh should make external checkpoint creation easy
virsh should make external checkpoint creation easy
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Eric Blake
Virtualization Bugs
:
Depends On: 638512
Blocks: 876816 876817
  Show dependency treegraph
 
Reported: 2012-11-07 11:07 EST by Eric Blake
Modified: 2013-02-21 02:26 EST (History)
9 users (show)

See Also:
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.
Story Points: ---
Clone Of:
: 876816 876817 (view as bug list)
Environment:
Last Closed: 2013-02-21 02:26:10 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker 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 16:18:26 EST

  None (edit)
Description Eric Blake 2012-11-07 11:07:48 EST
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 00:57:06 EST
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 08:29:36 EST
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-14 22:19:13 EST
(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-14 22:22:11 EST
(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-14 22:27:21 EST
see bug 876816 for offline disk-only snapshots
Comment 8 Eric Blake 2012-11-14 22:31:56 EST
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 02:26:10 EST
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.