问题现象:
openstack port状态down,binding_vif_type显示binding_failed
[root@controller ~]# openstack port list --router router
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| 3a144298-c39f-4722-8c95-e66ddac308a6 | | fa:16:3e:9d:29:b7 | ip_address='172.16.1.1', subnet_id='e98365bf-b2bb-496d-a7dc-52124fe7f9a6' | DOWN |
| 6021e634-c8f7-4e65-8016-5d72ae66cb85 | | fa:16:3e:6e:6e:fa | ip_address='203.0.113.207', subnet_id='416aa83f-c155-4467-b489-21e6cd9741e2' | DOWN |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
[root@controller ~]# openstack port show 3a144298-c39f-4722-8c95-e66ddac308a6
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | UP |
| allowed_address_pairs | |
| binding_host_id | controller |
| binding_profile | |
| binding_vif_details | |
| binding_vif_type | binding_failed |
| binding_vnic_type | normal
原因:
配置linuxbridge agent的时候没有替换网卡信息
分析过程
打开DEBUG级别日志发现缺少linux bridge agent
打开 openstackDEBUG级别日志_yue_luu的博客-优快云博客
2022-08-14 10:50:39.975 50636 DEBUG neutron.plugins.ml2.drivers.mech_agent [req-9c3ec1e1-53a5-495f-8b79-448d50c3275e - - - - -] Port 3a144298-c39f-4722-8c95-e66ddac308a6 on network 45c89664-9173-4117-b095-e9e8468c36b8 not bound, no agent of type Linux bridge agent registered on host controller bind_port /usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/mech_agent.py:104
openstack network agent list查不到linux bridge agent
[root@controller ~]# openstack network agent list
+--------------------------------------+----------------+------------+-------------------+-------+-------+------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+----------------+------------+-------------------+-------+-------+------------------------+
| b307c36c-5a7e-4701-ba9b-0e0c3a4f299a | Metadata agent | controller | None | :-) | UP | neutron-metadata-agent |
| b83e6cc6-07c3-40a1-bb24-9713288a62b3 | L3 agent | controller | nova | :-) | UP | neutron-l3-agent |
| d86d84e6-eb03-4fe1-b29e-68ca61070515 | DHCP agent | controller | nova | :-) | UP | neutron-dhcp-agent |
+--------------------------------------+----------------+------------+-------------------+-------+-------+------------------------+
systemctl status却显示正常
[root@controller ~]# systemctl status neutron-linuxbridge-agent.service
● neutron-linuxbridge-agent.service - OpenStack Neutron Linux Bridge Agent
Loaded: loaded (/usr/lib/systemd/system/neutron-linuxbridge-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2022-08-14 11:18:11 EDT; 2s ago
Process: 77266 ExecStartPre=/usr/bin/neutron-enable-bridge-firewall.sh (code=exited, status=0/SUCCESS)
Main PID: 77271 (neutron-linuxbr)
Tasks: 1
Memory: 61.9M
CGroup: /system.slice/neutron-linuxbridge-agent.service
└─77271 /usr/bin/python2 /usr/bin/neutron-linuxbridge-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/linuxbridge_agent.ini --config-dir /e...
linuxbridge agent日志显示启动失败
2022-08-14 11:19:02.361 77840 ERROR neutron.plugins.ml2.drivers.linuxbridge.agent.linuxbridge_neutron_agent [-] Interface PROVIDER_INTERFACE_NAME for physical network provider does not exist. Agent terminated!
原来是/etc/neutron/plugins/ml2/linuxbridge_agent.ini 配置的时候没有替换物理网卡信息
还有其他配置文件没有修改的也一起改一下
修改完就正常啦
[root@controller ~]# openstack network agent list
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
| 206b0223-b2d4-4ae6-82d6-a87c32b589f1 | Linux bridge agent | controller | None | :-) | UP | neutron-linuxbridge-agent |
| b307c36c-5a7e-4701-ba9b-0e0c3a4f299a | Metadata agent | controller | None | :-) | UP | neutron-metadata-agent |
| b83e6cc6-07c3-40a1-bb24-9713288a62b3 | L3 agent | controller | nova | :-) | UP | neutron-l3-agent |
| d86d84e6-eb03-4fe1-b29e-68ca61070515 | DHCP agent | controller | nova | :-) | UP | neutron-dhcp-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+-------+---------------------------+
[root@controller ~]# openstack port list --router router
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| 3a144298-c39f-4722-8c95-e66ddac308a6 | | fa:16:3e:9d:29:b7 | ip_address='172.16.1.1', subnet_id='e98365bf-b2bb-496d-a7dc-52124fe7f9a6' | ACTIVE |
| 6021e634-c8f7-4e65-8016-5d72ae66cb85 | | fa:16:3e:6e:6e:fa | ip_address='203.0.113.207', subnet_id='416aa83f-c155-4467-b489-21e6cd9741e2' | ACTIVE |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+