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.

Bug 874171

Summary: virsh should make external checkpoint creation easy
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.4CC: acathrow, dallan, dyasny, dyuan, eblake, mzhan, rwu, whuang, zhpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 07:26:10 UTC Type: Bug
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: 638512    
Bug Blocks: 876816, 876817    

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>
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