CentOS7.1 KVM virtualization environment preparation


 

A, basic platform

 

1. a computer with VMware Windows systems (networking)

 

2.CentOS7.1 64bit mirrors
Second, minimizing a CentOS installation 7.1 VMware virtual machine system CentOS KVM01

 

Requirements: 4G, hard 100G, CPU memory 8 cores (tick in theVirtualization engine: Virtualize Intel VT-x/EPT or AMD-V/RVI, ordoes not support virtualized configurations), minimal installation,turn off firewalld, selinux service.
Three, virtualized environment preparation
1. see if virtualization

 

view plain copy

 

On the CODE view derived code to my snippet

 

grep -E ‘vmx|svm’ /proc/cpuinfo

 

The following in support of Virtualization:

 

2. install the KVM package

 

view plain copy

 

On the CODE view derived code to my snippet

 

yum install qemu-kvm libvirt libvirt-python libguestfs-tools virt-install

 

3. set service libvirtd restart

 

view plain copy

 

On the CODE view derived code to my snippet

 

systemctl enable libvirtd && systemctl start libvirtd

 

Validation:

 

See if the following module is loaded
view plain copy

 

On the CODE view derived code to my snippet

 

[root@kvm01 ~]# lsmod | grep kvm
kvm_intel 148081 0
kvm 461126 1 kvm_intel

 

View the virtual machine environment

 

view plain copy

 

On the CODE view derived code to my snippet

 

[root@kvm01 ~]# virsh -c qemu:///system list
Id 名称 状态
—————————————————-

 

4. configure flexible connection

 

view plain copy

 

On the CODE view derived code to my snippet

 

ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-kvm

 

5. create the following directories

 

view plain copy

 

On the CODE view derived code to my snippet

 

-Images store # KVM virtual machines directory
/Data/ISO # store ISO image directory

 

Four, configuring virtual bridges

 

Edit the/etc/sysconfig/network-scripts/ifcfg-ens33 file, add the following line:

 

view plain copy

 

On the CODE view derived code to my snippet

 

BRIDGE=br0

 

New/etc/sysconfig/network-scripts/ifcfg-br0 file is as follows

 

view plain copy

 

On the CODE view derived code to my snippet

 

TYPE=”Bridge”
BOOTPROTO=static
DEVICE=”br0″
ONBOOT=”yes”
DNS1=10.0.0.2
IPADDR=10.0.0.5
PREFIX=24
GATEWAY=10.0.0.2
DELAY=”0″

 

Configure/etc/sysctl.conf and add the following line

 

view plain copy

 

On the CODE view derived code to my snippet

 

net.ipv4.ip_forward = 1

 

The/etc/sysctl.conf configuration to take effect

 

view plain copy

 

On the CODE view derived code to my snippet

 

sysctl -p /etc/sysctl.conf

 

Service network restart services, the network card configurationto take effect

 

view plain copy

 

On the CODE view derived code to my snippet

 

systemctl restart NetworkManager.service

 

Validation:

 

See network bridge

 

view plain copy

 

On the CODE view derived code to my snippet

 

[root@kvm01 ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no
virbr0 8000.525400940eda yes virbr0-nic

 

Leave a Reply

Your email address will not be published. Required fields are marked *