| 49 | |
| 50 | ## KVM |
| 51 | |
| 52 | yum install kvm qemu-kvm python-virtinst libvirt libvirt-python virt-manager libguestfs-tools policycoreutils-python bridge-utils |
| 53 | |
| 54 | mkdir -p /opt/kvm |
| 55 | qemu-img create -f qcow2 /opt/kvm/template.qcow2 22G |
| 56 | |
| 57 | virt-install \ |
| 58 | --connect qemu:///system \ |
| 59 | --virt-type kvm \ |
| 60 | --description "Which is the template for VMs" \ |
| 61 | --name template \ |
| 62 | --vcpus 4 \ |
| 63 | --ram 8192 \ |
| 64 | --cdrom /opt/kvm/CentOS-6.7-x86_64-minimal.iso \ |
| 65 | --os-type linux \ |
| 66 | --os-variant rhel6 \ |
| 67 | --disk path=/opt/kvm/template.qcow2,format=qcow2 \ |
| 68 | --network bridge=br0 \ |
| 69 | --graphics vnc,listen=0.0.0.0 |
| 70 | |