Openstack Services: Network Controller node

اللام عليكم ورحمة الله وبركاته 

openstack  نكمل في مشوار 

Controller node يتم تنفيذ الخطوات التالية في 

Prerequisites:

mysql -u root -p
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
  IDENTIFIED BY 'NEUTRON_DBPASS';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
  IDENTIFIED BY 'NEUTRON_DBPASS';

admin script شغل 

. admin

openstack user create --domain default --password-prompt neutron
openstack role add --project service --user neutron admin
openstack service create --name neutron \
  --description "OpenStack Networking" network

Create API endpoints:

openstack endpoint create --region RegionOne \
  network public http://controller:9696
openstack endpoint create --region RegionOne \
  network internal http://controller:9696
openstack endpoint create --region RegionOne \
  network admin http://controller:9696

Configure networking options:

self-service كما ذكرنا سابقا هنالك نوعين سنقوم بإختيار  

Install the components:

yum install openstack-neutron openstack-neutron-ml2 \
  openstack-neutron-linuxbridge ebtables

Edit the /etc/neutron/neutron.conf

In the [database] section

[database]
# ...
connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron

In the [DEFAULT] section

[DEFAULT]
core_plugin = ml2 service_plugins = router allow_overlapping_ips = true
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

In the[keystone_authtoken] section

[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

Replace NEUTRON_PASS with the password you chose for the neutron user in the Identity service.

In theand [nova] sections

[nova]
# ...
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = NOVA_PASS

Replace NOVA_PASS with the password you chose for the nova user in the Identity service.

In the [oslo_concurrency] section

[oslo_concurrency]
# ...
lock_path = /var/lib/neutron/tmp

Edit the /etc/neutron/plugins/ml2/ml2_conf.ini

In the [ml2] section

[ml2]
# ...
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security

In the [ml2_type_flat]

[ml2_type_flat]
# ...
flat_networks = provider

flat لديك  provider network بإفتراض ان 

In the [ml2_type_vxlan] section,

[ml2_type_vxlan]
# ...
vni_ranges = 1:1000

In the [securitygroup] section

[securitygroup]
# ...
enable_ipset = true

Configure the Linux bridge agent

Edit the /etc/neutron/plugins/ml2/linuxbridge_agent.ini

In the [linux_bridge] section

[linux_bridge]
physical_interface_mappings = provider:Second Interface Name (ens224 for example)
[vxlan]
enable_vxlan = true
local_ip = IP of management interface 
l2_population = true

In the [securitygroup] section

[securitygroup]
# ...
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

Edit /etc/sysctl.conf

net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1

Configure the layer-3 agent

Edit the /etc/neutron/l3_agent.ini

[DEFAULT]
# ...
interface_driver = linuxbridge

Configure the DHCP agent

Edit the /etc/neutron/dhcp_agent.ini

[DEFAULT]
# ...
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true

Configure the metadata agent

Edit the /etc/neutron/metadata_agent.ini

[DEFAULT]
# ...
nova_metadata_host = controller
metadata_proxy_shared_secret = METADATA_SECRET

METADATA_SECRET can be replaced by what you like

Configure the Compute service to use the Networking service

Edit the /etc/nova/nova.conf

In the [neutron] section,

[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
service_metadata_proxy = true
metadata_proxy_shared_secret = METADATA_SECRET

Replace NEUTRON_PASS with the password you chose for the neutron user in the Identity service.

Replace METADATA_SECRET with the secret you chose for the metadata proxy.

Finalize installation

ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
  --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
systemctl restart openstack-nova-api.service
systemctl enable neutron-server.service \
  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
  neutron-metadata-agent.service
systemctl start neutron-server.service \
  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
  neutron-metadata-agent.service
 systemctl enable neutron-l3-agent.service
systemctl start neutron-l3-agent.service

 

 

بنلتقي في الدرس القادم

Leave a Reply