Delete agent in agent list by accident

asked 2019-08-25 20:52:04 -0500

sakiraa gravatar image

updated 2019-08-26 19:59:29 -0500

I accidently deleted a L3-agent in openstack network agent list. How can I recover the agent? ( I tried to restart all the nodes but still couldnt see the l3-agent, even it was still up and running on network node)

This is data from querying select * from neutron.agents;

+--------------------------------------+----------------+------------------------------+------------+------------+----------------+---------------------+---------------------+---------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+-------------------+-------------------+
| id                                   | agent_type     | binary                       | topic      | host       | admin_state_up | created_at          | started_at          | heartbeat_timestamp | description | configurations                                                                                                                                                                                                                                                                                                                                                  | load | availability_zone | resource_versions |
+--------------------------------------+----------------+------------------------------+------------+------------+----------------+---------------------+---------------------+---------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+-------------------+-------------------+
| 0ddccc98-5d64-4235-9fed-ed90016fe4fd | DHCP agent     | neutron-dhcp-agent           | dhcp_agent | compute2   |              1 | 2019-08-23 02:27:55 | 2019-08-26 05:39:11 | 2019-08-27 00:54:36 | NULL        | {"dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq", "dhcp_lease_duration": 86400, "log_agent_heartbeats": false, "networks": 0, "ports": 0, "subnets": 0}                                                                                                                                                                                                       |    0 | nova              | NULL              |
| 12da6f0a-3b6c-476d-a49a-ab7ddf4b5b3c | ODL L2         | neutron-odlagent-portbinding | N/A        | controller |              1 | 2019-08-22 06:20:52 | 2019-08-27 00:47:22 | 2019-08-27 00:54:52 | NULL        | {"allowed_network_types": ["local", "flat", "vlan", "vxlan", "gre"], "bridge_mappings": {}, "datapath_type": "system", "supported_vnic_types": [{"vif_type": "ovs", "vnic_type": "normal", "vif_details": {"support_vhost_user": false, "has_datapath_type_netdev": false, "uuid": "39036e06-7866-4c47-b395-43b47c530ebe", "host_addresses": ["controller"]}}]} |    0 | NULL              | NULL              |
| 1ec6b8d2-ca34-40c8-8105-8fe868577535 | ODL L3         | neutron-odlagent-portbinding | N/A        | network    |              1 | 2019-08-23 12:05:59 | 2019-08-27 00:47:22 | 2019-08-27 00:54:52 | NULL        |                                                                                                                                                                                                                                                                                                                                                                 |    0 | NULL              | NULL              |
| 2e8fdc4f-5647-4b8e-94af-83f3dcbfb790 | ODL L2         | neutron-odlagent-portbinding | N/A        | compute1   |              1 | 2019-08-23 12:15:59 | 2019-08-27 00:47:22 | 2019-08-27 00:54:52 | NULL        | {"allowed_network_types": ["local", "flat", "vlan", "vxlan", "gre"], "bridge_mappings": {}, "datapath_type": "system", "supported_vnic_types": [{"vif_type": "ovs", "vnic_type": "normal", "vif_details": {"support_vhost_user": false, "has_datapath_type_netdev": false, "uuid": "24baebb8-f155-4575-b5b8-cddf2196dcf4", "host_addresses": ["compute1"]}}]}   |    0 | NULL              | NULL              |
| 36901483-0c5f-47ca-a8b1-16326c95944d | Metadata agent | neutron-metadata-agent       | N/A        | network    |              1 | 2019-08-21 03:00:41 | 2019-08-27 00:47:14 | 2019-08-27 00:54:44 | NULL        | {"log_agent_heartbeats": false, "metadata_proxy_socket": "/var/lib/neutron/metadata_proxy", "nova_metadata_host": "controller", "nova_metadata_port": 8775}                                                                                                                                                                                                     |    0 | NULL              | NULL              |
| 3ee285dd-dfd1-491a-8e51-e616574607ce | Metadata agent | neutron-metadata-agent       | N/A        | compute3   |              1 | 2019-08-23 02:29:07 | 2019-08-26 05:39:05 | 2019-08-27 00:54:31 | NULL        | {"log_agent_heartbeats": false, "metadata_proxy_socket": "/var/lib/neutron/metadata_proxy", "nova_metadata_host": "127.0.0.1", "nova_metadata_port": 8775}                                                                                                                                                                                                      |    0 | NULL              | NULL              |
| 674dfbdb-8f37-40ff-bc59-98da0db72f40 | DHCP agent     | neutron-dhcp-agent           | dhcp_agent | compute3   |              1 | 2019-08-23 02:29:07 | 2019-08-26 05:39:06 | 2019-08-27 00:54:29 | NULL        | {"dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq", "dhcp_lease_duration": 86400, "log_agent_heartbeats": false, "networks": 2, "ports": 4, "subnets": 2}                                                                                                                                                                                                       |    2 | nova              | NULL              |
| 813413b4-1752-474b-bdf9-96a234935e70 | DHCP agent     | neutron-dhcp-agent           | dhcp_agent | network    |              1 | 2019-08-21 03:00:40 | 2019-08-27 00:47:14 | 2019-08-27 00:54:44 | NULL        | {"dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq", "dhcp_lease_duration": 86400, "log_agent_heartbeats": false, "networks": 0, "ports": 0, "subnets": 0}                                                                                                                                                                                                       |    0 | nova              | NULL              |
| 895318f5-2d5b-4e04-bbfe-9dd0195ab92e | Metadata agent | neutron-metadata-agent       | N/A        | compute1   |              1 | 2019-08-23 02:26:44 | 2019-08-26 05:39:04 | 2019-08-27 00:54:34 | NULL        | {"log_agent_heartbeats": false, "metadata_proxy_socket": "/var/lib/neutron/metadata_proxy", "nova_metadata_host": "127.0.0.1", "nova_metadata_port": 8775}                                                                                                                                                                                                      |    0 | NULL              | NULL              |
| 8ca187fa-654d-4251-a52d-748293f29e56 | ODL L3         | neutron-odlagent-portbinding | N/A        | controller |              1 | 2019-08-26 00:12:04 | 2019-08-27 00:47:22 | 2019-08-27 00:54:52 | NULL        |                                                                                                                                                                                                                                                                                                                                                                 |    0 | NULL              | NULL              |
| bca2843e-fc00-4efd-ba05-822b08c73ff2 | ODL L2         | neutron-odlagent-portbinding | N/A        | compute2   |              1 | 2019-08-23 12:15:59 | 2019-08-27 00:47:22 | 2019-08-27 00:54:52 | NULL        | {"allowed_network_types": ["local", "flat", "vlan", "vxlan", "gre"], "bridge_mappings": {}, "datapath_type": "system", "supported_vnic_types": [{"vif_type": "ovs", "vnic_type": "normal", "vif_details": {"support_vhost_user": false, "has_datapath_type_netdev": false, "uuid": "866b91b1-5e3e-4011-adb5-5981b5a7f316", "host_addresses": ["compute2"]}}]}   |    0 | NULL              | NULL              |
| d3f189fd-3793-4f0e-acc5-f69310f0e08b | Metadata agent | neutron-metadata-agent       | N/A        | compute2   |              1 | 2019-08-23 02:27:55 | 2019-08-26 05:39:11 | 2019-08-27 00:54:38 | NULL ...
(more)
edit retag flag offensive close merge delete

Comments

No one :(((

sakiraa gravatar imagesakiraa ( 2019-08-26 06:51:46 -0500 )edit

Do you have access to the sql databases on the control node? Maybe resetting a value for the deleted agent will recover the list? But please be very careful! Make a backup of the db before changing anything! Or paste the output here without actually editing it select * from neutron.agents

eblock gravatar imageeblock ( 2019-08-26 09:02:12 -0500 )edit

Thanks for the idea. Yes, I have access to the sql databases. But Is there any other ways? I thought I that openstack will have a command to add an agent but its not :(.

sakiraa gravatar imagesakiraa ( 2019-08-26 09:16:34 -0500 )edit

I'm not aware of such an option.

eblock gravatar imageeblock ( 2019-08-26 09:34:29 -0500 )edit

How to resetting a value for the deleted agent will recover the list ?

sakiraa gravatar imagesakiraa ( 2019-08-26 19:58:20 -0500 )edit