なにかの技術メモ置き場

なにかの技術メモ置き場

@インフラエンジニア

OpenStack環境構築 part20

Networking service (Neutron)

Install and configure controller node

Prerequisites
Network Option 1で実施済みのため不要
Configure networking options

▼jump page

Networking Option 2: Self-service networks

Install the components
Network Option 1で実施済みのため不要
Configure the server component
cp -p /etc/neutron/neutron.conf{,_provider}
ls -l /etc/neutron/neutron.conf*
cat << EOF > /etc/neutron/neutron.conf
[database]
connection = mysql+pymysql://neutron:NEUTRON_DBPASS@ctr01/neutron

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

[keystone_authtoken]
www_authenticate_uri = http://ctr01:5000
auth_url = http://ctr01:5000
memcached_servers = ctr01:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = NEUTRON_PASS

[nova]
auth_url = http://ctr01:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = NOVA_PASS

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
EOF
cat /etc/neutron/neutron.conf
Configure the Modular Layer 2 (ML2) plug-in
cp -p /etc/neutron/plugins/ml2/ml2_conf.ini{,_provider}
ls -l /etc/neutron/plugins/ml2/ml2_conf.ini*
cat << EOF > /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security

[ml2_type_flat]
flat_networks = provider

[ml2_type_vxlan]
vni_ranges = 1:1000

[securitygroup]
enable_ipset = true
EOF
cat /etc/neutron/plugins/ml2/ml2_conf.ini
Configure the Linux bridge agent
cp -p /etc/neutron/plugins/ml2/linuxbridge_agent.ini{,_provider}
ls -l /etc/neutron/plugins/ml2/linuxbridge_agent.ini*
cat << EOF > /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:ens4

[vxlan]
enable_vxlan = true
local_ip = 172.16.0.206
l2_population = true

[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
EOF
cat /etc/neutron/plugins/ml2/linuxbridge_agent.ini
Configure the layer-3 agent
cp -p /etc/neutron/l3_agent.ini{,_org}
ls -l /etc/neutron/l3_agent.ini*
cat << EOF > /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver = linuxbridge
EOF
cat /etc/neutron/l3_agent.ini
Configure the DHCP agent
Network Option 1と同一設定のため不要

▲return page

Install and configure controller node

Configure the metadata agent
Network Option 1で実施済みのため不要
Configure the Compute service to use the Networking service
Network Option 1で実施済みのため不要
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 \
neutron-server.service \
neutron-linuxbridge-agent.service \
neutron-dhcp-agent.service \
neutron-metadata-agent.service
systemctl is-active \
neutron-server.service \
neutron-linuxbridge-agent.service \
neutron-dhcp-agent.service \
neutron-metadata-agent.service
systemctl enable --now neutron-l3-agent.service
systemctl status --no-pager -l neutron-l3-agent.service
systemctl is-active neutron-l3-agent.service
systemctl is-enabled neutron-l3-agent.service

参考サイト

docs.openstack.org