Linux KVM Virtualization Manual Low-Level Guest Export/Import Procedure: Difference between revisions
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
This is the procedure to [[Linux_Virtualization_Concepts#KVM_Virtual_Machine_Snapshot|snapshot a KVM virtual machine]]. It consists in taking snapshots of its XML definition and performing snapshots of all its storage devices. | This is the procedure to [[Linux_Virtualization_Concepts#KVM_Virtual_Machine_Snapshot|snapshot a KVM virtual machine]]. It consists in taking snapshots of its XML definition and performing snapshots of all its storage devices. | ||
= | =Take a Virtual Machine Snapshot= | ||
{{Warn|If the virtual machine has more than one storage device attached, they all must be snapshot at the same time to produce a consistent snapshot that can be reverted to.}} | {{Warn|If the virtual machine has more than one storage device attached, they all must be snapshot at the same time to produce a consistent snapshot that can be reverted to.}} | ||
==Shutdown the Target Guest== | |||
[[virsh shutdown]] ''<vm-name>'' | [[virsh shutdown]] ''<vm-name>'' | ||
==Identify all Storage Devices== | |||
[[virsh dumpxml]] ''<vm-name>'' | [[virsh dumpxml]] ''<vm-name>'' | ||
Line 29: | Line 27: | ||
</disk> | </disk> | ||
==Snapshot Each Storage Device== | |||
qemu-img snapshot -c <snapshot-tag> <volume-name> | qemu-img snapshot -c <snapshot-tag> <volume-name> |
Revision as of 17:57, 4 July 2017
Internal
Overview
This is the procedure to snapshot a KVM virtual machine. It consists in taking snapshots of its XML definition and performing snapshots of all its storage devices.
Take a Virtual Machine Snapshot
If the virtual machine has more than one storage device attached, they all must be snapshot at the same time to produce a consistent snapshot that can be reverted to.
Shutdown the Target Guest
virsh shutdown <vm-name>
Identify all Storage Devices
virsh dumpxml <vm-name>
Look for <disk> definitions. The disk definition specifies the source and the format of the virtual storage device. Example:
<disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/main-storage-pool/appproxy.qcow2'/> ... </disk>
Snapshot Each Storage Device
qemu-img snapshot -c <snapshot-tag> <volume-name>
For more details about snapshot mechanics, see
qemu-img snapshot -c
Restore from Snapshot
Perform the steps described in the "" section in reverse order.
Alternative
Alternative suing qemu-img create. See