美文网首页Kvm虚拟化
Kvm之一:虚拟化环境

Kvm之一:虚拟化环境

作者: 词穷又词贫 | 来源:发表于2017-01-13 17:10 被阅读114次

Centos7 Kvm 环境安装

1、关闭防火墙与selinux
systemctl stop firewalld.service    #关闭防火墙
systemctl disable firewalld.service     #禁止防火墙开机自启动
setenforce 0    #关闭selinux
sed -i 's/=enforcing/=disabled/' /etc/selinux/config    #关闭selinux,重启生效
2、检查虚拟化环境
[root@node71 ~]# egrep '(vmx|svm)' --color=always /proc/cpuinfo
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi ept vpid xsaveopt
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi ept vpid xsaveopt
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi ept vpid xsaveopt
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi ept vpid xsaveopt
[root@node71 ~]# lsmod | grep kvm
kvm_intel             162153  0 
kvm                   525259  1 kvm_intel
[root@node71 ~]# 
3、准备网络虚拟化(实际环境应该是采用openvswitch)
yum install bridge-utils -y
[root@node71 ~]# cp /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-br0
[root@node71 ~]# cat /etc/sysconfig/network-scripts/ifcfg-br0 
TYPE=Bridge
BOOTPROTO=static
NAME=br0
DEVICE=br0
ONBOOT=yes
IPADDR=192.168.2.109
NETMASK=255.255.0.0
GATEWAY=192.168.0.1
DNS1=192.168.0.1
[root@node71 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eno16777736 
TYPE=Ethernet
NAME=eno16777736
DEVICE=eno16777736
ONBOOT=yes
BRIDGE=br0
[root@node71 ~]# systemctl restart network.service
[root@node71 ~]# brctl show
bridge name bridge id       STP enabled interfaces
br0     8000.000c2930cac9   no      eno16777736
virbr0      8000.525400995698   yes     virbr0-nic
[root@node71 ~]# 
4、安装虚拟化软件
yum -y install libvirt bridge-utils virt-manager qemu-kvm-tools virt-viewer virt-v2v libguestfs-tools -y
[root@node71 ~]# systemctl start libvirtd.service
[root@node71 ~]# systemctl enable libvirtd.service
[root@node71 ~]# systemctl status libvirtd.service
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
   Active: active (running) since 一 2016-10-10 16:52:02 CST; 4min 17s ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 5193 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           ├─2131 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
           ├─2133 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
           └─5193 /usr/sbin/libvirtd

10月 10 16:52:02 node71 systemd[1]: Starting Virtualization daemon...
10月 10 16:52:02 node71 libvirtd[5193]: 2016-10-10 08:52:02.799+0000: 5193: info : libvirt version: 1.2.17, package: 13.el7_2.5 (CentOS BuildSystem <http://bugs.centos.o....centos.org)
10月 10 16:52:02 node71 libvirtd[5193]: 2016-10-10 08:52:02.799+0000: 5193: warning : virGetHostname:667 : getaddrinfo failed for 'node71': 未知的名称或服务
10月 10 16:52:02 node71 systemd[1]: Started Virtualization daemon.
10月 10 16:52:03 node71 dnsmasq[2131]: read /etc/hosts - 2 addresses
10月 10 16:52:03 node71 dnsmasq[2131]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
10月 10 16:52:03 node71 dnsmasq-dhcp[2131]: read /var/lib/libvirt/dnsmasq/default.hostsfile
10月 10 16:56:14 node71 systemd[1]: Started Virtualization daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@node71 ~]# rpm -qf /usr/lib/systemd/system/lib
libstoragemgmt.service  libvirtd.service        libvirtd.socket         libvirt-guests.service  
[root@node71 ~]# rpm -qf /usr/lib/systemd/system/libvirtd.service 
libvirt-daemon-1.2.17-13.el7_2.5.x86_64
[root@node71 ~]# 
[root@node71 ~]# virsh list --all
 Id    名称                         状态
----------------------------------------------------

[root@node71 ~]# ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm
"/usr/bin/qemu-kvm" -> "/usr/libexec/qemu-kvm"
[root@node71 ~]# 

相关文章

  • Kvm之一:虚拟化环境

    Centos7 Kvm 环境安装 1、关闭防火墙与selinux 2、检查虚拟化环境 3、准备网络虚拟化(实际环境...

  • KVM虚拟化

    kvm实验 环境准备,我这里使用虚拟机进行模拟,先设定好虚拟化 进入系统查看是否支持虚拟化 KVM:Kernel-...

  • 20171207 虚拟化

    虚拟化技术概览KVM简介KVM的管理操作 一、虚拟化技术概览 (一)虚拟化技术类型: 主机虚拟化:xen, kvm...

  • 36-虚拟化

    本章内容 ◆ 虚拟化基础◆ 虚拟化技术之KVM◆ kvm实战案例 一:虚拟化基础 https://www.vmwa...

  • 2019-05-20 kvm虚拟化

    1:什么是虚拟化? 2:为什么要用虚拟化? 3:kvm虚拟化管理软件的安装 4:安装一台kvm虚拟机 5:kvm虚...

  • docker(一)

    1.什么是容器? 2.容器和虚拟化的区别 linux容器技术,容器虚拟化和kvm虚拟化的区别 kvm虚拟化: 需要...

  • KVM性能优化之内存篇

    kvm内存优化: EPT 技术 ​ 在虚拟化环境下,intel开创的硬件辅助内存虚拟化技术。即扩展页表EPT,...

  • KVM虚拟化服务

    KVM虚拟化服务 环境准备 vmware workstation 15 linux系统:CentOS-7.6需要将...

  • KVM 虚拟化环境安装

    修改内核模式为内核启动:vi /boot/grub2/grub.cfgdefaults=1 关闭selinux 关...

  • 虚拟化

    目录 一、了解虚拟化二、常见虚拟化软件三、虚拟化架构四、KVM介绍五、Centos7上安装KVM六、配置网卡七、创...

网友评论

    本文标题:Kvm之一:虚拟化环境

    本文链接:https://www.haomeiwen.com/subject/lbusbttx.html