原创博文
安装配置KVM web管理kvm kvm系统安装 KVM克隆&快照
#KVM克隆 快照
1 本机直接克隆virt-clone -o test1 -n test2 -f /kvm/img/test2.qcow2virsh start test2 #启动后,修改hostname、IP等#2 复制文件方法克隆(相当于备份配置+磁盘,可做迁移)virsh list --allvirsh dumpxml test1 > /etc/libvirt/qemu/centos6.xmlcp /kvm/img/test1.qcow2 /kvm/img/centos6.qcow2vim /etc/libvirt/qemu/centos6.xml #修改name、UUID、磁盘源、VNC端口virsh define /etc/libvirt/qemu/centos6.xml #重新定义配置文件virsh start centos6 #启动后,修改hostname、IP等( 删除/etc/udev/rules.d/70-persistent-net.rules )#3 连接克隆(磁盘qcow2格式作为一个快照使用,节省磁盘空间)cat /etc/sysconfig/network-scripts/ifcfg-eth0 #删除MAC绑定rm -f /etc/udev/rules.d/70-persistent-net.ruleshaltcd /kvm/imgqemu-img create -f qcow2 -b test2.qcow2 test12.qcow2 #关键,创建连接磁盘virsh dumpxml test2 > /etc/libvirt/qemu/test12.xmlvim /etc/libvirt/qemu/test12.xml #修改name、UUIDvirsh define /etc/libvirt/qemu/test12.xml##########################快照 (内置)#qemu-img snapshot -l /kvm/img/test12.qcow2 #查看磁盘快照virsh snapshot-list test12 #查看快照virsh snapshot-create test12 #生成快照virsh snapshot-create-as test12 snap1 #自定义快照名virsh snapshot-revert test12 snap1 #快照恢复虚拟virsh snapshot-delete test12 snapname #删除指定快照virsh snapshot-current test12