Public bug reported:

The atteched devstack configuration `local.conf` can be used to
reproduce this issue.

In networking-baremetal CI we are seeing an issue where the DHCP agent
does not create a namespace for subnets on a routed provider network. No
DHCP namespace is created because this test[1] `if (any(s for s in
network.subnets if s.enable_dhcp)` returns false.

The OVS agent does have the correct configuration, with mappings to the
physical_network "mynetwork" on bridge "brbm".


$ openstack network agent show ef7ca33a-de9c-4a2b-9af5-e1c9cb029a25 -f yaml     
                                                                                
                                                                                
                                                    
admin_state_up: true                                                            
                                                                                
                                                                                
                                                                             
agent_type: Open vSwitch agent                                                  
                                                                                
                                                                                
                                                                             
alive: true                                                                     
                                                                                
                                                                                
                                                                             
availability_zone: null                                                         
                                                                                
                                                                                
                                                                             
binary: neutron-openvswitch-agent                                               
                                                                                
                                                                                
                                                                             
configuration:                   
  arp_responder_enabled: false
  baremetal_smartnic: false                                                     
                                                                                
                                                                                
                                                                             
  bridge_mappings:                                                              
                                                                                
                                                                                
                                                                             
    mynetwork: brbm                                                             
                                                                                
                                                                                
                                                                             
    public: br-ex                    

But looking in the database, there are only `segment host mappings` for
baremetal nodes.

mysql> select * from segmenthostmappings;
+--------------------------------------+--------------------------------------+
| segment_id                           | host                                 |
+--------------------------------------+--------------------------------------+
| 712e8a82-a5f9-4506-9520-fc5b4b01529e | 30e70889-d50c-42a8-8776-f5e8cdce3609 |
| 712e8a82-a5f9-4506-9520-fc5b4b01529e | a3930bb2-a742-44f8-954e-49be373477db |
| 712e8a82-a5f9-4506-9520-fc5b4b01529e | cbb3f623-f300-4dd3-ab09-c05b1e9b9a75 |
| ede8201d-0766-4a18-9df0-1b6292f99592 | 30e70889-d50c-42a8-8776-f5e8cdce3609 |
| ede8201d-0766-4a18-9df0-1b6292f99592 | a3930bb2-a742-44f8-954e-49be373477db |
| ede8201d-0766-4a18-9df0-1b6292f99592 | cbb3f623-f300-4dd3-ab09-c05b1e9b9a75 |
+--------------------------------------+--------------------------------------+
6 rows in set (0.00 sec)


If I manually stop the OVS agent service, manually delete the agent and then 
restart the OVS agent the agent is re-created and mappings are created.

stack@devstack:~/devstack$ sudo systemctl stop devstack@q-agt.service
stack@devstack:~/devstack$ openstack network agent delete 
3921f433-b2f1-4c8f-90d2-deaad6bb5814
stack@devstack:~/devstack$ sudo systemctl start devstack@q-agt.service

mysql> select * from segmenthostmappings;
+--------------------------------------+--------------------------------------+
| segment_id                           | host                                 |
+--------------------------------------+--------------------------------------+
| 712e8a82-a5f9-4506-9520-fc5b4b01529e | 30e70889-d50c-42a8-8776-f5e8cdce3609 |
| 712e8a82-a5f9-4506-9520-fc5b4b01529e | a3930bb2-a742-44f8-954e-49be373477db |
| 712e8a82-a5f9-4506-9520-fc5b4b01529e | cbb3f623-f300-4dd3-ab09-c05b1e9b9a75 |
| 712e8a82-a5f9-4506-9520-fc5b4b01529e | devstack                             |
| e0673f45-e9b4-4672-874f-e2eb65d74d70 | devstack                             |
| e2c8c728-9e55-4047-b56f-701375887da9 | devstack                             |
| ede8201d-0766-4a18-9df0-1b6292f99592 | 30e70889-d50c-42a8-8776-f5e8cdce3609 |
| ede8201d-0766-4a18-9df0-1b6292f99592 | a3930bb2-a742-44f8-954e-49be373477db |
| ede8201d-0766-4a18-9df0-1b6292f99592 | cbb3f623-f300-4dd3-ab09-c05b1e9b9a75 |
| ede8201d-0766-4a18-9df0-1b6292f99592 | devstack                             |
+--------------------------------------+--------------------------------------+

To get the DHCP namespace up and running the DHCP agent service must be
restarted as well.

stack@devstack:~/devstack$ ip netns list
qdhcp-6fd5f856-bcf6-4821-a85c-18139e934061 (id: 2)
qrouter-ea62445b-ea09-4a2d-88e9-87bede21d6c6 (id: 1)
qdhcp-4b9aae0e-482d-402f-a7c4-2acaad2f3620 (id: 0)

stack@devstack:~/devstack$ sudo systemctl restart
devstack@q-dhcp.service

stack@devstack:~/devstack$ ip netns list
qdhcp-b435b564-ce44-4fc1-bec2-2a4ccb27346f (id: 3)   <-- The DHCP was created.
qdhcp-6fd5f856-bcf6-4821-a85c-18139e934061 (id: 2)
qrouter-ea62445b-ea09-4a2d-88e9-87bede21d6c6 (id: 1)
qdhcp-4b9aae0e-482d-402f-a7c4-2acaad2f3620 (id: 0)


In this CI job[2] with patch[3] we can see that the host is added with no 
segments:

May 19 17:47:34.266428 ubuntu-focal-ovh-bhs1-0029706921 neutron-
server[84188]: DEBUG neutron.services.segments.db [None req-
ac845447-48ed-4c73-85c9-347133259602 None None] Segments set() mapped to
the host ubuntu-focal-ovh-bhs1-0029706921 {{(pid=84188)
update_segment_host_mapping
/opt/stack/neutron/neutron/services/segments/db.py:237}}

[1] 
https://opendev.org/openstack/neutron/src/branch/master/neutron/agent/dhcp/agent.py#L403
[2] https://review.opendev.org/c/openstack/networking-baremetal/+/842578
[3] https://review.opendev.org/842576

** Affects: neutron
     Importance: Undecided
         Status: New

** Attachment added: "Devstack local.conf for reproducing the issue"
   https://bugs.launchpad.net/bugs/1975542/+attachment/5592445/+files/local.conf

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1975542

Title:
  Open vSwitch agent - does not report to the segment plugin

Status in neutron:
  New

Bug description:
  The atteched devstack configuration `local.conf` can be used to
  reproduce this issue.

  In networking-baremetal CI we are seeing an issue where the DHCP agent
  does not create a namespace for subnets on a routed provider network.
  No DHCP namespace is created because this test[1] `if (any(s for s in
  network.subnets if s.enable_dhcp)` returns false.

  The OVS agent does have the correct configuration, with mappings to
  the physical_network "mynetwork" on bridge "brbm".

  
  $ openstack network agent show ef7ca33a-de9c-4a2b-9af5-e1c9cb029a25 -f yaml   
                                                                                
                                                                                
                                                      
  admin_state_up: true                                                          
                                                                                
                                                                                
                                                                               
  agent_type: Open vSwitch agent                                                
                                                                                
                                                                                
                                                                               
  alive: true                                                                   
                                                                                
                                                                                
                                                                               
  availability_zone: null                                                       
                                                                                
                                                                                
                                                                               
  binary: neutron-openvswitch-agent                                             
                                                                                
                                                                                
                                                                               
  configuration:                   
    arp_responder_enabled: false
    baremetal_smartnic: false                                                   
                                                                                
                                                                                
                                                                               
    bridge_mappings:                                                            
                                                                                
                                                                                
                                                                               
      mynetwork: brbm                                                           
                                                                                
                                                                                
                                                                               
      public: br-ex                    

  But looking in the database, there are only `segment host mappings`
  for baremetal nodes.

  mysql> select * from segmenthostmappings;
  
+--------------------------------------+--------------------------------------+
  | segment_id                           | host                                 
|
  
+--------------------------------------+--------------------------------------+
  | 712e8a82-a5f9-4506-9520-fc5b4b01529e | 30e70889-d50c-42a8-8776-f5e8cdce3609 
|
  | 712e8a82-a5f9-4506-9520-fc5b4b01529e | a3930bb2-a742-44f8-954e-49be373477db 
|
  | 712e8a82-a5f9-4506-9520-fc5b4b01529e | cbb3f623-f300-4dd3-ab09-c05b1e9b9a75 
|
  | ede8201d-0766-4a18-9df0-1b6292f99592 | 30e70889-d50c-42a8-8776-f5e8cdce3609 
|
  | ede8201d-0766-4a18-9df0-1b6292f99592 | a3930bb2-a742-44f8-954e-49be373477db 
|
  | ede8201d-0766-4a18-9df0-1b6292f99592 | cbb3f623-f300-4dd3-ab09-c05b1e9b9a75 
|
  
+--------------------------------------+--------------------------------------+
  6 rows in set (0.00 sec)

  
  If I manually stop the OVS agent service, manually delete the agent and then 
restart the OVS agent the agent is re-created and mappings are created.

  stack@devstack:~/devstack$ sudo systemctl stop devstack@q-agt.service
  stack@devstack:~/devstack$ openstack network agent delete 
3921f433-b2f1-4c8f-90d2-deaad6bb5814
  stack@devstack:~/devstack$ sudo systemctl start devstack@q-agt.service

  mysql> select * from segmenthostmappings;
  
+--------------------------------------+--------------------------------------+
  | segment_id                           | host                                 
|
  
+--------------------------------------+--------------------------------------+
  | 712e8a82-a5f9-4506-9520-fc5b4b01529e | 30e70889-d50c-42a8-8776-f5e8cdce3609 
|
  | 712e8a82-a5f9-4506-9520-fc5b4b01529e | a3930bb2-a742-44f8-954e-49be373477db 
|
  | 712e8a82-a5f9-4506-9520-fc5b4b01529e | cbb3f623-f300-4dd3-ab09-c05b1e9b9a75 
|
  | 712e8a82-a5f9-4506-9520-fc5b4b01529e | devstack                             
|
  | e0673f45-e9b4-4672-874f-e2eb65d74d70 | devstack                             
|
  | e2c8c728-9e55-4047-b56f-701375887da9 | devstack                             
|
  | ede8201d-0766-4a18-9df0-1b6292f99592 | 30e70889-d50c-42a8-8776-f5e8cdce3609 
|
  | ede8201d-0766-4a18-9df0-1b6292f99592 | a3930bb2-a742-44f8-954e-49be373477db 
|
  | ede8201d-0766-4a18-9df0-1b6292f99592 | cbb3f623-f300-4dd3-ab09-c05b1e9b9a75 
|
  | ede8201d-0766-4a18-9df0-1b6292f99592 | devstack                             
|
  
+--------------------------------------+--------------------------------------+

  To get the DHCP namespace up and running the DHCP agent service must
  be restarted as well.

  stack@devstack:~/devstack$ ip netns list
  qdhcp-6fd5f856-bcf6-4821-a85c-18139e934061 (id: 2)
  qrouter-ea62445b-ea09-4a2d-88e9-87bede21d6c6 (id: 1)
  qdhcp-4b9aae0e-482d-402f-a7c4-2acaad2f3620 (id: 0)

  stack@devstack:~/devstack$ sudo systemctl restart
  devstack@q-dhcp.service

  stack@devstack:~/devstack$ ip netns list
  qdhcp-b435b564-ce44-4fc1-bec2-2a4ccb27346f (id: 3)   <-- The DHCP was created.
  qdhcp-6fd5f856-bcf6-4821-a85c-18139e934061 (id: 2)
  qrouter-ea62445b-ea09-4a2d-88e9-87bede21d6c6 (id: 1)
  qdhcp-4b9aae0e-482d-402f-a7c4-2acaad2f3620 (id: 0)

  
  In this CI job[2] with patch[3] we can see that the host is added with no 
segments:

  May 19 17:47:34.266428 ubuntu-focal-ovh-bhs1-0029706921 neutron-
  server[84188]: DEBUG neutron.services.segments.db [None req-
  ac845447-48ed-4c73-85c9-347133259602 None None] Segments set() mapped
  to the host ubuntu-focal-ovh-bhs1-0029706921 {{(pid=84188)
  update_segment_host_mapping
  /opt/stack/neutron/neutron/services/segments/db.py:237}}

  [1] 
https://opendev.org/openstack/neutron/src/branch/master/neutron/agent/dhcp/agent.py#L403
  [2] https://review.opendev.org/c/openstack/networking-baremetal/+/842578
  [3] https://review.opendev.org/842576

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1975542/+subscriptions


-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to