码迷,mamicode.com
首页 > 其他好文 > 详细

openshift 4 kvm+ovs install

时间:2020-07-01 09:19:18      阅读:74      评论:0      收藏:0      [点我收藏+]

标签:restore   ble   hub   虚拟   dir   hot   tac   资料   主机   

https://github.com/wangzheng422/docker_env/blob/master/redhat/ocp4/4.4/4.4.ovs.md

openshift 4 kvm+ovs install

openshift4在日常的安装场景中,有这样一个情况,就是需要在多台配置小一些的主机上,实现跨主机的集群安装,这就需要多个kvm跨主机通讯,本来使用bridge方式,搭配可直连的ip地址,是可以满足的,但是由于ip地址管理的限制,我们没有可以直连的ip地址,那么我们就需要ovs+vxlan的方式,来解决这个问题。

本文模拟2台主机,讲述如何配置ovs,以及如何启动kvm。

参考资料:

mtu 调整:

vxlan

on redhat-01


yum -y install openvswitch2.11 NetworkManager-ovs
# install pkg for vnc and kvm

systemctl enable --now openvswitch
systemctl status openvswitch

systemctl enable --now libvirtd

cat << ‘EOF‘ > /etc/sysconfig/network-scripts/ifcfg-br-int 
DEVICE=br-int
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
HOTPLUG=no
IPADDR=192.168.7.1
PREFIX=24
MTU=1450
EOF

cat << ‘EOF‘ > /etc/sysconfig/network-scripts/ifcfg-vxlan1
DEVICE=vxlan1
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSTunnel
OVS_BRIDGE=br-int
OVS_TUNNEL_TYPE=vxlan
OVS_TUNNEL_OPTIONS="options:remote_ip=172.29.159.100"
BOOTPROTO=static
HOTPLUG=no
EOF

systemctl restart network

ovs-vsctl show

ovs-vsctl set int br-int mtu_request=1450
# ovs-vsctl set int br-int mtu_request=[]

mkdir -p /data/kvm
cd /data/kvm

cat << ‘EOF‘ > ovsnet.xml
<network>
  <name>br-int</name>
  <forward mode=‘bridge‘/>
  <bridge name=‘br-int‘/>
  <virtualport type=‘openvswitch‘/>
</network>
EOF

virsh net-define ovsnet.xml
virsh net-start br-int
virsh net-autostart br-int

on redhat-02

 
yum -y install openvswitch2.11 NetworkManager-ovs
# install pkg for vnc and kvm

systemctl enable --now openvswitch
systemctl status openvswitch

systemctl enable --now libvirtd

ovs-vsctl show

cat << ‘EOF‘ > /etc/sysconfig/network-scripts/ifcfg-br-int 
DEVICE=br-int
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
HOTPLUG=no
IPADDR=192.168.7.2
PREFIX=24
MTU=1450
EOF

cat << ‘EOF‘ > /etc/sysconfig/network-scripts/ifcfg-vxlan1
DEVICE=vxlan1
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSTunnel
OVS_BRIDGE=br-int
OVS_TUNNEL_TYPE=vxlan
OVS_TUNNEL_OPTIONS="options:remote_ip=172.29.159.99"
BOOTPROTO=static
HOTPLUG=no
EOF

systemctl restart network

ovs-vsctl show

ovs-vsctl set int br-int mtu_request=1450

mkdir -p /data/kvm
cd /data/kvm

cat << ‘EOF‘ > ovsnet.xml
<network>
  <name>br-int</name>
  <forward mode=‘bridge‘/>
  <bridge name=‘br-int‘/>
  <virtualport type=‘openvswitch‘/>
</network>
EOF

virsh net-define ovsnet.xml
virsh net-start br-int
virsh net-autostart br-int

# restore
virsh net-undefine br-int
virsh net-destroy br-int


创建虚拟机


mkdir -p /data/kvm
cd /data/kvm

lvremove -f datavg/helperlv
lvcreate -y -L 230G -n helperlv datavg

# 230G
virt-install --name="ocp4-aHelper" --vcpus=2 --ram=4096 --disk path=/dev/datavg/helperlv,device=disk,bus=virtio,format=raw --os-variant centos7.0 --network network:br-int,model=virtio --boot menu=on --location /data/kvm/rhel-server-7.8-x86_64-dvd.iso --initrd-inject /data/kvm/helper-ks.cfg --extra-args "inst.ks=file:/helper-ks.cfg" 

openshift 4 kvm+ovs install

标签:restore   ble   hub   虚拟   dir   hot   tac   资料   主机   

原文地址:https://www.cnblogs.com/wandering-star/p/13217210.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!