| 1 | = KVM (Kernel-based Virtual Machine) = |
| 2 | |
| 3 | {{{ |
| 4 | |
| 5 | ## VM Remove |
| 6 | virsh undefine test102 |
| 7 | virsh undefine test102 --managed-save |
| 8 | virsh undefine test103 --remove-all-storage |
| 9 | |
| 10 | ## VM Clone |
| 11 | virt-clone --original template --name test101 --file /opt/kvm/test101.qcow2 |
| 12 | |
| 13 | ################################################################################ |
| 14 | |
| 15 | ## VM Initialize |
| 16 | |
| 17 | NNAME=test101 |
| 18 | NIP=10.59.72.101 |
| 19 | |
| 20 | sed -i "/^HOSTNAME/ s/template/$NNAME/" /etc/sysconfig/network |
| 21 | sed -i "/^IPADDR/ s/10.59.72.100/$NIP/" /etc/sysconfig/network-scripts/ifcfg-eth0 |
| 22 | cat /dev/null >/etc/udev/rules.d/70-persistent-net.rules |
| 23 | |
| 24 | init 6 |
| 25 | |
| 26 | ################################################################################ |
| 27 | |
| 28 | }}} |
| 29 | |