OVN: Metadata is not provisioned for a network with DHCP turned off

Bug #1976366 reported by Max Khon
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Medium
Unassigned

Bug Description

Can be related to #1918914

Openstack version: Ussuri

I have a very simple deployment with a single flat provider network (not sure it matters) with a subnet with DHCP turned off (instances are created only with this network).

In this case neutron-ovn-metadata-agent does not provision metadata service for this network:

---
root@eq-os1:~# ovn-sbctl find Port_Binding type=localport
_uuid : b6329cbe-e80f-48a3-921d-e1031afd85d8
chassis : []
datapath : 097732e0-85d1-4744-a9c6-bafa0d861700
encap : []
external_ids : {"neutron:cidrs"="", "neutron:device_id"=ovnmeta-81954d74-51e6-4598-b6b6-3da3832f20df, "neutron:device_owner"="network:dhcp", "neutron:network_name"=neutron-81954d74-51e6-4598-b6b6-3da3832f20df, "neutron:port_name"="", "neutron:project_id"=f11221fbfbb844209cd49c7ca3a12a00, "neutron:revision_number"="1", "neutron:security_group_ids"=""}
gateway_chassis : []
ha_chassis_group : []
logical_port : "a557f47a-dae7-4150-96c2-71abbf48b84b"
mac : ["fa:16:3e:06:ed:9b"]
nat_addresses : []
options : {requested-chassis=""}
parent_port : []
tag : []
tunnel_key : 2
type : localport
virtual_parent : []
root@eq-os1:~#
---

The reason is that external_ids:neutron:cidrs is empty so provision_datapath() ignores this network in this case:

--- neutron/agent/ovn/metadata/agent.py ---
        # If there's no metadata port or it doesn't have a MAC or IP
        # addresses, then tear the namespace down if needed. This might happen
        # when there are no subnets yet created so metadata port doesn't have
        # an IP address.
        if not (port and port.mac and
                port.external_ids.get(ovn_const.OVN_CIDRS_EXT_ID_KEY, None)):
            LOG.debug("There is no metadata port for network %s or it has no "
                      "MAC or IP addresses configured, tearing the namespace "
                      "down if needed", net_name)
            self.teardown_datapath(datapath, net_name)
            return
---

When DHCP is enabled neutron:cidrs gets not empty and metadata is properly provisioned.

Tags: ovn
Max Khon (fjoe)
description: updated
description: updated
description: updated
Max Khon (fjoe)
description: updated
Revision history for this message
Brian Haley (brian-haley) wrote :

As you mentioned, this might be related to https://bugs.launchpad.net/neutron/+bug/1918914 - as there is no DHCP port in either case. Since Rodolfo responded in the other one let's see if he responds there to your recent comment.

Changed in neutron:
status: New → Confirmed
importance: Undecided → Medium
tags: added: ovn
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello Max:

If any of the subnets of a network have DHCP capabilities, the metadata port of this network namespace will have no IP assigned (exactly the OVN metadata code you are pointing [1]). That means we can't provide the metadata via the metadata IP. You need to use a config-drive in this case [2].

Regards.

[1]https://github.com/openstack/neutron/blob/09207ba731bfc859c2f6d175588a8bfe09be01db/neutron/agent/ovn/metadata/agent.py#L431-L437
[2]https://docs.openstack.org/nova/latest/admin/config-drive.html

Changed in neutron:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.