Open jorhett opened 1 month ago
Thanks, @jorhett, for reporting this and making cloud-init better.
I can reproduce this with cloud-init 24.4~3+really24.3.1-0ubuntu4
with:
# cat v1.yaml
network:
version: 1
config:
- id: enp129s0f1
mac_address: 34:80:0d:2c:a4:99
mtu: 1500
name: enp129s0f1
subnets:
- type: manual
type: physical
- id: enp129s0f2
mac_address: 34:80:0d:2c:a4:9a
mtu: 1500
name: enp129s0f2
subnets:
- type: manual
type: physical
- id: enp129s0f3
mac_address: 34:80:0d:2c:a4:9b
mtu: 1500
name: enp129s0f3
subnets:
- type: manual
type: physical
# cloud-init schema -t network-config -c ./v1.yaml
Invalid network-config ./v1.yaml
Error: Cloud config schema errors: network.config.0.subnets.0.type: 'manual' is not one of ['dhcp4', 'dhcp', 'dhcp6', 'static', 'static6', 'ipv6_dhcpv6-stateful', 'ipv6_dhcpv6-stateless', 'ipv6_slaac'], network.config.1.subnets.0.type: 'manual' is not one of ['dhcp4', 'dhcp', 'dhcp6', 'static', 'static6', 'ipv6_dhcpv6-stateful', 'ipv6_dhcpv6-stateless', 'ipv6_slaac'], network.config.2.subnets.0.type: 'manual' is not one of ['dhcp4', 'dhcp', 'dhcp6', 'static', 'static6', 'ipv6_dhcpv6-stateful', 'ipv6_dhcpv6-stateless', 'ipv6_slaac']
Error: Invalid schema: network-config
It looks like the network-config-v1 is missing this value and the docs too.
@aciba90 fwiw I have submitted a proposed patch to MAAS that would make its output align with the documented v1 config https://bugs.launchpad.net/maas/+bug/2083540
Hi @aciba90, I can work on this as part of my onboarding, if that's ok?
@aciba90 fwiw I have submitted a proposed patch to MAAS that would make its output align with the documented v1 config https://bugs.launchpad.net/maas/+bug/2083540
@jorhett, thanks for tackling that!
Hi @aciba90, I can work on this as part of my onboarding, if that's ok?
Please do so, thanks!
@aciba90 I have posted https://github.com/canonical/cloud-init/pull/5875 to address this, let me know what you think of it.
Bug report
Cloud-init is failing to parse a network.v1 definition created by curtin:
@TheRealFalcon requested that I separate this issue out from #2880
Steps to reproduce the problem
This is being generated by
maas
, so recreation steps are overlong, but the generated config for unconfigured/unused interfaces looks like this:This is causing the entire network configuration to fail, such that it is not applied to the interface which is configured.
As I look at this configuration, it does appear that perhaps this is a mistake by curtin? Should it perhaps be this?
If my judgement of this is correct, then it should perhaps be considered a documentation error for the network config v1 format as there's actually no description of the type field here: https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v1.html#subnet-ip
Environment details
cloud-init-23.4-7.el9_4.6.alma.1.noarch
cloud-init logs
cloud-init.tar.gz