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

Network interface name being treated as float #133

Open
neilgierman opened this issue Apr 1, 2024 · 3 comments
Open

Network interface name being treated as float #133

neilgierman opened this issue Apr 1, 2024 · 3 comments

Comments

@neilgierman
Copy link

In my config, my bond name is "2920" and one of my VLAN IDs is "3900". So the name for that vlan interface is "2920.3900" in my network-config. The problem is, I think cloudbase-init (python) thinks it is a float and is dropping the trailing zeroes and my interface name becomes "2920.39". I don't see a way to tell cloudbase-init to treat the vlan interface name as a string, and don't drop the trailing zeroes.

Minimal config with MACs and IPs removed:

version: 1
config:
  - type: physical
    name: eth2
  - type: bond
    name: 2920
    bond_interfaces:
      -  eth2
  - type: vlan
    name: 2920.3900
    vlan_link: 2920
    vlan_id: 3900
@ader1990
Copy link
Member

ader1990 commented Apr 1, 2024

Hello, I tried to reproduce the issue, but could not on my environment.
There is a log info on the https://github.com/cloudbase/cloudbase-init/blob/master/cloudbaseinit/plugins/common/networkconfig.py#L235 that might bring some clarity.

Can you please share the cloudbase-init log related to the above code line?

Thank you.

@neilgierman
Copy link
Author

I was able to work around this. If I put the interface name in double quotes, it will keep the trailing zeroes:

......
- type: vlan
  name: "2920.3900"
  vlan_link: 2920
  vlan_id: 3900
.....

@ader1990
Copy link
Member

ader1990 commented Apr 2, 2024

I was able to work around this. If I put the interface name in double quotes, it will keep the trailing zeroes:

......
- type: vlan
  name: "2920.3900"
  vlan_link: 2920
  vlan_id: 3900
.....

Yes, it seems that is in the free format YAML specification. I saw that the network config documentation link is also broken, will update it accordingly to https://docs.cloud-init.io/en/latest/reference/network-config-format-v1.html#network-config-v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants