KVM虚拟机克隆及快照管理

  一,克隆

  查看虚拟机硬盘位置(其中centos1为虚拟机名称)

virsh edit centos1

  克隆(centos1为需要克隆的虚拟机名称centos2为克隆后的虚拟机名称CentOS2.qcow2位克隆后的虚拟机硬盘位置)

virt-clone -o centos1 -n centos2 -f /opt/CentOS2.qcow2

  验证

 virsh list --all

  

  二,快照

  查看快照(其中centos1为虚拟机名称)

virsh snapshot-list centos1

  生成快照

virsh snapshot-create centos1

  默认生成快照是以时间戳命名

  指定生成快照的名称

virsh snapshot-create-as centos1 centos1_20180411

  恢复快照(centos1为虚拟机名称后面为快照名)

virsh snapshot-revert centos1 1523413746

  删除快照

virsh snapshot-delete centos1 1523413080

  

原文地址:https://www.cnblogs.com/minseo/p/8794226.html