openstack neutron 源码安装

  1. 使用vsphere创建虚拟机,配置如下

16U20G1NIC100G

  1. 使用datastorg4下的/centos-hygon.iso镜像

   全部使用默认配置安装,账号密码为root/123456

  1. 安装完成,登陆系统后修改网卡,网盘配置如下,红色为需要修改的配置

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=static

IPADDR=10.0.36.5

NETMASK=255.255.255.0

GATEWAY=10.0.36.254

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=ens160

UUID=328efca1-0455-4652-afb3-004753b4f200

DEVICE=ens160

ONBOOT=yes

PREFIX=24

DNS1=114.114.114.114

DNS2=8.8.8.8

 

 

安装python

1、安装EPEL:

sudo yum -y install epel-release

2、安装IUS软件源:

sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm

3、安装Python3.6:

sudo yum -y install python36u

创建软链接

ln -s /usr/bin/python3.6 /usr/bin/python3

4、安装pip3:

sudo yum -y install python-pip

升级pip

pip install --upgrade pip

安装基础包

yum -y groupinstall "Development tools"

yum install -y python-devel

 

安装openvswitch

wget https://mirrors.aliyun.com/centos/7.6.1810/cloud/x86_64/openstack-ocata/openvswitch-2.9.0-3.el7.x86_64.rpm

 

rpm -ivh openvswitch-2.9.0-3.el7.x86_64.rpm

 

如果缺少包,安装环境依赖,如下,如不缺少正常安装成功,可不安装

yum -y install wget gcc make python-devel openssl-devel kernel-devel graphviz kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool

 

systemctl start openvswitch

 

ovs-vsctl show

显示版本号则安装成功

e49e2c77-036e-4de2-896c-00d71a8d654f

    ovs_version: "2.9.0"

 

 

 

安装git

 yum install -y git

下载neutron源码,切换到4.3分支

cd /opt/

git clone http://10.0.38.187/Cloudview_OVM/neutron.git

git branch -a

选择4.3分支

git checkout remotes/origin/4.3-master

 

在/opt/neutron下安装neutron依赖

pip install -r requirements.txt

如果下载中断报错,继续执行即可

修改setup.cfg

data_files =

        /etc/neutron =

        etc/api-paste.ini

        etc/dhcp_agent.ini

        etc/l3_agent.ini

        etc/metadata_agent.ini

        etc/metering_agent.ini

        etc/policy.json

        etc/neutron.conf

        etc/rootwrap.conf

        /etc/neutron/rootwrap.d =

        etc/neutron/rootwrap.d/debug.filters

        etc/neutron/rootwrap.d/dhcp.filters

        etc/neutron/rootwrap.d/iptables-firewall.filters

        etc/neutron/rootwrap.d/ebtables.filters

        etc/neutron/rootwrap.d/ipset-firewall.filters

        etc/neutron/rootwrap.d/l3.filters

        etc/neutron/rootwrap.d/linuxbridge-plugin.filters

        etc/neutron/rootwrap.d/openvswitch-plugin.filters

        /etc/neutron/plugins/ml2=

        etc/neutron/plugins/ml2/linuxbridge_agent.ini

        etc/neutron/plugins/ml2/macvtap_agent.ini

        etc/neutron/plugins/ml2/ml2_conf_sriov.ini

        etc/neutron/plugins/ml2/ml2_conf.ini

        etc/neutron/plugins/ml2/openvswitch_agent.ini

        etc/neutron/plugins/ml2/sriov_agent.ini

将etc目录替换

etc文件在附件,可联系我免费下载

 

安装neutron

python setup.py install

 

修改neutron.conf配置文件

vim /etc/nova/nova.conf

 

[DEFAULT]

 

transport_url = rabbit://openstack:123456@controller

 

auth_strategy = keystone

 

[keystone_authtoken]

 

www_authenticate_uri = http://controller:5000

auth_url = http://controller:5000

memcached_servers = controller:11211

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = neutron

password = 123456

 

[oslo_concurrency]

lock_path = /var/lib/neutron/tmp

 

 

修改 openvswitch-agent.ini文件

vim /opt/neutron/etc/neutron/plugins/ml2/openvswitch_agent.ini

 

[agent]

 

tunnel_types=vxlan

l2_population=True

prevent_arp_spoofing=True

 

[ovs]

 

local_ip=10.0.36.12

bridge_mappings=inflat:br-eth2

 

[securitygroup]

firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver

enable_ipset = true

注意:安全组要修改成ovs的,不然默认使用linuxbridge

 

修改 nova.conf文件

vim /etc/nova/nova.conf

 

[neutron]

url = http://10.0.36.3:9696

auth_url = http://10.0.36.3:35357

auth_type = password

project_domain_name = default

user_domain_name = default

region_name = RegionOne

project_name = service

username = neutron

password = 123456

 

创建网桥

ovs-vsctl add-br br-eth2

br-eth2和neutron配置的网桥名称一致

通过vsphere添加一块网卡

将网桥br-eth2和新的网盘绑定

ovs-vsctl add-port br-eth2 ens192

 

 

重启conpute服务

systemctl restart openstack-nova-compute.service

设置开机启动并启动openswitch

systemctl enable neutron-linuxbridge-agent.service

systemctl start neutron-linuxbridge-agent.service

 

你可能感兴趣的:(openstack,neutron)