OpenStack: Configuring OpenStack Networking on the Nova Compute Node
Jump to navigation
Jump to search
- Install
[root@server2-b nova]# yum -y install openstack-neutron-openvswitch openstack-neutron-ml2 openstack-selinux- Backup conf & ini files:
[root@server2-b nova]# cd /etc/neutron/plugins/
[root@server2-b plugins]# cp openvswitch/ovs_neutron_plugin.ini openvswitch/ovs_neutron_plugin.ini.orig
[root@server2-b plugins]# cp ml2/ml2_conf.ini ml2/ml2_conf.ini.orig
[root@server2-b plugins]# cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.orig- Copy over conf & ini files from server2-a:
[root@server2-b plugins]# scp server2-a:/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini openvswitch/
root@server2-a's password:
ovs_neutron_plugin.ini 100% 6530 6.4KB/s 00:00
[root@server2-b plugins]# scp server2-a:/etc/neutron/plugins/ml2/ml2_conf.ini ml2/
root@server2-a's password:
ml2_conf.ini 100% 2419 2.4KB/s 00:00
[root@server2-b plugins]# scp server2-a:/etc/neutron/neutron.conf /etc/neutron/neutron.conf
root@server2-a's password:
neutron.conf- Enable ML2 framework:
[root@server2-b plugins]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini- Start & enable openvswitch:
[root@server2-b plugins]# systemctl start openvswitch
[root@server2-b plugins]# grep ERROR /var/log/openvswitch/ovs*
[root@server2-b plugins]# systemctl enable openvswitch
ln -s '/usr/lib/systemd/system/openvswitch.service' '/etc/systemd/system/multi-user.target.wants/openvswitch.service'- Create bridges in openvswich:
[root@server2-b plugins]# ovs-vsctl add-br br-int
[root@server2-b plugins]# ovs-vsctl add-br br-eth1
[root@server2-b plugins]# ovs-vsctl add-port br-eth1 eth1- Backup ifcfg files:
[root@server2-b plugins]# cp /etc/sysconfig/network-scripts/ifcfg-eth1 /root
[root@server2-b plugins]# cp /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-br-eth1- Edit the
ifcfg-eth1file:
DEVICE=eth1
ONBOOT=yes
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=br-eth1- And the
ifcfg-br-eth1file:
DEVICE=br-eth1
BOOTPROTO=static
ONBOOT=yes
TYPE=OVSBridge
DEVICETYPE=ovs
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
IPADDR=172.25.102.11
NETMASK=255.255.255.0- Restart the network:
[root@server2-b plugins]# systemctl restart network.service- Append
/etc/sysctl.conf:
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv4.ip_forward=1- Validate the setting:
[root@server2-b plugins]# sysctl -p
net.ipv4.ip_forward = 1- Start agent:
[root@server2-b plugins]# systemctl start neutron-openvswitch-agent.service
[root@server2-b plugins]# grep ERROR /var/log/neutron/openvswitch-agent.log
[root@server2-b plugins]# systemctl enable neutron-openvswitch-agent.service
ln -s '/usr/lib/systemd/system/neutron-openvswitch-agent.service' '/etc/systemd/system/multi-user.target.wants/neutron-openvswitch-agent.service'- Start and enable neutron-ovs-cleanup service:
[root@server2-b plugins]# systemctl start neutron-ovs-cleanup
[root@server2-b plugins]# systemctl enable neutron-ovs-cleanup
ln -s '/usr/lib/systemd/system/neutron-ovs-cleanup.service' '/etc/systemd/system/multi-user.target.wants/neutron-ovs-cleanup.service'- From server2-a, use the neutron command to query the status of the openvswitch agent running on server2-b using admin credentials:
[root@server2-a ~]# source /root/keystonerc_admin
[root@server2-a ~(keystone_admin)]# neutron agent-list
+--------------------------------------+--------------------+-----------------------+-------+----------------+
| id | agent_type | host | alive | admin_state_up |
+--------------------------------------+--------------------+-----------------------+-------+----------------+
| 1764b22e-8ce2-4d0d-b575-544cb276376e | Metadata agent | server2-a.example.com | :-) | True |
| 7a40ba76-78a8-4811-bea4-d653eec74e21 | Open vSwitch agent | server2-a.example.com | :-) | True |
| b04543d8-637f-4787-978f-3a017e38a7be | Open vSwitch agent | server2-b.example.com | :-) | True |
| f28f8b4d-906b-437b-a9b7-dc555aeb2c86 | DHCP agent | server2-a.example.com | :-) | True |
| f96a75c8-63c1-468f-a0c1-8076d59c7d19 | L3 agent | server2-a.example.com | :-) | True |
+--------------------------------------+--------------------+-----------------------+-------+----------------+