Get the App
SLTechnology News&Howtos  ›  Servers  › 

Example Analysis of Snapshot Management for backup and restore of KVM Virtual Machine

Shulou Source: shulou.com Published: 2022-05-31 18:32:54 10月04日 Update

Editor to share with you the KVM virtual machine backup and restore snapshot management example analysis, I hope you will learn something after reading this article, let's discuss it together!

Assume that the vm1 virtual machine is installed and running

Create a xml file, vm1_snapshot.xml, with the following contents:

Vm1_snapshot

Ubuntu 12.10 AMD64 server

Now run the following command to create the snapshot for vm1:

Virsh snapshot-create vm1. / vm1_snapshot.xml

Domain snapshot vm1_snapshot created from'. / vm1_snapshot.xml'

Now check vm1's snapshot.

Virsh snapshot-list vm1

Name Creation Time State

Vm1_snapshot 2012-11-14 14:46:44 + 0800 running

Now log in to the running vm1 and add a file under / root/

Touch xy

OK, replace the current vm1 with vm1_snapshot (or restore vm1 to the state saved by vm1_snapshot)

Virsh snapshot-revert vm1 vm1_snapshot

Log in to vm1 again and there is no xy file under / root. The restore was successful.

If you do not need this vm1_snapshot, you can delete it with the following command:

Virsh snapshot-delete vm1 vm1_snapshot

Domain snapshot vm1_snapshot deleted

Root@host2:~/kvm# virsh snapshot-list vm1

Name Creation Time State

After reading this article, I believe you have some understanding of "sample analysis of snapshot management for backup and restore of KVM virtual machines". If you want to know more about it, please follow the industry information channel and thank you for reading!

Tags: Files runs backups snapshots examples analysis management commands articles face-to-face login success content again done more ongoing status knowledge industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MariaDB Huawei Microsoft Xiaomi