OpenStack Newton版本部署---- 网络服务(neutron)
OpenStack Networking(neutron)允许您创建并附加由其他OpenStack服务管理的接口设备到网络。可以实现插件以适应不同的网络设备和软件,为OpenStack架构和部署提供灵活性。
它包括以下组件:
neutron-server
接受并将API请求路由到相应的OpenStack Networking插件以进行操作。
OpenStack Networking plug-ins andagents
插拔端口,创建网络或子网,并提供IP寻址。
通用代理是L3,DHCP(动态主机IP寻址)和插件代理。
Messaging queue
大多数OpenStack网络设备用队列在neutron服务器和各种代理之间路由信息。还充当数据库来存储特定插件的网络状态。
安装和配置计算节点
安装和配置组件
1、安装
# yum install openstack-neutron-linuxbridge ebtables ipset
配置网络
这里配置自服务网络。
1、修改 /etc/neutron/neutron.conf配置
1)在[database]部分,删除所有connection选项。
2)配置RabbitMQ消息队列访问:
[DEFAULT]
...
transport_url = rabbit://openstack:RABBIT_PASS@controller
用openstack用户的队列密码替换RABBIT_PASS。
3)配置认证服务访问
[DEFAULT]
...
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = neutron
password = NEUTRON_PASS
用neutron用户的密码替换NEUTRON_PASS。
4)配置锁定路径:
[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp
5)检查配置
用命令 cat/etc/neutron/neutron.conf | grep -v ^# | grep -v ^$检查配置是否正确。
2、配置Linuxbridge代理
vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
1)将提供商虚拟网络映射到提供商物理网络接口。
[linux_bridge]
physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME
将PROVIDER_INTERFACE_NAME替换为计算节点外网网卡,例如eno1.
2) 启用VXLAN覆盖网络,配置处理覆盖网络的物理网络接口的IP地址,并启动L2 population:
[vxlan]
enable_vxlan = True
local_ip = OVERLAY_INTERFACE_IP_ADDRESS
l2_population = True
用计算节点管理网络IP地址替换OVERLAY_INTERFACE_IP_ADDRESS,例如192.168.1.104.
3)启动安全组并配置Linux bridge iptables防火墙驱动:
[securitygroup]
...
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
4)检查配置
用命令cat/etc/neutron/plugins/ml2/linuxbridge_agent.ini | grep -v ^# | grep-v ^$ 检查配置是否正确。
配置compute服务以使用networking服务
1、vim /etc/nova/nova.conf
1)配置访问参数:
[neutron]
...
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS
用neutron用户密码替换NEUTRON_PASS。
完成安装
1、重启Compute服务:
# systemctl restart openstack-nova-compute.service
2、启动Linuxbridge代理服务,并设置开机启动:
# systemctl enable neutron-linuxbridge-agent.service
# systemctl start neutron-linuxbridge-agent.service
验证操作
1、输入管理员凭证
$ . admin-openrc
2、列出加载的扩展程序,以确认neutron-server进程的成功启动:
$ neutron ext-list
+---------------------------+-----------------------------------------------+
| alias | name |
+---------------------------+-----------------------------------------------+
| default-subnetpools | Default Subnetpools |
| network-ip-availability | Network IP Availability |
| network_availability_zone | Network Availability Zone |
| auto-allocated-topology | Auto Allocated Topology Services |
| ext-gw-mode | Neutron L3 Configurable external gateway mode |
| binding | Port Binding |
| agent | agent |
| subnet_allocation | Subnet Allocation |
| l3_agent_scheduler | L3 Agent Scheduler |
| tag | Tag support |
| external-net | Neutron external network |
| net-mtu | Network MTU |
| availability_zone | Availability Zone |
| quotas | Quota management support |
| l3-ha | HA Router extension |
| flavors | Neutron Service Flavors |
| provider | Provider Network |
| multi-provider | Multi Provider Network |
| address-scope | Address scope |
| extraroute | Neutron Extra Route |
| timestamp_core | Time Stamp Fields addition for core resources |
| router | Neutron L3 Router |
| extra_dhcp_opt | Neutron Extra DHCP opts |
| dns-integration | DNS Integration |
| security-group | security-group |
| dhcp_agent_scheduler | DHCP Agent Scheduler |
| router_availability_zone | Router Availability Zone |
| rbac-policies | RBAC Policies |
| standard-attr-description | standard-attr-description |
| port-security | Port Security |
| allowed-address-pairs | Allowed Address Pairs |
| dvr | Distributed Virtual Router |
+---------------------------+-----------------------------------------------+
3、列出代理从而确认neutron代理的成功启动:
$ openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| f49a4b81-afd6-4b3d-b923-66c8f0517099 | Metadata agent | controller | None | True | UP | neutron-metadata-agent |
| 27eee952-a748-467b-bf71-941e89846a92 | Linux bridge agent | controller | None | True | UP | neutron-linuxbridge-agent |
| 08905043-5010-4b87-bba5-aedb1956e27a | Linux bridge agent | compute1 | None | True | UP | neutron-linuxbridge-agent |
| 830344ff-dc36-4956-84f4-067af667a0dc | L3 agent | controller | nova | True | UP | neutron-l3-agent |
| dd3644c9-1a3a-435a-9282-eb306b4b0391 | DHCP agent | controller | nova | True | UP | neutron-dhcp-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+