To create a snapshot of a Linux KVM virtual machine (VM) or domain, you can use the virsh
command. virsh
is a command-line tool for managing KVM domains (VMs).
Here is an example of how to create a snapshot of a KVM domain using virsh
:
Connect to the KVM host using ssh
.
List the available domains using the list
command:
virsh list
This will display a list of the domains on the KVM host, along with their ID and state.
suspend
command. Replace domain
with the name or ID of the domain:virsh suspend domain
snapshot-create-as
command. Replace domain
with the name or ID of the domain, and snapshotname
with the desired name for the snapshot:virsh snapshot-create-as domain snapshotname
This will create a snapshot of the domain with the specified name.
resume
command:virsh resume domain