Here’s an example of how to take snapshots.
| 
# libvirtd --version 
libvirtd (libvirt) 0.9.8 
# qemu-system-x86_64 --version 
QEMU emulator version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard 
# uname -ri 
3.2.0-31-generic x86_64 
# tail -1 /etc/lsb-release 
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS" | 
take snapshots of the VM called ubuntu12-04-vm1.
| 
# virsh list --all | grep 10 
 10 ubuntu12-04-vm1      running | 
| 
# time virsh snapshot-create ubuntu12-04-vm1 | 
[ while taking snapshots ]
The VM will be suspended while taking the snapshots.
| 
# virsh list --all | grep 10 
 10 ubuntu12-04-vm1      paused | 
check the status
| 
# virsh snapshot-list ubuntu12-04-vm1 
 Name                 Creation Time             State 
------------------------------------------------------------ 
 1349063425           2012-09-29 12:50:25 +0900 running | 
[ after finishing taking the snapshots ]
In my environment, it took about 13 minutes to take the snapshots.
| 
# time virsh snapshot-create ubuntu12-04-vm1 
Domain snapshot 1349063425 created 
real    13m32.901s 
user    0m0.052s 
sys     0m0.016s | 
| 
# virsh list --all | grep ubuntu12-04-vm1 
 10 ubuntu12-04-vm1      running | 
| 
# virsh snapshot-list ubuntu12-04-vm1 
 Name                 Creation Time             State 
------------------------------------------------------------ 
 1349063425           2012-09-29 12:50:25 +0900 running | 
[ revert the snapshots ]
| 
# virsh list --all | grep ubuntu12-04-vm1 
 11 ubuntu12-04-vm1      running 
# virsh snapshot-list ubuntu12-04-vm1 
 Name                 Creation Time             State 
------------------------------------------------------------ 
 1349063425           2012-09-29 12:50:25 +0900 running | 
| 
# time virsh snapshot-revert ubuntu12-04-vm1 1349063425 
real    0m5.784s 
user    0m0.000s 
sys     0m0.008s | 
delete the snapshot
| 
# time virsh snapshot-delete ubuntu12-04-vm1 1349063425 
Domain snapshot 1349063425 deleted 
real    0m1.330s 
user    0m0.008s 
sys     0m0.000s | 
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.