← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2117478] [NEW] Missing gateway in network_data.json

 

Public bug reported:

Hey,

I just found that the network_data.json misses the gateway option in
l3_ipv4_network (and I suspect also in the ipv6 version). A gateway
option only exists for l3_ipv4_network_route and l3_ipv6_network_route.

If you look into the CloudInit implementation it is using that property
https://github.com/canonical/cloud-
init/blob/main/cloudinit/sources/helpers/openstack.py#L576 to define the
gateway address.

Is it missing on the schema definition or does CloudInit use an
deprecated value?

Because setting the default gateway via routes can cause issues if the
gateway address is outside of the subnet because the on-link flag will
not be templated on the resulting netplan conifg - which is required in
such scenarios.

The netplan module of CloudInit templates the on-link flag only for the gateway and not for routes:
https://github.com/canonical/cloud-init/blob/main/cloudinit/net/netplan.py#L141

So either the netplan module in CloudInit is missing that flag when
adding routes https://github.com/canonical/cloud-
init/blob/main/cloudinit/net/netplan.py#L162 and the default gateway
should be defined as an 0.0.0.0/0 route or the schema is outdated and
misses the gateway.

Schema I used to compare:
https://docs.openstack.org/nova/latest/_downloads/9119ca7ac90aa2990e762c08baea3a36/network_data.json

Regards
Alex

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2117478

Title:
  Missing gateway in network_data.json

Status in OpenStack Compute (nova):
  New

Bug description:
  Hey,

  I just found that the network_data.json misses the gateway option in
  l3_ipv4_network (and I suspect also in the ipv6 version). A gateway
  option only exists for l3_ipv4_network_route and
  l3_ipv6_network_route.

  If you look into the CloudInit implementation it is using that
  property https://github.com/canonical/cloud-
  init/blob/main/cloudinit/sources/helpers/openstack.py#L576 to define
  the gateway address.

  Is it missing on the schema definition or does CloudInit use an
  deprecated value?

  Because setting the default gateway via routes can cause issues if the
  gateway address is outside of the subnet because the on-link flag will
  not be templated on the resulting netplan conifg - which is required
  in such scenarios.

  The netplan module of CloudInit templates the on-link flag only for the gateway and not for routes:
  https://github.com/canonical/cloud-init/blob/main/cloudinit/net/netplan.py#L141

  So either the netplan module in CloudInit is missing that flag when
  adding routes https://github.com/canonical/cloud-
  init/blob/main/cloudinit/net/netplan.py#L162 and the default gateway
  should be defined as an 0.0.0.0/0 route or the schema is outdated and
  misses the gateway.

  Schema I used to compare:
  https://docs.openstack.org/nova/latest/_downloads/9119ca7ac90aa2990e762c08baea3a36/network_data.json

  Regards
  Alex

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