Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

A.13. Workaround for Creating External Snapshots with libvirt

There are two classes of snapshots for KVM guests:
  • Internal snapshots are contained completely within a qcow2 file, and fully supported by libvirt, allowing for creating, deleting, and reverting of snapshots. This is the default setting used by libvirt when creating a snapshot, especially when no option is specified. This file type take slightly longer than others for creating the snapshot, and has the drawback of requiring qcow2 disks.

    Important

    Internal snapshots are not being actively developed, and Red Hat discourages their use.
  • External snapshots work with any type of original disk image, can be taken with no guest downtime, and are more stable and reliable. As such, external snapshots are recommended for use on KVM guest virtual machines. However, external snapshots are currently not fully implemented on Red Hat Enterprise Linux 7, and are not available when using virt-manager.
    To create an external snapshot, use the snapshot-create-as with the --diskspec vda,snapshot=external option, or use the following disk line in the snapshot XML file:
    <disk name=’vda’ snapshot=’external’>
      <source file=’/path/to,new’/>
    </disk>
    
    At the moment, external snapshots are a one-way operation as libvirt can create them but cannot do anything further with them. A workaround is described on libvirt upstream pages.