- Production Ready OpenStack:Recipes for Successful Environments
- Arthur Berezin
- 743字
- 2021-07-09 21:45:16
Configuring compute node for Neutron
After we have configured the Neutron network node, we can go ahead and configure our compute nodes to use Neutron networking service.
How to do it...
When the controller and Neutron network node are ready, we can configure Nova-Compute node to use Neutron for networking. We will configure Neutron access to the message broker. Then, we will configure Neutron to use ML2 plugin with GRE tunneling segmentation.
Run the following commands on compute1
!
- Disable reverse path filtering, Edit /etc/sysctl.conf to contain the following:
net.ipv4.conf.all.rp_filter=0 net.ipv4.conf.default.rp_filter=0 and apply the new configuration: [root@compute1 ~]# sysctl -p
- Install the Neutron ML2 and Open vSwitch packages:
[root@compute1 ~]# yum install -y openstack-neutron-ml2 openstack-neutron-openvswitch
Configure Neutron to use RabbitMQ message broker of the controller:
[root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT rpc_backend rabbit [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_host 10.10.0.1
- Configure Neutron to use Keystone as an authentication strategy:
[root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULTauth_strategy keystone [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \auth_uri http://controller:5000 [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \auth_host controller [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \auth_protocol http [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \auth_port 35357 [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \admin_tenant_name services [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \admin_user neutron [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken \admin_password password
- Now configure Neutron to use ML2 Neutron plugin:
[root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2 [root@compute1 ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins router
- Configure the ML2 Plugin to use GRE tunneling segregation:
[root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 \type_drivers gre [root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 \tenant_network_types gre [root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 \mechanism_drivers openvswitch [root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_gre \tunnel_id_ranges 1:1000 [root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs \local_ip 10.20.0.3 [root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs \tunnel_type gre [root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs \enable_tunneling True [root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup \firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver [root@compute1 ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup \enable_security_group True
- Create bridges for Neutron layer 2 and Neutron layer 3 agents. First, start the enable vSwitch service:
[root@compute1 ~]# systemctl start openvswitch [root@compute1 ~]# systemctl enable openvswitch
- After starting Open vSwitch service, we can create the needed bridge:
[root@compute1 ~]# ovs-vsctl add-br br-int
- Configure Nova to use Neutron Networking:
[root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_url http://controller:9696 [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_auth_strategy keystone [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_tenant_name service [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_username neutron [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_password NEUTRON_PASS [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_auth_url http://controller:35357/v2.0 [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.LinuxOVSInterfaceDriver [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT security_group_api neutron
- Create a symbolic link for ML2 Neutron plugin:
[root@compute1 ~]# ln -s plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
- Restart the Nova-Compute service:
[root@compute1 ~]# systemctl restart openstack-nova-compute
- Start and enable Neutron Open vSwitch agent service:
[root@compute1 ~]# systemctl start neutron-openvswitch-agent [root@compute1 ~]# systemctl enable neutron-openvswitch-agent
At this point, we should have the controller, Neutron network node, and compute1
configured for using Neutron networking. We can go ahead and create Neutron virtual networks needed for instances to be able to communicate with external public networks. We are going to create two layer 2 networks, one for the instances, and another to connect external networks.

Run the following commands on the controller node!
By default, networks are own and managed by the Admin user, under Admin tenant and shared for other tenants' use.
- Source Admin tenant credentials:
[root@controller ~]# source keystonerc_admin
- Create an external shared network:
[root@controller ~(keystone_admin)]# neutron net-create external-net --shared --router:external=True
In this example, we allocate a range of IPs from our existing external physical network, 192.168.200.0/24 for instances to use when communicating with the Internet or with external hosts in the IT environment.
- Create a subnet in the newly created network:
[root@controller ~(keystone_admin)]# neutron subnet-create external-net --name ext-subnet --allocation-pool start=192.168.200.100,end=192.168.200.200 --disable-dhcp --gateway 192.168.200.1 192.168.200.0/24
The IP range is ought to be routable by the external public network and not overlap with the existing configured networks. Chapter 7, Neutron Networking Service, will further discuss Neutron networks planning.
- Create a tenant network, which is an isolated network for instances to inner-communicate:
[root@controller ~(keystone_admin)]# neutron net-create tenant_net [root@controller ~(keystone_admin)]# neutron subnet-create tenant_net --name tenant_net_subnet --gateway 192.168.1.1 192.168.1.0/24 [root@controller ~(keystone_admin)]# neutron router-create ext-router [root@controller ~(keystone_admin)]# neutron router-interface-add ext-router tenant-subnet [root@controller ~(keystone_admin)]# neutron router-gateway-set ext-router external-net
- AngularJS Testing Cookbook
- 復雜軟件設計之道:領域驅動設計全面解析與實戰
- 從程序員到架構師:大數據量、緩存、高并發、微服務、多團隊協同等核心場景實戰
- Apache Spark Graph Processing
- Mastering C# Concurrency
- 匯編語言程序設計(第3版)
- C++ 從入門到項目實踐(超值版)
- Multithreading in C# 5.0 Cookbook
- Android傳感器開發與智能設備案例實戰
- 進入IT企業必讀的324個Java面試題
- Appcelerator Titanium:Patterns and Best Practices
- 大學計算機應用基礎(Windows 7+Office 2010)(IC3)
- Node.js 6.x Blueprints
- Go Systems Programming
- 現代C++語言核心特性解析