[toc]
kvm之快照管理
使用kvm快照,磁盘则必需要使用qcow2的格式
| |
| image: centos6.test-x86_64.raw |
| file format: raw |
| virtual size: 80G (85899345920 bytes) |
| disk size: 1.2G |
| |
关闭虚拟机并改变磁盘的格式
| |
| Id 名称 状态 |
| ---------------------------------------------------- |
| 2 ubuntu-14.4-n1 running |
| 14 ubuntu-14.4-113-pycharm running |
| 16 ubuntu-14.4-n2 running |
| 20 centos-6.8-grafana running |
| 22 centos-6.8-data running |
| 24 centos-6.8-test running |
| |
| 域 centos-6.8-test 被删除 |
| |
| Id 名称 状态 |
| ---------------------------------------------------- |
| 2 ubuntu-14.4-n1 running |
| 14 ubuntu-14.4-113-pycharm running |
| 16 ubuntu-14.4-n2 running |
| 20 centos-6.8-grafana running |
| 22 centos-6.8-data running |
| - centos-6.8-n1 关闭 |
| - centos-6.8-test 关闭 |
| - renjin-scripts 关闭 |
| - ubuntu-14.4-n3 关闭 |
| |
| |
| <disk type='file' device='disk'> |
| <driver name='qemu' type='qcow2' cache='none'/> |
| <source file='/media/67cbdcec-6419-4571-9632-c605b3e2b910/data/centos6.test-x86_64.qcow2'/> |
查看管理快照的命令有哪些
| |
| iface-begin create a snapshot of current interfaces settings, which can be later committed (iface-commit) or restored (iface-rollback) |
| Snapshot (help keyword 'snapshot') |
| snapshot-create Create a snapshot from XML |
| snapshot-create-as Create a snapshot from a set of args |
| snapshot-current Get or set the current snapshot |
| snapshot-delete Delete a domain snapshot |
| snapshot-dumpxml Dump XML for a domain snapshot |
| snapshot-edit edit XML for a snapshot |
| snapshot-info snapshot information |
| snapshot-list List snapshots for a domain |
| snapshot-parent Get the name of the parent of a snapshot |
| snapshot-revert Revert a domain to a snapshot |
创建快照
| |
| |
| 名称 Creation Time 状态 |
| ------------------------------------------------------------ |
| 1509359245 2017-10-30 18:27:25 +0800 shutoff |
| |
快照恢复
查看哪些快照需要恢复
| |
| Id 名称 状态 |
| ---------------------------------------------------- |
| 2 ubuntu-14.4-n1 running |
| 14 ubuntu-14.4-113-pycharm running |
| 16 ubuntu-14.4-n2 running |
| 20 centos-6.8-grafana running |
| 22 centos-6.8-data running |
| 25 centos-6.8-test running |
| - centos-6.8-n1 关闭 |
| - renjin-scripts 关闭 |
| - ubuntu-14.4-n3 关闭 |
| |
| 名称 Creation Time 状态 |
| ------------------------------------------------------------ |
| 1509359245 2017-10-30 18:27:25 +0800 shutoff |
| |
| 域 centos-6.8-test 被删除 |
| |
| |
| |
| |
快照的删除
| |
| 名称 Creation Time 状态 |
| ------------------------------------------------------------ |
| 1509359245 2017-10-30 18:27:25 +0800 shutoff |
| |
| |
补充:在宿主机关机后,启动kvm遇以下问题:
| # virsh start centos-7.2-xxxxxxxx |
| 错误:开始域 centos-7.2-xxxxxxx失败 |
| 错误:Unable to read from monitor: Connection reset by peer |
| # virsh managedsave-remove centos-6.8-grafana |
| # virsh start centos-7.2-xxxxxxxxx |
| 域 centos-7.2-xxxxxxxxx 已开始 |