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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章