前回に引き続きコンピュートノード側の Neutron 周りのインストールと設定を行っていきます。
環境
ソフト
- Ubuntu 18.04.1 Server 64bit
- Openstack Rocky
ハード
※仮想マシンでもいけました。
- CPUx2
- MEM 8G
- SSD 30G
- NIC 2 枚
IP 構成
- コントローラー ( vm-nfj-osctrln1 )
- 公開用 ( 外部 ):10.1.55.11/16
- 管理用 ( 内部 ):10.2.55.11/16
- コンピュート ( vm-nfj-oscomp1 )
- 公開用 ( 外部 ):10.1.55.21/16
- 管理用 ( 内部 ):10.2.55.21/16
Neutron のインストールと設定(コンピュートノード側)
パッケージをインストール
$ sudo apt install neutron-linuxbridge-agent
共通コンポーネントの設定
/etc/neutron/neutron.conf を設定していきます。
[database]
コンピュートノードは直接DBにアクセスしないのですべてコメントアウトしておく。Ubuntu 18.04 のデフォルトでは sqlite 利用になっているためコメントアウト。
変更前:
[database] connection = sqlite:////var/lib/neutron/neutron.sqlite
変更後:
[database] #connection = sqlite:////var/lib/neutron/neutron.sqlite
[DEFAULT] セクション
[DEFAULT] core_plugin = ml2 transport_url = rabbit://openstack:[email protected] auth_strategy = keystone
[keystone_authtoken] セクション
[keystone_authtoken] www_authenticate_uri = http://vm-nfj-osctrln1:5000 auth_url = http://vm-nfj-osctrln1:5000 memcached_servers = vm-nfj-osctrln1:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = neutron password = NEUTRON_PASS
Linux bridge agent の設定
/etc/neutron/plugins/ml2/linuxbridge_agent.ini を設定していきます。
[linux_bridge] セクション
ens160 はインターフェース名、ip addr などで確認できます。
[linux_bridge] physical_interface_mappings = provider:ens160
[vxlan] セクション
セルフサービスを有効にする場合はここの設定が異なります。
L2 でプロバイダネットワークのみ利用の場合:
[vxlan] enable_vxlan = false
L3 でセルフサービスネットワークも利用する場合:
local_ip には管理側の IP を指定します。
[vxlan] enable_vxlan = true local_ip = 10.2.55.21 l2_population = true
[securitygroup] セクション
[securitygroup] enable_security_group = true firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
sysctl の確認
net.bridge.bridge-nf-call-ip6tables と net.bridge.bridge-nf-call-iptables に 1 がセットされていれば問題ありません。
$ sudo sysctl -a | grep net.bridge.bridge-nf-call-ip net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 sysctl: reading key "net.ipv6.conf.all.stable_secret" sysctl: reading key "net.ipv6.conf.default.stable_secret" sysctl: reading key "net.ipv6.conf.ens160.stable_secret" sysctl: reading key "net.ipv6.conf.ens192.stable_secret" sysctl: reading key "net.ipv6.conf.lo.stable_secret" sysctl: reading key "net.ipv6.conf.virbr0.stable_secret" sysctl: reading key "net.ipv6.conf.virbr0-nic.stable_secret"
コンピュートノード上のネットワーキングサービス設定
/etc/nova/nova.conf の [neutron] セクションの設定をします。
[neutron] セクション
[neutron] # # Configuration options for neutron (network connectivity as a service). url = http://vm-nfj-osctrln1:9696 auth_url = http://vm-nfj-osctrln1:5000 auth_type = password project_domain_name = default user_domain_name = default region_name = Tokyo project_name = service username = neutron password = NEUTRON_PASS
サービス再起動
$ sudo service nova-compute restart $ sudo service neutron-linuxbridge-agent restart