Bug 1519002

Summary: RFE: libvirt - improve support for external snapshots (merge, delete, virsh, etc)
Product: Red Hat Enterprise Linux 9 Reporter: Ademar Reis <areis>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
libvirt sub component: Storage QA Contact: Han Han <hhan>
Status: ASSIGNED --- Docs Contact:
Severity: high    
Priority: high CC: accounts+fedora, ailan, aliang, andrew, briasmit, coli, dyuan, eblake, germano, gveitmic, hhan, jsuchane, jwatt, knoel, lersek, libvirt-maint, lmen, luizluca, marcandre.lureau, me, mike, mwest, phrdina, pkrempa, pmores, rm, shipatil, skobyda, smitterl, timao, virt-maint, xuzhang, yafu, ymankad
Version: 9.0Keywords: FutureFeature, Triaged
Target Milestone: beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1402581 Environment:
Last Closed: Type: Feature Request
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: 2173142, 2174397, 2174700, 1402581, 1519001, 2170826    
Bug Blocks: 1214187, 1342543, 1403951, 1431852, 1621944, 1997885, 2132850    

Comment 5 Peter Krempa 2020-06-30 20:05:46 UTC
There are multiple options how to create an external snapshot:

1) using virsh snapshot-create-as (see man page for further explanation):

1.1) if the VM is active, but the user doesn't want to take a snapshot of the memory

  virsh snapshot-create-as $VMNAME --disk-only

1.2) if the vm is active and memory snapshot is required
 
  virsh snapshot-create-as $VMNAME --memspec file=/path/to/memory-image,snapshot=external

1.3) if disks which take part of the snapshot need to be controlled:

  virsh snapshot-create-as $VMNAME --memspec file=/path/to/memory-image,snapshot=external --diskspec vda,snapshot=no --diskspec vdb,file=/path/to/overlay-img

1.4) any additional options such as snapshot name, description etc can be controlled using additional parameters. Please refer to the man page:

https://libvirt.org/manpages/virsh.html#snapshot-create-as

2) using virsh snapshot create

This option requires an XML document describing the snapshot as argument. Please refer to the documentation.

For inspiration, a sample XML can be obtained using the '--print-xml' argument for 'virsh snapshot-create-as' which prints the XML the command generates.

snapshot XML documentation:

https://libvirt.org/formatsnapshot.html

Please note, that while creating external snapshots works, we don't yet have implementation for reverting or deleting external snapshots, thus internal snapshots must be supported until then.

Regarding customer's question, rhel-7.6 already supports external snapshots to the extent above.

If required there are manual steps which allow reversion or deletion of external snapshots.