制作快照使用xen管理命令和qemu-img来做的,前台发起一个动作,后台执行一个写入执行快照命令的shell脚本
创建快照有三步:
1.xm save vm vmpath/state.snapshot.snapshot_id
2.qemu-img snapshot -c snapshot.snapshot_id vmpath/disk
3.xm restore vmpath/state.snapshot.snapshot_id
2.qemu-img snapshot -a snapshot.snapshot_id vmpath/disk
1.qemu-img snapshot -d snapshot.snapshot_id vmpath/disk
2.rm -f vmpath/state.snapshot.snapshot_id
创建快照有三步:
1.xm save vm vmpath/state.snapshot.snapshot_id
2.qemu-img snapshot -c snapshot.snapshot_id vmpath/disk
3.xm restore vmpath/state.snapshot.snapshot_id
快照回滚
1.xm destroy vm2.qemu-img snapshot -a snapshot.snapshot_id vmpath/disk
3.xm restore vmpath/state.snapshot.snapshot_id
1.qemu-img snapshot -d snapshot.snapshot_id vmpath/disk
2.rm -f vmpath/state.snapshot.snapshot_id