Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'manual' is not one of ['dhcp4', 'dhcp', 'dhcp6', 'static', 'static6', 'ipv6_dhcpv6-stateful', 'ipv6_dhcpv6-stateless', 'ipv6_slaac'] #5769

Open
jorhett opened this issue Oct 2, 2024 · 2 comments
Labels
bug Something isn't working correctly good first issue hacktoberfest Issues to be completed during Hacktoberfest. Curated list of good first issue tags.

Comments

@jorhett
Copy link

jorhett commented Oct 2, 2024

Bug report

Cloud-init is failing to parse a network.v1 definition created by curtin:

2024-10-02 02:20:45,354 - schema.py[WARNING]: Invalid network-config provided:
config.1.subnets.0.type: 'manual' is not one of ['dhcp4', 'dhcp', 'dhcp6', 'static', 'static6', 'ipv6_dhcpv6-stateful', 'ipv6_dhcpv6-stateless', 'ipv6_slaac']
config.2.subnets.0.type: 'manual' is not one of ['dhcp4', 'dhcp', 'dhcp6', 'static', 'static6', 'ipv6_dhcpv6-stateful', 'ipv6_dhcpv6-stateless', 'ipv6_slaac']
config.3.subnets.0.type: 'manual' is not one of ['dhcp4', 'dhcp', 'dhcp6', 'static', 'static6', 'ipv6_dhcpv6-stateful', 'ipv6_dhcpv6-stateless', 'ipv6_slaac']

@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:

- 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

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?

    subnets:
    - type: static
      control: manual

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 version: cloud-init-23.4-7.el9_4.6.alma.1.noarch
  • Operating System Distribution: Alma Linux 9.4
  • Cloud provider, platform or installer type: MaaS utilizes curtin which creates a cloudconfig like this:
#cloud-config
datasource:
  MAAS:
    metadata_url: http://maas.example.com:5248/MAAS/metadata/

cloud-init logs

cloud-init.tar.gz

@jorhett jorhett added bug Something isn't working correctly new An issue that still needs triage labels Oct 2, 2024
@aciba90
Copy link
Contributor

aciba90 commented Oct 4, 2024

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 aciba90 added good first issue hacktoberfest Issues to be completed during Hacktoberfest. Curated list of good first issue tags. and removed new An issue that still needs triage labels Oct 4, 2024
@jorhett
Copy link
Author

jorhett commented Oct 4, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly good first issue hacktoberfest Issues to be completed during Hacktoberfest. Curated list of good first issue tags.
Projects
None yet
Development

No branches or pull requests

2 participants